UsefulAnitaEvent.h
1 
9 #ifndef USEFULANITAEVENT_H
10 #define USEFULANITAEVENT_H
11 
12 //Includes
13 #include <TObject.h>
14 #include "RawAnitaEvent.h"
15 #include "AnitaConventions.h"
16 
17 #include <map>
18 #include <vector>
19 
20 class TGraph;
22 class PrettyAnitaHk;
23 class RawAnitaHeader;
25 
27 
32 {
33 
34  public:
37  // UsefulAnitaEvent(CalibratedAnitaEvent *calibratedPtr, WaveCalType::WaveCalType_t calType, RawAnitaHeader* theHd); ///< Assignment constructor from a CalibratedAnitaEvent
40  UsefulAnitaEvent(RawAnitaEvent *eventPtr,WaveCalType::WaveCalType_t calType, Double_t surfTemp);
41  UsefulAnitaEvent(RawAnitaEvent *eventPtr,WaveCalType::WaveCalType_t calType, RawAnitaHeader *theHd, std::vector<Double_t>* rcoInfo, std::vector<Double_t>* clockPhiInfo, std::vector<Double_t>* tempFactorInfo, Int_t clockProblemInfo, Int_t clockSpikeInfo, Int_t rfSpikeInfo);
42  virtual ~UsefulAnitaEvent();
44 
45  //Generally useful function
46  static int getChanIndex(int surf, int chan)
47  {return chan+(CHANNELS_PER_SURF*surf);}
48 
49 
50  TGraph *getGraphFromSurfAndChan(int surf, int chan) const;
51  TGraph *getGraph(int chanIndex) const;
52  TGraph *getGraph(int ant, AnitaPol::AnitaPol_t pol) const;
53  TGraph *getGraph(AnitaRing::AnitaRing_t ring,
54  int phi,
55  AnitaPol::AnitaPol_t pol) const;
56  TGraph *getDeconvolvedALFA(); //
57  Int_t guessRco(int chanIndex);
58  Int_t getRcoCorrected(int chanIndex);
59  // Double_t getTempCorrectionFactor(); ///< Returns the temperature correction factor (or guesses at it using clock periods if necessary)
60  // void analyseClocksForGuesses();
61  // void analyseClocksForTempGuessBen();
62 
63 
64  // std::vector<std::vector<Double_t> > getNeighbouringClockCorrelations(Double_t lowPassClockFilterFreq, Int_t giveGraphsToInputArrays, TGraph* grInterpClocksArray[NUM_SURF], TGraph* grCorClocksArray[NUM_SURF][2]);
65  // std::vector<std::vector<Double_t> > getNeighbouringClockCorrelations2(bool writeGraphs);
66 
67  std::vector<Double_t> getClockAlignment(std::vector<Int_t> listOfClockNums);
68  Int_t checkIfTreatingCalibratedEventAsRawEvent(RawAnitaEvent* rawEventPtr, const char* funcName);
69 
70 
71 
72  //The calibrated numbers
74  UInt_t fC3poNum;
75  Int_t gotCalibTemp;
76  Double_t calibTemp;
78  int fNumPoints[NUM_DIGITZED_CHANNELS];
79  double fVolts[NUM_DIGITZED_CHANNELS][NUM_SAMP];
80  double fTimes[NUM_DIGITZED_CHANNELS][NUM_SAMP];
81  int fCapacitorNum[NUM_DIGITZED_CHANNELS][NUM_SAMP];
83  Int_t fRcoArray[NUM_SURF];
84  Double_t fTempFactorGuesses[NUM_SURF];
85  Int_t fClockProblem;
86  Int_t fClockSpike;
87  Int_t fRFSpike;
88  Double_t fClockPhiArray[NUM_SURF];
89  std::vector<int> SpikeyRFChannelList;
90 
91  Bool_t getAlfaFilterFlag();
92  Bool_t setAlfaFilterFlag(Bool_t newBoolianFlag);
93 
94  private:
95  Bool_t fFilterAlfaChannel;
96 
97  ClassDef(UsefulAnitaEvent,7);
98 };
99 
100 
101 #endif //USEFULANITAEVENT_H
Double_t fTempFactorGuesses[12]
A holder variable to cling on to the temperature correction factor that we are guessing at...
Int_t checkIfTreatingCalibratedEventAsRawEvent(RawAnitaEvent *rawEventPtr, const char *funcName)
Prints a verbose error message if you&#39;re calling the wrong constructor type.
UInt_t fLastEventGuessed
Internal variable to see if we&#39;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.
Definition: PrettyAnitaHk.h:22
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 gotCalibTemp
Flag to check if we are using the temperature calibration.
std::vector< Double_t > getClockAlignment(std::vector< Int_t > listOfClockNums)
For calibration.
RawAnitaHeader – The Raw ANITA Event Header.
AnitaEventCalibrator – The ANITA Event Calibrator.
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.
What you should call for analysis work.
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&#39;t update temp correction. RCO guessing may also be negatively affected by this.
int fCapacitorNum[12 *9][260]
Array of capacitor numbers.
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.
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.
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.
Definition: RawAnitaEvent.h:22