10 #include "UsefulAnitaEvent.h" 11 #include "CalibratedAnitaEvent.h" 12 #include "AnitaGeomTool.h" 13 #include "PrettyAnitaHk.h" 14 #include "RawAnitaHeader.h" 15 #include "AnitaEventCalibrator.h" 20 #include "AnitaVersion.h" 37 setAlfaFilterFlag(
false);
56 for(
int surf=0;surf<NUM_SURF;surf++) {
63 setAlfaFilterFlag(AnitaVersion::get() == 3);
71 AnitaVersion::setVersionFromUnixTime(theHd->
realTime);
81 for(
int surf=0;surf<NUM_SURF;surf++) {
88 setAlfaFilterFlag(AnitaVersion::get() == 3);
99 AnitaVersion::setVersionFromUnixTime(theHk->
realTime);
116 setAlfaFilterFlag(AnitaVersion::get() == 3);
125 AnitaVersion::setVersionFromUnixTime(theHd->
realTime);
139 setAlfaFilterFlag(AnitaVersion::get() == 3);
142 std::cerr <<
"Warning! eventNumber mismatch in " << __FILE__ <<
" line " << __LINE__ <<
"." << std::endl;
143 std::cerr <<
"RawAnitaHeader->eventNumber = " << theHd->
eventNumber <<
" but " 144 <<
"UsefulAnitaEvent->eventNumber = " << eventPtr->
eventNumber 162 setAlfaFilterFlag(
false);
185 if(chanIndex<0 || chanIndex>=NUM_DIGITZED_CHANNELS)
189 int N = TMath::Min(
fNumPoints[chanIndex], NUM_SAMP);
191 TGraph *grPtr=
new TGraph(N,
197 const int alfaChannelIndex = 11*NUM_CHAN + 5;
198 if(fFilterAlfaChannel==
true && chanIndex==alfaChannelIndex){
199 const double lowPassFreq = 700;
209 TGraph *UsefulAnitaEvent::getDeconvolvedALFA()
240 Int_t surf = chanIndex / NUM_CHAN;
255 int rcoFirm = this->
getRCO(chanIndex);
256 int rcoSoft = 1-rcoFirm;
279 return fCalibrator->getClockAlignment(
this,
307 std::cerr <<
"WARNING in " << funcName <<
":" << std::endl;
308 std::cerr <<
"\tCalling constructor that that takes a RawAnitaEvent* with a CalibratedAnitaEvent*. " << std::endl;
309 std::cerr <<
"\tThe CalibratedAnitaEvent numbers are not being applied but are being recalculated on the fly." << std::endl;
310 std::cerr <<
"\tAt best this is slow. At worst this could change rolling averages." << std::endl;
311 std::cerr <<
"\tPlease use the constructor that takes a CalibratedAnitaEvent* instead." << std::endl;
323 return fFilterAlfaChannel;
329 Bool_t UsefulAnitaEvent::setAlfaFilterFlag(Bool_t newBoolianFlag){
331 fFilterAlfaChannel = newBoolianFlag;
333 fFilterAlfaChannel =
false;
335 return fFilterAlfaChannel;
UInt_t eventNumber
Event number from software.
Double_t fClockPhiArray[12]
An array to store the clock offsets.
Double_t fTempFactorGuesses[12]
A holder variable to cling on to the temperature correction factor that we are guessing at...
Int_t numPointsArray[12]
Number of samples in each channel.
Int_t checkIfTreatingCalibratedEventAsRawEvent(RawAnitaEvent *rawEventPtr, const char *funcName)
Prints a verbose error message if you're calling the wrong constructor type.
Float_t intTemps[19]
Internal temperatures, includes extra sbsTemps.
UInt_t fLastEventGuessed
Internal variable to see if we've already tried to guess the RCO and temp correction factors for this...
Int_t getRcoCorrected(int chanIndex)
Returns firmware RCO after correcting for latch delay (and factor of -1 for different definitions of ...
enum WaveCalType::EWaveCalType WaveCalType_t
The calibration enumeration type.
PrettyAnitaHk – The prettified ANITA Hk.
static AnitaEventCalibrator * Instance(int version=0)
Instance generator.
double fVolts[12 *9][260]
Array of unwrapped (unless kNoCalib) voltages for each channel.
int fNumPoints[12 *9]
Number of poins per channel.
UsefulAnitaEvent()
Default constructor.
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...
Int_t gotCalibTemp
Flag to check if we are using the temperature calibration.
Int_t getRCO(Int_t chanIndex) const
Returns the RCO phase.
std::vector< Double_t > getClockAlignment(std::vector< Int_t > listOfClockNums)
For calibration.
AnitaEventCalibrator – The ANITA Event Calibrator.
Double_t voltsArray[12][9][260]
Channel volts in mV.
TGraph * getGraphFromSurfAndChan(int surf, int chan) const
Returns a voltage-time waveform for given SURF and channel.
int calibrateEvent(WaveCalType::WaveCalType_t calType)
Work horse member function called by constructor.
enum AnitaRing::EAnitaRing AnitaRing_t
Ring enumeration.
UInt_t realTime
Time in unixTime.
virtual ~UsefulAnitaEvent()
Destructor.
Bool_t getAlfaFilterFlag()
a list to store the spikey RF channel.
Int_t fClockProblem
Flag raised if more than 4 upgoing zero crossings in clock, won't update temp correction. RCO guessing may also be negatively affected by this.
TGraph * getGraph(int chanIndex) const
Returns a voltage-time waveform for given channel index.
UsefulAnitaEvent – The Calibrated Useful Anita Event object.
Double_t calibTemp
Value for the temperature calibration.
Int_t fRcoArray[12]
An array to store the guessed at RCO values;.
CalibratedAnitaEvent – The Calibrated Calibrated Anita Event object.
UInt_t fC3poNum
Used to monitor the clock period.
static int getChanIndex(int surf, int chan)
Utility function.
Double_t fTempFactorGuesses[12]
A holder variable to cling on to the temperature correction factor that we are guessing at...
Double_t timeArray[12][260]
Channel times in ns.
Int_t fRFSpike
Flag raised if the ADC value is too large or small in RF.
WaveCalType::WaveCalType_t fCalType
The calibration type requested.
Int_t fRcoArray[12]
An array to store the guessed at RCO values.
Int_t guessRco(int chanIndex)
Looks at clock channel to try and guess which RCO phase we are in.
Int_t fFromCalibratedAnitaEvent
Flag used in determining whether the event came from a CalibratedAnitaEvent.
enum AnitaPol::EAnitaPol AnitaPol_t
Polarisation enumeration.
Double_t fClockPhiArray[12]
An array to store the derived clock calibration numbers (from aligning the clocks) ...
Int_t fClockSpike
Flag raised if the ADC value is too large or small in clock.
double fTimes[12 *9][260]
Array of unwrapped (unless kNoCalib) times for each channel.
RawAnitaEvent – The Raw ANITA Event Data.