Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
AnitaEventCalibrator Class Reference

AnitaEventCalibrator – The ANITA Event Calibrator. More...

#include <AnitaEventCalibrator.h>

Public Member Functions

Int_t calibrateUsefulEvent (UsefulAnitaEvent *eventPtr, WaveCalType::WaveCalType_t calType)
 Calibration Routine The routine that is used to calibrate the voltage time waveforms in a UsefulAnitaEvent. More...
 
void guessRco (UsefulAnitaEvent *eventPtr)
 Guess RCO from clock.
 
void getTempFactors (UsefulAnitaEvent *eventPtr)
 Interface to RingBuffer of clock periods for temperature correction.
 
void updateTemperatureCorrection (UsefulAnitaEvent *eventPtr)
 Update RingBuffer for this event. More...
 
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)
 
void applyVoltageCalibration (UsefulAnitaEvent *eventPtr)
 
void keepOnlySomeTimeAfterClockUptick (TGraph *grClock, Double_t deltaClockKeepNs)
 
std::vector< Double_t > getClockAlignment (UsefulAnitaEvent *eventPtr, Int_t numPoints[12], Double_t volts[12][9][260], Double_t times[12][260])
 
std::vector< Double_t > getClockAlignment (UsefulAnitaEvent *eventPtr, Int_t numPoints[12], Double_t volts[12][9][260], Double_t times[12][260], std::vector< Int_t > listOfClockNums)
 
void deleteClockAlignmentTGraphs ()
 
void zeroMeanNonClockChannels ()
 
Double_t getTimeOfZeroCrossing (Double_t x1, Double_t y1, Double_t x2, Double_t y2)
 
Int_t getTimeOfUpwardsClockTicksCrossingZero (Int_t numPoints, Int_t surf, Double_t *times, Double_t *volts, std::vector< Double_t > &timeZeroCrossings, std::vector< Int_t > &sampZeroCrossings, bool raiseFlagIfClocksAreWeird)
 
void findExtremaSamples (Int_t length, Double_t *volts, std::vector< Int_t > &maximaSamps, std::vector< Int_t > &minimaSamps)
 
void initializeVectors ()
 
Double_t convertRfPowTodBm (int surf, int chan, int adc)
 
Double_t convertRfPowToKelvin (int surf, int chan, int adc)
 
 AnitaEventCalibrator ()
 

Static Public Member Functions

static AnitaEventCalibratorInstance (int version=0)
 Instance generator.
 

Public Attributes

Double_t voltsArray [12][9][260]
 Channel volts in mV.
 
Double_t timeArray [12][260]
 Channel times in ns.
 
Int_t numPointsArray [12]
 Number of samples in each channel.
 
Int_t scaArray [12][260]
 Capacitor numbers for each sample.
 
std::vector< std::vector< RingBuffer > > clockPeriodRingBuffers
 Holds rolling average of temperature correction.
 
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.
 
std::vector< std::vector< std::vector< Double_t > > > measuredClockPeriods
 
Double_t relativeCableDelays [12][9][4]
 From AMPA inputs to digizier delays.
 
Double_t relativePhaseCenterToAmpaDelays [12][9]
 From phase center to AMPAs (hopefully)
 
Double_t deltaTs [12][4][2][260]
 Calib constants: The time for the write pointer to travel between successove capacitors.
 
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 the LAB-3 digitizers)
 
Double_t mvCalibVals [12][9][4]
 Calib constants: converts from ADC counts to millivolts.
 
Double_t clockKeepTime [12][4]
 How much time after clock up-tick to keep, calib food.
 
Int_t firstHitBusRcoLatchLimit
 
std::vector< Int_t > defaultClocksToAlign
 List of SURFs for getClockAlignment() (for calibration progs)
 
std::vector< TGraph * > grClockInterps
 Interpolated clocks.
 
std::map< Double_t, TGraph * > grClock0s
 Need to process clock 0 depending on needs of other SURF.
 
std::vector< TGraph * > grCorClock
 
std::vector< TGraph * > grClocks
 
std::vector< Double_t > clockAlignment
 
