RawAnitaHeader.h
1 
9 #ifndef RAWANITAHEADER_H
10 #define RAWANITAHEADER_H
11 
12 //Includes
13 #include <TObject.h>
14 #include "AnitaConventions.h"
15 #include "simpleStructs.h"
16 
18 
22 class RawAnitaHeader: public TObject
23 {
24  public:
25  RawAnitaHeader();
26  RawAnitaHeader(AnitaEventHeader_t *hdPtr, Int_t run, UInt_t realTime,
27  UInt_t triggerTime, UInt_t triggerTimeNs,Int_t tgoodTimeFlag);
28 
29  RawAnitaHeader(AnitaEventHeaderVer40_t *hdPtr, Int_t trun, UInt_t trealTime,
30  UInt_t ttriggerTime, UInt_t ttriggerTimeNs, Int_t tgoodTimeFlag);
31  RawAnitaHeader(AnitaEventHeaderVer33_t *hdPtr, Int_t run, UInt_t realTime,
32  UInt_t triggerTime, UInt_t triggerTimeNs,Int_t tgoodTimeFlag);
33  RawAnitaHeader(AnitaEventHeaderVer30_t *hdPtr, Int_t run, UInt_t realTime,
34  UInt_t triggerTime, UInt_t triggerTimeNs,Int_t tgoodTimeFlag);
35  RawAnitaHeader(AnitaEventHeaderVer13_t *hdPtr, Int_t run, UInt_t realTime,
36  UInt_t triggerTime, UInt_t triggerTimeNs,Int_t tgoodTimeFlag);
37  RawAnitaHeader(AnitaEventHeaderVer12_t *hdPtr, Int_t run, UInt_t realTime,
38  UInt_t triggerTime, UInt_t triggerTimeNs,Int_t tgoodTimeFlag);
39  RawAnitaHeader(AnitaEventHeaderVer11_t *hdPtr, Int_t run, UInt_t realTime,
40  UInt_t triggerTime, UInt_t triggerTimeNs,Int_t tgoodTimeFlag);
41  RawAnitaHeader(AnitaEventHeaderVer10_t *hdPtr, Int_t run, UInt_t realTime,
42  UInt_t triggerTime, UInt_t triggerTimeNs,Int_t tgoodTimeFlag);
43  ~RawAnitaHeader();
44 
45  Int_t run;
46  UInt_t realTime;
47  UInt_t payloadTime;
48  UInt_t payloadTimeUs;
49  UInt_t gpsSubTime;
50  UInt_t turfEventId;
51  UInt_t eventNumber;
52 
81  UShort_t calibStatus;
82  UChar_t priority;
83  UChar_t turfUpperWord;
84  UChar_t otherFlag;
85 
94  UChar_t errorFlag;
95  UChar_t surfSlipFlag;
96  UChar_t nadirAntTrigMask;
97  UInt_t antTrigMask;
98 
99  UShort_t l2TrigMask;
100  UShort_t l2TrigMaskH;
101 
102 
103  //these are l1's because there is no need for L2 offline trig masks in A4 (since the scaler worked properly)
104  // andl l1=l2 in A3, and this way we don't have to write a #pragma read rule for these
105  UShort_t l1TrigMaskOffline;
107 
108  UShort_t phiTrigMask;
109  UShort_t phiTrigMaskH;
112 
113  //Prioritizer stuff
114  UChar_t peakThetaBin;
115  UShort_t imagePeak;
116  UShort_t coherentSumPeak;
117 
119 
130 
131 
132 
133 
135 
147  UChar_t reserved[2]; // [0]&0xf is TURF hold for this trigger, [0]&0xf0 is active TURF holds
148  UChar_t trigType;
149  UChar_t l3Type1Count;
150  UShort_t trigNum;
151  UInt_t trigTime;
152  UInt_t c3poNum;
153  UShort_t ppsNum;
154 
158  UShort_t deadTime;
160 
165  UChar_t bufferDepth; // Buffer depth
166  UChar_t turfioReserved;
171  UShort_t l3TrigPattern;
172  UShort_t l3TrigPatternH;
173  UShort_t otherTrigPattern[3];
176  UInt_t triggerTime;
177  UInt_t triggerTimeNs;
178  Int_t goodTimeFlag;
179 
180 
181  UInt_t rawtrigTime;
182  UInt_t rawc3poNum;
183  UShort_t rawppsNum;
184 
185  const char *trigTypeAsString() const;
186  UShort_t getL3TrigPattern(AnitaPol::AnitaPol_t pol) const;
187 
188  int isInL3Pattern(int phi, AnitaPol::AnitaPol_t pol=AnitaPol::kVertical) const;
189  int isInPhiMask(int phi, AnitaPol::AnitaPol_t pol=AnitaPol::kVertical) const;
190  int isInL1Mask(int phi, AnitaPol::AnitaPol_t pol=AnitaPol::kVertical) const;
191  int getL1Mask( AnitaPol::AnitaPol_t pol) const;
193  int isInL2Mask(int phi) const;
194  int getL2Mask() const { return l2TrigMask; }
195  int isInPhiMaskOffline(int phi, AnitaPol::AnitaPol_t pol=AnitaPol::kVertical) const; // pol does nothing in A4
196  int isInL1MaskOffline(int phi, AnitaPol::AnitaPol_t pol=AnitaPol::kVertical) const; //A3 only
197 
198  int getPhiMaskOffline(AnitaPol::AnitaPol_t pol = AnitaPol::kHorizontal) const; //pol does nothing in A4
199  int getL1MaskOffline( AnitaPol::AnitaPol_t pol) const; //a3 only
200  int getCurrentTurfBuffer() const;
201  unsigned int getCurrentTurfHolds() const;
202  int getNumberOfCurrentTurfHolds() const;
203  int getTurfRunNumber() const
204  { return (((turfEventId&0xfff00000)>>20));}
205  int getTurfEventNumber() const
206  { return (turfEventId&0xfffff);}
207 
208  Int_t getAboveThresholdFlag() const;
209  Int_t getBinToBinIncreaseFlag() const;
210  Int_t getSaturationFlag() const;
211  Float_t getPeakThetaRad() const;
212  Float_t getPeakPhiRad() const;
213  Float_t getPeakThetaDeg() const;
214  Float_t getPeakPhiDeg() const;
215  Float_t getImagePeak() const;
216  Float_t getCoherentSumPeak() const;
217  AnitaPol::AnitaPol_t getPeakPol() const;
218 
219  Int_t getTriggerBitRF() const;
220  Int_t getTriggerBitADU5() const;
221  Int_t getTriggerBitG12() const;
222  Int_t getTriggerBitSoftExt() const;
223 
224  Int_t setMask (UShort_t newL2Mask, UShort_t newPhiMask, AnitaPol::AnitaPol_t pol); // sets phi and l1 masking (used in icemc)
225  Int_t setTrigPattern (UShort_t newTrigPattern, AnitaPol::AnitaPol_t pol); // sets l3 trigger (used in icemc)
226 
227  ClassDef(RawAnitaHeader,42);
228 
229 };
230 
231 
232 #endif //RAWANITAHEADER_H
int isInL2Mask(int phi) const
Returns 1 if given phi-ring had l1 trigger.
UShort_t l3TrigPatternH
Bit mask for l3 global triggers. eg. if the bit 1 (the lowest bit) is active it means that phi sector...
int getL1Mask(AnitaPol::AnitaPol_t pol) const
Get&#39;s the l1 Mask. In A4 this is the same as l2 mask.
UShort_t lowerL2TrigPattern
Bit mask for lower ring l2 cluster triggers. eg. if the bit 1 (the lowest bit) is active it means the...
UChar_t surfSlipFlag
Sync Slip between SURF 2-9 and SURF 1.
UChar_t reserved[2]
Reserved bytes — Deprecated.
UChar_t errorFlag
Error Flag.
int getCurrentTurfBuffer() const
Returns the current TURF buffer number (0, 1, 2 or 3);.
UInt_t triggerTimeNs
Trigger time in ns from TURF.
UShort_t upperL1TrigPattern
Bit mask for upper ring l1 antenna triggers. eg. if the bit 1 (the lowest bit) is active it means the...
UShort_t l3TrigPattern
Bit mask for l3 global triggers. eg. if the bit 1 (the lowest bit) is active it means that phi sector...
UShort_t prioritizerStuff
Prioritizer stuff.
UChar_t priority
Queue (lower 4-bits) and priority (upper 4-bits)
UShort_t calibStatus
Calib/Relay Status.
UShort_t otherTrigPattern[3]
Other trig patterns – currently reserved.
UChar_t nadirAntTrigMask
8-bit nadir phi mask (from TURF)
UShort_t phiTrigMaskOffline
16-bit phi mask (from TURF)
int isInPhiMask(int phi, AnitaPol::AnitaPol_t pol=AnitaPol::kVertical) const
Returns 1 if given phi-pol is in mask.
ANITA Event Header – Telemetered.
Definition: oldStructs.h:140
int isInL3Pattern(int phi, AnitaPol::AnitaPol_t pol=AnitaPol::kVertical) const
Returns 1 if given phi-ring had l3 trigger. pol does nothing for A4.
int getTurfRunNumber() const
Returns the run number portion of the TURF event id.
Int_t goodTimeFlag
1 is good trigger time, 0 is bad trigger time
UChar_t nadirL2TrigPattern
8-bit trigger mask for L2 nadir triggers. Nadir L2 triggers are for the even phi sectors and are just...
UInt_t rawc3poNum
Number of TURF clock ticks between GPS pulse per seconds before corrections.
RawAnitaHeader – The Raw ANITA Event Header.
Int_t getTriggerBitRF() const
UInt_t rawtrigTime
Trigger time in TURF clock ticks before corrections.
UChar_t l3Type1Count
Count of l3 type 1 triggers.
Int_t getTriggerBitADU5() const
int isInL1Mask(int phi, AnitaPol::AnitaPol_t pol=AnitaPol::kVertical) const
Returns 1 if given phi-pol is in mask.
Int_t run
Run number, assigned on ground.
ANITA Event Header – Telemetered.
UShort_t rawppsNum
Number of GPS PPS since last clear all before corrections.
UInt_t payloadTime
unixTime of readout
UShort_t l2TrigMaskH
Deprecated.
unsigned int getCurrentTurfHolds() const
Returns a 4-bit bitmask corresponding to the currently held buffers.
~RawAnitaHeader()
Destructor.
UInt_t turfEventId
TURF Event Id (12-bit run + 20-bit event)
UShort_t phiTrigMask
16-bit phi mask (from TURF)
UShort_t phiTrigMaskHOffline
16-bit phi mask (from TURF)
UInt_t c3poNum
Number of TURF clock ticks between GPS pulse per seconds.
UInt_t antTrigMask
Deprecated.
ANITA Event Header – Telemetered.
Definition: oldStructs.h:73
int getNumberOfCurrentTurfHolds() const
Returns the number of currently held TURF buffers (0-4)
UShort_t phiTrigMaskH
16-bit phi mask (from TURF)
UInt_t trigTime
Trigger time in TURF clock ticks.
Int_t getTriggerBitSoftExt() const
ANITA Event Header – Telemetered.
Definition: oldStructs.h:189
UShort_t lowerL1TrigPattern
Bit mask for lower ring l1 antenna triggers. eg. if the bit 1 (the lowest bit) is active it means the...
const char * trigTypeAsString() const
Returns trigger type as string.
UChar_t bufferDepth
Buffer depth.
UInt_t payloadTimeUs
sub second time of readout
int getPhiMask(AnitaPol::AnitaPol_t pol=AnitaPol::kVertical) const
pol does nothing for A4
Vertical Polarisation.
UShort_t deadTime
Dead Time.
int getTurfEventNumber() const
Returns the event number portion of the TURF event id.
UShort_t upperL2TrigPattern
Bit mask for upper ring l2 cluster triggers. eg. if the bit 1 (the lowest bit) is active it means the...
Horizontal Polarisation.
UInt_t realTime
unixTime of readout
UChar_t nadirL1TrigPattern
8-bit trigger mask for L1 nadir triggers. Here bit 1 is antenna 33 (phi 1), bit 2 is antenna 34 (phi ...
UChar_t turfUpperWord
Upper word from TURF, useful for debugging.
UInt_t gpsSubTime
sub second time from GPS (if matched)
Int_t getTriggerBitG12() const
UShort_t trigNum
Trigger number (since last clear all)
UChar_t turfioReserved
Reserved.
enum AnitaPol::EAnitaPol AnitaPol_t
Polarisation enumeration.
UShort_t l1TrigMaskHOffline
Deprecated.
UChar_t trigType
Bit 0 is RF, 1 is ADU5, 2 is G12, 3 is software/external.
UInt_t triggerTime
Trigger time from TURF converted to unixTime.
RawAnitaHeader()
Default constructor.