9 #ifndef ANITAEVENTCALIBRATOR_H 10 #define ANITAEVENTCALIBRATOR_H 29 #include "AnitaConventions.h" 30 #include "simpleStructs.h" 31 #include "AnitaClock.h" 32 #include "AnitaGeomTool.h" 33 #include "RingBuffer.h" 34 #include "RawAnitaHeader.h" 67 Bool_t fApplyTempCorrection, Bool_t fAddPedestal,
70 void keepOnlySomeTimeAfterClockUptick(TGraph* grClock, Double_t deltaClockKeepNs);
73 Int_t numPoints[NUM_SURF],
74 Double_t volts[NUM_SURF][NUM_CHAN][NUM_SAMP],
75 Double_t times[NUM_SURF][NUM_SAMP]);
77 Int_t numPoints[NUM_SURF],
78 Double_t volts[NUM_SURF][NUM_CHAN][NUM_SAMP],
79 Double_t times[NUM_SURF][NUM_SAMP],
80 std::vector<Int_t> listOfClockNums);
81 void deleteClockAlignmentTGraphs();
82 void zeroMeanNonClockChannels();
84 Double_t getTimeOfZeroCrossing(Double_t x1, Double_t y1, Double_t x2, Double_t y2);
85 Int_t getTimeOfUpwardsClockTicksCrossingZero(Int_t numPoints, Int_t surf, Double_t* times,
87 std::vector<Double_t>& timeZeroCrossings,
88 std::vector<Int_t>& sampZeroCrossings,
89 bool raiseFlagIfClocksAreWeird);
91 void findExtremaSamples(Int_t length, Double_t* volts,
92 std::vector<Int_t>& maximaSamps,
93 std::vector<Int_t>& minimaSamps);
117 std::vector<std::vector<std::vector<Double_t> > > measuredClockPeriods;
122 Double_t
deltaTs[NUM_SURF][NUM_CHIP][NUM_RCO][NUM_SAMP];
128 Int_t firstHitBusRcoLatchLimit;
134 std::vector<TGraph*> grCorClock;
135 std::vector<TGraph*> grClocks;
138 std::vector<Double_t> clockAlignment;
146 Double_t convertRfPowTodBm(
int surf,
int chan,
int adc);
147 Double_t convertRfPowToKelvin(
int surf,
int chan,
int adc);
149 Double_t RfPowYInt[NUM_SURF][NUM_CHAN];
150 Double_t RfPowSlope[NUM_SURF][NUM_CHAN];
166 #endif //ANITAEVENTCALIBRATOR_H Int_t numPointsArray[12]
Number of samples in each channel.
std::vector< std::vector< RingBuffer > > clockPeriodRingBuffers
Holds rolling average of temperature correction.
Double_t clockKeepTime[12][4]
How much time after clock up-tick to keep, calib food.
enum WaveCalType::EWaveCalType WaveCalType_t
The calibration enumeration type.
static AnitaEventCalibrator * Instance(int version=0)
Instance generator.
std::map< Double_t, TGraph * > grClock0s
Need to process clock 0 depending on needs of other SURF.
Double_t epsilons[12][4][2]
Calib constants: time (ns) for write pointer to go from sample 255 -> 0 (in ANITA-2 and ANITA-3 with ...
Double_t deltaTs[12][4][2][260]
Calib constants: The time for the write pointer to travel between successove capacitors.
Double_t dtInterp
Interpolating clock for alignment step.
Int_t calibrateUsefulEvent(UsefulAnitaEvent *eventPtr, WaveCalType::WaveCalType_t calType)
Calibration Routine The routine that is used to calibrate the voltage time waveforms in a UsefulAnita...
AnitaEventCalibrator – The ANITA Event Calibrator.
std::vector< Int_t > defaultClocksToAlign
List of SURFs for getClockAlignment() (for calibration progs)
void updateTemperatureCorrection(UsefulAnitaEvent *eventPtr)
Update RingBuffer for this event.
Double_t voltsArray[12][9][260]
Channel volts in mV.
void getTempFactors(UsefulAnitaEvent *eventPtr)
Interface to RingBuffer of clock periods for temperature correction.
std::vector< TGraph * > grClockInterps
Interpolated clocks.
UsefulAnitaEvent – The Calibrated Useful Anita Event object.
void guessRco(UsefulAnitaEvent *eventPtr)
Guess RCO from clock.
Double_t relativeCableDelays[12][9][4]
From AMPA inputs to digizier delays.
Int_t fClockSpike
Flag raised if the voltage is too large or too small in Surf clock.
Int_t unwrapChannel(UsefulAnitaEvent *eventPtr, Int_t surf, Int_t chan, Int_t rco, Bool_t fApplyTempCorrection, Bool_t fAddPedestal, Double_t *voltsArray, Double_t *timeArray, Int_t *scaArray)
Double_t nominalDeltaT
If we don't want bin-to-bin deltaTs.
Double_t relativePhaseCenterToAmpaDelays[12][9]
From phase center to AMPAs (hopefully)
Double_t timeArray[12][260]
Channel times in ns.
Int_t fClockProblem
Flag raised if more than 4 or less than 2 upgoing zero crossings in a SURF clock. ...
Int_t scaArray[12][260]
Capacitor numbers for each sample.
Double_t mvCalibVals[12][9][4]
Calib constants: converts from ADC counts to millivolts.
std::vector< Double_t > tempFactors
Multiplicative factor for deltaTs & epsilons accounting for temperature.
std::vector< Int_t > rcoVector
The output of AnitaEventCalibrator::guessRco() goes here.