Double_t dtInterp
 Interpolating clock for alignment step.
 
Double_t nominalDeltaT
 If we don't want bin-to-bin deltaTs.
 
Int_t fClockProblem
 Flag raised if more than 4 or less than 2 upgoing zero crossings in a SURF clock.
 
Int_t fClockSpike
 Flag raised if the voltage is too large or too small in Surf clock.
 
Double_t RfPowYInt [12][9]
 
Double_t RfPowSlope [12][9]
 

Detailed Description

AnitaEventCalibrator – The ANITA Event Calibrator.

Used to calibrate the raw ANITA data into voltage-time waveforms

Definition at line 46 of file AnitaEventCalibrator.h.

Inheritance diagram for AnitaEventCalibrator:
Inheritance graph
[legend]
Collaboration diagram for AnitaEventCalibrator:
Collaboration graph
[legend]

Constructor & Destructor Documentation

AnitaEventCalibrator::AnitaEventCalibrator ( )

< From what capacitor number to trust latched RCO value.

< in nanoseconds, for clock alignment interpolation

< in nanoseconds

< If unreasonable number of zero crossings in clock, raise flag & skip temp correction update

Definition at line 24 of file AnitaEventCalibrator.cxx.

Member Function Documentation

Int_t AnitaEventCalibrator::calibrateUsefulEvent ( UsefulAnitaEvent eventPtr,
WaveCalType::WaveCalType_t  calType 
)

Calibration Routine The routine that is used to calibrate the voltage time waveforms in a UsefulAnitaEvent.

The routines to calibrate a RawAnitaEvent into an UsefulAnitaEvent. The exact type of calibration applied depends on the WaveCalType::WaveCalType_t selected.Workhorse

The plan for calibration happiness: Step 1: figure out from WaveCalType_t calType exactly what we're going to do Step 2: Remove the spiky clock Step 3: Figure out RCO phase from clock period (if bin-to-bin dts required) Step 4: Update rolling temperature correction (+copy to event) Step 5: Unwrap all channels (if requested) Step 6: Apply bin-to-bin timing (if requested) Step 7: Apply voltage calib (if requested) Step 8: Find trigger jitter correction Step 9: Zero mean all non-clock channels Step 10: Apply channel-to-channel cable delays Step 11: Copy everything to UsefulAnitaEvent

Step 1: figure out from WaveCalType_t calType exactly what we're going to do.

Step 3: Figure out RCO phase from clock period (if bin-to-bin dts required)

< If we have an issue with the clock (more than 4 zero crossings or less than 3) then we raise this flag to not update rolling average temperature correction.

Step 4: Update rolling temperature correction (copy to usefulAnitaEvent)

< This is pretty important as RCO guess needs accurate clock

Steps 5: Unwrap all channels (if requested)

Step 6: Apply bin-to-bin timing (if requested)

Step 7: Apply voltage calib (if requested)

Step 8: Find trigger jitter correction

Step 9: Zero mean all non-clock channels

Step 10: Apply channel-to-channel cable delays Step 11: Copy voltage, time (with cable delays) & capacitor arrays to UsefulAnitaEvent

Definition at line 116 of file AnitaEventCalibrator.cxx.

void AnitaEventCalibrator::initializeVectors ( )

< Very important this doesn't start at 0, things will break if it does!

Definition at line 93 of file AnitaEventCalibrator.cxx.

Int_t AnitaEventCalibrator::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 
)

< Used to count how many extra capacitors to include after the wrap around

< Each LAB has its own set of deltaTs and epsilons

< Given by firmware

< Given by firmware

< nextExtra used for deciding whether or not to insert capacitors after 255

< sum of times of those extra capacitors

< This is the time of the first capacitor.

This is Andres's 220ps minimum sample separation

Definition at line 1428 of file AnitaEventCalibrator.cxx.

void AnitaEventCalibrator::updateTemperatureCorrection ( UsefulAnitaEvent eventPtr)

Update RingBuffer for this event.

N.B. This function relies on the results of the guessRCO() to have the measured clock periods

Definition at line 848 of file AnitaEventCalibrator.cxx.


The documentation for this class was generated from the following files: