ANITA Event Reader
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>

Inheritance diagram for AnitaEventCalibrator:

Public Member Functions

 AnitaEventCalibrator ()
 
void applyVoltageCalibration (UsefulAnitaEvent *eventPtr)
 
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...
 
Double_t convertRfPowTodBm (int surf, int chan, int adc)
 
Double_t convertRfPowToKelvin (int surf, int chan, int adc)
 
void deleteClockAlignmentTGraphs ()
 
void findExtremaSamples (Int_t length, Double_t *volts, std::vector< Int_t > &maximaSamps, std::vector< Int_t > &minimaSamps)
 
std::vector< Double_t > getClockAlignment (UsefulAnitaEvent *eventPtr, Int_t numPoints[NUM_SURF], Double_t volts[NUM_SURF][NUM_CHAN][NUM_SAMP], Double_t times[NUM_SURF][NUM_SAMP])
 
std::vector< Double_t > getClockAlignment (UsefulAnitaEvent *eventPtr, Int_t numPoints[NUM_SURF], Double_t volts[NUM_SURF][NUM_CHAN][NUM_SAMP], Double_t times[NUM_SURF][NUM_SAMP], std::vector< Int_t > listOfClockNums)
 
void getTempFactors (UsefulAnitaEvent *eventPtr)
 Interface to RingBuffer of clock periods for temperature correction.
 
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)
 
Double_t getTimeOfZeroCrossing (Double_t x1, Double_t y1, Double_t x2, Double_t y2)
 
void guessRco (UsefulAnitaEvent *eventPtr)
 Guess RCO from clock.
 
void initializeVectors ()
 
void keepOnlySomeTimeAfterClockUptick (TGraph *grClock, Double_t deltaClockKeepNs)
 
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 updateTemperatureCorrection (UsefulAnitaEvent *eventPtr)
 Update RingBuffer for this event. More...
 
void zeroMeanNonClockChannels ()
 

Static Public Member Functions

static AnitaEventCalibratorInstance (int version=0)
 Instance generator.
 

Public Attributes

std::vector< Double_t > clockAlignment
 
Double_t clockKeepTime [NUM_SURF][NUM_CHIP]
 How much time after clock up-tick to keep, calib food.
 
std::vector< std::vector< RingBuffer > > clockPeriodRingBuffers
 Holds rolling average of temperature correction.
 
std::vector< Int_t > defaultClocksToAlign
 List of SURFs for getClockAlignment() (for calibration progs)
 
Double_t deltaTs [NUM_SURF][NUM_CHIP][NUM_RCO][NUM_SAMP]
 Calib constants: The time for the write pointer to travel between successove capacitors.
 
Double_t dtInterp
 Interpolating clock for alignment step.
 
Double_t epsilons [NUM_SURF][NUM_CHIP][NUM_RCO]
 Calib constants: time (ns) for write pointer to go from sample 255 -> 0 (in ANITA-2 and ANITA-3 with the LAB-3 digitizers)
 
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.
 
Int_t firstHitBusRcoLatchLimit
 
std::map< Double_t, TGraph * > grClock0s
 Need to process clock 0 depending on needs of other SURF.
 
std::vector< TGraph * > grClockInterps
 Interpolated clocks.
 
std::vector< TGraph * > grClocks
 
std::vector< TGraph * > grCorClock
 
std::vector< std::vector< std::vector< Double_t > > > measuredClockPeriods
 
Double_t mvCalibVals [NUM_SURF][NUM_CHAN][NUM_CHIP]
 Calib constants: converts from ADC counts to millivolts.
 
Double_t nominalDeltaT
 If we don't want bin-to-bin deltaTs.
 
Int_t numPointsArray [NUM_SURF]
 Number of samples in each channel.
 
std::vector< Int_t > rcoVector
 The output of AnitaEventCalibrator::guessRco() goes here.
 
Double_t relativeCableDelays [NUM_SURF][NUM_CHAN][NUM_CHIP]
 From AMPA inputs to digizier delays.
 
Double_t relativePhaseCenterToAmpaDelays [NUM_SURF][NUM_CHAN]
 From phase center to AMPAs (hopefully)
 
Double_t RfPowSlope [NUM_SURF][NUM_CHAN]
 
Double_t RfPowYInt [NUM_SURF][NUM_CHAN]
 
Int_t scaArray [NUM_SURF][NUM_SAMP]
 Capacitor numbers for each sample.
 
std::vector< Double_t > tempFactors
 Multiplicative factor for deltaTs & epsilons accounting for temperature.
 
Double_t timeArray [NUM_SURF][NUM_SAMP]
 Channel times in ns.
 
Double_t voltsArray [NUM_SURF][CHANNELS_PER_SURF][NUM_SAMP]
 Channel volts in mV.
 

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.

Constructor & Destructor Documentation

◆ AnitaEventCalibrator()

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

◆ calibrateUsefulEvent()

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.

◆ initializeVectors()

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.

◆ unwrapChannel()

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.

◆ updateTemperatureCorrection()

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: