SurfHk.h
1 
9 #ifndef SURFHK_H
10 #define SURFHK_H
11 
12 //Includes
13 #include <TObject.h>
14 #include "AnitaConventions.h"
15 #include "simpleStructs.h"
16 #include "oldStructs.h"
17 
18 
20 
24 class SurfHk: public TObject
25 {
26  public:
27  SurfHk();
28  ~SurfHk();
29 
30  SurfHk(Int_t trun, Int_t trealTime, FullSurfHkStruct_t *surfPtr);
31  SurfHk(Int_t trun, Int_t trealTime, FullSurfHkStructVer40_t *surfPtr);
32  SurfHk(Int_t trun, Int_t trealTime, FullSurfHkStructVer30_t *surfPtr);
33  SurfHk(Int_t trun, Int_t trealTime, FullSurfHkStructVer14_t *surfPtr);
34  SurfHk(Int_t trun, Int_t trealTime, FullSurfHkStructVer13_t *surfPtr);
35  SurfHk(Int_t trun, Int_t trealTime, FullSurfHkStructVer12_t *surfPtr);
36 
37  SurfHk(Int_t trun,
38  UInt_t trealTime,
39  UInt_t tpayloadTime,
40  UInt_t tpayloadTimeUs,
41  UShort_t tglobalThreshold,
42  UShort_t terrorFlag,
43  UShort_t tscalerGoals[BANDS_PER_ANT],
44  UShort_t tscalerGoalsNadir[BANDS_PER_ANT],
45  UShort_t tupperWords[ACTIVE_SURFS],
46  UShort_t tscaler[ACTIVE_SURFS][SCALERS_PER_SURF],
47  UShort_t tthreshold[ACTIVE_SURFS][SCALERS_PER_SURF],
48  UShort_t tsetThreshold[ACTIVE_SURFS][SCALERS_PER_SURF],
49  UShort_t trfPower[ACTIVE_SURFS][RFCHAN_PER_SURF],
50  UShort_t tsurfTrigBandMask[ACTIVE_SURFS],
51  Int_t tintFlag);
52 
53  Int_t run;
54  UInt_t realTime;
55  UInt_t payloadTime;
56  UInt_t payloadTimeUs;
57  UShort_t globalThreshold;
58  UShort_t errorFlag;
59  UShort_t scalerGoals[4];
60  UShort_t scalerGoalsNadir[BANDS_PER_ANT];
61  UShort_t upperWords[ACTIVE_SURFS];
62  UShort_t scaler[ACTIVE_SURFS][SCALERS_PER_SURF_V30];
63  UShort_t l1Scaler[ACTIVE_SURFS][L1S_PER_SURF];
64  UShort_t l2Scaler[ACTIVE_SURFS][L2S_PER_SURF];
65  UShort_t threshold[ACTIVE_SURFS][SCALERS_PER_SURF_V30];
66  UShort_t setThreshold[ACTIVE_SURFS][SCALERS_PER_SURF_V30];
67  UShort_t rfPower[ACTIVE_SURFS][RFCHAN_PER_SURF];
68  UShort_t surfTrigBandMask[ACTIVE_SURFS];
69  Int_t intFlag;
70 
71  Int_t isBandMasked(int surf, int scl)
72  { return (surfTrigBandMask[surf]&(1<<scl));}
73 
74 
75  Int_t getL2Scaler(int phi);
76  Int_t getL1Scaler(int phi, AnitaPol::AnitaPol_t pol, AnitaRing::AnitaRing_t ring);
77  Int_t getL1Scaler(int phi, AnitaRing::AnitaRing_t ring) { return getL1Scaler(phi,ring) ; }
78 
79  Int_t getScalerFromSurfChan(int surf, int chan) {return scaler[surf][chan];}
80  Int_t getThresholdFromSurfChan(int surf, int chan) {return threshold[surf][chan];}
81  Int_t getSetThresholdFromSurfChan(int surf, int chan) {return setThreshold[surf][chan];}
82  Int_t getL2ScalerFromSurfChan(int surf, int chan) { return l2Scaler[surf][chan]; }
83  Int_t getL1ScalerFromSurfChan(int surf, int chan) { return l1Scaler[surf][chan]; }
84 
85 
91 
92  Int_t getScalerGoalRing(AnitaRing::AnitaRing_t ring);
93  Int_t getScalerGoal(int surf, int scl);
94  Double_t getRFPowerInK(int surf, int chan);
95  // Double_t getMeasuredRFPowerInK(int surf, int chan); ///< Returns the pseudo-calibrated RF power in K.
96  Double_t getRawRFPower(int surf, int chan);
97  UInt_t getRFPowerTimeOffset(int surf, int chan); //returns the us time-since-measured of the power monitor
98  UInt_t getRFPowerPayloadTime(UInt_t surf, UInt_t chan); //returns the corrected payloadTime of the measured power monitor sample
99  UInt_t getRFPowerPayloadTimeUs(UInt_t surf, UInt_t chan); //returns the corrected payloadTimeUs of the measured power monitor sample
100 
101  ClassDef(SurfHk,VER_SURF_HK);
102 };
103 
104 
105 #endif //SURFHK_H
UShort_t scalerGoals[4]
Scaler goal for each ring, only use 3.
Definition: SurfHk.h:59
Int_t intFlag
Interpolation flag, should be zero for raw data.
Definition: SurfHk.h:69
SurfHk()
Default constructor.
Definition: SurfHk.cxx:20
UShort_t scalerGoalsNadir[4]
Deprecated.
Definition: SurfHk.h:60
UShort_t l2Scaler[12][2]
L2 Scaler values.
Definition: SurfHk.h:64
UShort_t l1Scaler[12][6]
L1 Scaler values.
Definition: SurfHk.h:63
UShort_t surfTrigBandMask[12]
Which bands are masked off?
Definition: SurfHk.h:68
Int_t getThreshold(int phi, AnitaRing::AnitaRing_t ring, AnitaTrigPol::AnitaTrigPol_t pol)
Returns readback threhsold value for given ring-phi-pol.
Definition: SurfHk.cxx:330
UInt_t realTime
Time in unixTime.
Definition: SurfHk.h:54
Double_t getRawRFPower(int surf, int chan)
Returns the measured adc value of the RF power while masking the top bit (the "phase" bit) ...
Definition: SurfHk.cxx:410
Int_t getL2Scaler(int phi)
Returns the L2 scaler value for given phi-pol.
Definition: SurfHk.cxx:307
Double_t getRFPowerInK(int surf, int chan)
Returns the pseudo-calibrated RF power in K.
Definition: SurfHk.cxx:381
Int_t getSetThreshold(int phi, AnitaRing::AnitaRing_t ring, AnitaTrigPol::AnitaTrigPol_t pol)
Returns set threshold value for given ring-phi-pol.
Definition: SurfHk.cxx:340
UShort_t upperWords[12]
Upper words of each SURF... for debugging.
Definition: SurfHk.h:61
SurfHk – The raw SURF scaler+threshold data.
Definition: SurfHk.h:24
UInt_t payloadTimeUs
Subsecond time of readout in us.
Definition: SurfHk.h:56
SURF Hk – Telemetered.
Definition: oldStructs.h:302
enum AnitaRing::EAnitaRing AnitaRing_t
Ring enumeration.
enum AnitaTrigPol::EAnitaTrigPol AnitaTrigPol_t
Polarisation enumeration.
Int_t getL1Scaler(int phi, AnitaRing::AnitaRing_t ring)
Returns the L1 scaler value for given phi-ring-pol.
Definition: SurfHk.h:77
Int_t getL1Scaler(int phi, AnitaPol::AnitaPol_t pol, AnitaRing::AnitaRing_t ring)
Returns the L1 scaler value for given phi-ring-pol.
Definition: SurfHk.cxx:291
UShort_t globalThreshold
Global threshold if set.
Definition: SurfHk.h:57
UShort_t setThreshold[12][16]
Threshold values intedned, should match threshold array exactly.
Definition: SurfHk.h:66
UShort_t scaler[12][16]
Scaler values, multiple by 1000 to get Hz.
Definition: SurfHk.h:62
UShort_t errorFlag
Error flag.
Definition: SurfHk.h:58
Int_t isMasked(int phi, AnitaRing::AnitaRing_t ring, AnitaTrigPol::AnitaTrigPol_t pol)
Returns 1 if given phi-ring-pol is masked.
Definition: SurfHk.cxx:350
Int_t getLogicalIndex(int phi, AnitaRing::AnitaRing_t ring, AnitaTrigPol::AnitaTrigPol_t pol)
Returns logical pol index.
Definition: SurfHk.cxx:359
~SurfHk()
Destructor.
Definition: SurfHk.cxx:25
Int_t getScaler(int phi, AnitaRing::AnitaRing_t ring, AnitaTrigPol::AnitaTrigPol_t pol)
Returns scaler value for given ring-phi-pol.
Definition: SurfHk.cxx:321
UShort_t rfPower[12][8]
RF power per input channel in ADC counts.
Definition: SurfHk.h:67
enum AnitaPol::EAnitaPol AnitaPol_t
Polarisation enumeration.
Int_t getScalerGoal(int surf, int scl)
Returns scaler goal of surf-scaler.
Definition: SurfHk.cxx:371
SURF Hk – Telemetered.
Int_t isBandMasked(int surf, int scl)
Returns 1 if band is masked.
Definition: SurfHk.h:71
Int_t run
Run number from offline.
Definition: SurfHk.h:53
UShort_t threshold[12][16]
Threshold values in DAC counts.
Definition: SurfHk.h:65
UInt_t payloadTime
Time in unixTime.
Definition: SurfHk.h:55