1 | #ifndef MARS_MBadPixelsPix
|
---|
2 | #define MARS_MBadPixelsPix
|
---|
3 |
|
---|
4 | #ifndef MARS_MParContainer
|
---|
5 | #include "MParContainer.h"
|
---|
6 | #endif
|
---|
7 |
|
---|
8 | #ifndef ROOT_TArrayC
|
---|
9 | #include <TArrayC.h>
|
---|
10 | #endif
|
---|
11 |
|
---|
12 | class MBadPixelsPix : public MParContainer
|
---|
13 | {
|
---|
14 | private:
|
---|
15 | TArrayC fInfo;
|
---|
16 |
|
---|
17 | public:
|
---|
18 | MBadPixelsPix(const char* name=NULL, const char* title=NULL);
|
---|
19 |
|
---|
20 | enum UnsuitableType_t {
|
---|
21 | kUnsuitableRun = BIT(1),
|
---|
22 | kUnsuitableEvt = BIT(2)
|
---|
23 | };
|
---|
24 |
|
---|
25 | enum CalibrationType_t {
|
---|
26 | kHiGainSaturation = BIT(1),
|
---|
27 | kLoGainSaturation = BIT(2),
|
---|
28 | kHiGainFitted = BIT(3),
|
---|
29 | kLoGainFitted = BIT(4),
|
---|
30 | kCalcChargeNotPedestal = BIT(5),
|
---|
31 | kCalcChargeErrValid = BIT(6),
|
---|
32 | kCalcChargeRelErrValid = BIT(7),
|
---|
33 | kCalcChargeSigmaValid = BIT(8),
|
---|
34 | kConversionHiLoValid = BIT(9),
|
---|
35 | kHiGainOscillating = BIT(10),
|
---|
36 | kLoGainOscillating = BIT(11),
|
---|
37 | kMeanTimeInFirstBin = BIT(12),
|
---|
38 | kMeanTimeInLastBin = BIT(13),
|
---|
39 | kBlindPixelMethodValid = BIT(14),
|
---|
40 | kFFactorMethodValid = BIT(15),
|
---|
41 | kPINDiodeMethodValid = BIT(16),
|
---|
42 | kCombinedMethodValid = BIT(17)
|
---|
43 | };
|
---|
44 |
|
---|
45 |
|
---|
46 | static const Char_t fgRunMask; // All types which are not event wise determined
|
---|
47 |
|
---|
48 | void Reset();
|
---|
49 | void Clear(Option_t *o="");
|
---|
50 | void Copy(TObject &object) const
|
---|
51 | {
|
---|
52 | static_cast<MBadPixelsPix&>(object).fInfo = fInfo;
|
---|
53 | }
|
---|
54 |
|
---|
55 | // Setter
|
---|
56 | void SetUnsuitableRun(UnsuitableType_t typ=kUnsuitableRun) { fInfo[0] |= typ; }
|
---|
57 | void SetSuitableRun(UnsuitableType_t typ=kUnsuitableRun) { fInfo[0] &= ~typ; }
|
---|
58 |
|
---|
59 | void SetUnsuitableEvt(UnsuitableType_t typ=kUnsuitableEvt) { fInfo[0] |= typ; }
|
---|
60 | void SetSuitableEvt(UnsuitableType_t typ=kUnsuitableEvt) { fInfo[0] &= ~typ; }
|
---|
61 |
|
---|
62 | // Calibration
|
---|
63 | void SetHiGainSaturation ( CalibrationType_t typ=kHiGainSaturation ) { fInfo[1] |= typ; }
|
---|
64 | void SetNoHiGainSaturation( CalibrationType_t typ=kHiGainSaturation ) { fInfo[1] &= ~typ; }
|
---|
65 |
|
---|
66 | void SetLoGainSaturation ( CalibrationType_t typ=kLoGainSaturation ) { fInfo[1] |= typ; }
|
---|
67 | void SetNoLoGainSaturation( CalibrationType_t typ=kLoGainSaturation ) { fInfo[1] &= ~typ; }
|
---|
68 |
|
---|
69 | void SetCombinedMethodValid ( CalibrationType_t typ=kCombinedMethodValid ) { fInfo[1] |= typ; }
|
---|
70 | void SetNoCombinedMethodValid( CalibrationType_t typ=kCombinedMethodValid ) { fInfo[1] &= ~typ; }
|
---|
71 |
|
---|
72 | void SetPINDiodeMethodValid ( CalibrationType_t typ=kPINDiodeMethodValid ) { fInfo[1] |= typ; }
|
---|
73 | void SetNoPINDiodeMethodValid( CalibrationType_t typ=kPINDiodeMethodValid ) { fInfo[1] &= ~typ; }
|
---|
74 |
|
---|
75 | void SetFFactorMethodValid ( CalibrationType_t typ=kFFactorMethodValid ) { fInfo[1] |= typ; }
|
---|
76 | void SetNoFFactorMethodValid( CalibrationType_t typ=kFFactorMethodValid ) { fInfo[1] &= ~typ; }
|
---|
77 |
|
---|
78 | void SetBlindPixelMethodValid ( CalibrationType_t typ=kBlindPixelMethodValid ) { fInfo[1] |= typ; }
|
---|
79 | void SetNoBlindPixelMethodValid( CalibrationType_t typ=kBlindPixelMethodValid ) { fInfo[1] &= ~typ; }
|
---|
80 |
|
---|
81 | void SetMeanTimeInLastBin ( CalibrationType_t typ=kMeanTimeInLastBin ) { fInfo[1] |= typ; }
|
---|
82 | void SetNoMeanTimeInLastBin( CalibrationType_t typ=kMeanTimeInLastBin ) { fInfo[1] &= ~typ; }
|
---|
83 |
|
---|
84 | void SetMeanTimeInFirstBin ( CalibrationType_t typ=kMeanTimeInFirstBin ) { fInfo[1] |= typ; }
|
---|
85 | void SetNoMeanTimeInFirstBin( CalibrationType_t typ=kMeanTimeInFirstBin ) { fInfo[1] &= ~typ; }
|
---|
86 |
|
---|
87 | void SetLoGainOscillating ( CalibrationType_t typ=kLoGainOscillating ) { fInfo[1] |= typ; }
|
---|
88 | void SetNoLoGainOscillating( CalibrationType_t typ=kLoGainOscillating ) { fInfo[1] &= ~typ; }
|
---|
89 |
|
---|
90 | void SetHiGainOscillating ( CalibrationType_t typ=kHiGainOscillating ) { fInfo[1] |= typ; }
|
---|
91 | void SetNoHiGainOscillating( CalibrationType_t typ=kHiGainOscillating ) { fInfo[1] &= ~typ; }
|
---|
92 |
|
---|
93 | void SetConversionHiLoValid ( CalibrationType_t typ=kConversionHiLoValid ) { fInfo[1] |= typ; }
|
---|
94 | void SetNoConversionHiLoValid( CalibrationType_t typ=kConversionHiLoValid ) { fInfo[1] &= ~typ; }
|
---|
95 |
|
---|
96 | void SetCalcChargeSigmaValid ( CalibrationType_t typ=kCalcChargeSigmaValid ) { fInfo[1] |= typ; }
|
---|
97 | void SetNoCalcChargeSigmaValid( CalibrationType_t typ=kCalcChargeSigmaValid ) { fInfo[1] &= ~typ; }
|
---|
98 |
|
---|
99 | void SetCalcChargeRelErrValid ( CalibrationType_t typ=kCalcChargeRelErrValid ) { fInfo[1] |= typ; }
|
---|
100 | void SetNoCalcChargeRelErrValid( CalibrationType_t typ=kCalcChargeRelErrValid ) { fInfo[1] &= ~typ; }
|
---|
101 |
|
---|
102 | void SetCalcChargeErrValid ( CalibrationType_t typ=kCalcChargeErrValid ) { fInfo[1] |= typ; }
|
---|
103 | void SetNoCalcChargeErrValid( CalibrationType_t typ=kCalcChargeErrValid ) { fInfo[1] &= ~typ; }
|
---|
104 |
|
---|
105 | void SetCalcChargeNotPedestal ( CalibrationType_t typ=kCalcChargeNotPedestal ) { fInfo[1] |= typ; }
|
---|
106 | void SetNoCalcChargeNotPedestal( CalibrationType_t typ=kCalcChargeNotPedestal ) { fInfo[1] &= ~typ; }
|
---|
107 |
|
---|
108 | void SetLoGainFitted ( CalibrationType_t typ=kLoGainFitted ) { fInfo[1] |= typ; }
|
---|
109 | void SetNoLoGainFitted( CalibrationType_t typ=kLoGainFitted ) { fInfo[1] &= ~typ; }
|
---|
110 |
|
---|
111 | void SetHiGainFitted ( CalibrationType_t typ=kHiGainFitted ) { fInfo[1] |= typ; }
|
---|
112 | void SetNoHiGainFitted( CalibrationType_t typ=kHiGainFitted ) { fInfo[1] &= ~typ; }
|
---|
113 |
|
---|
114 | // Getter
|
---|
115 | Bool_t IsUnsuitableRun(UnsuitableType_t typ=kUnsuitableRun) const { return fInfo[0]&typ; }
|
---|
116 | Bool_t IsSuitableRun(UnsuitableType_t typ=kUnsuitableRun) const { return !(fInfo[0]&typ); }
|
---|
117 |
|
---|
118 | Bool_t IsUnsuitableEvt(UnsuitableType_t typ=kUnsuitableEvt) const { return fInfo[0]&typ; }
|
---|
119 | Bool_t IsSuitableEvt(UnsuitableType_t typ=kUnsuitableEvt) const { return !(fInfo[0]&typ); }
|
---|
120 |
|
---|
121 | Bool_t IsOK() const { return fInfo[0]==0; }
|
---|
122 | Bool_t IsBad() const { return fInfo[0]!=0; }
|
---|
123 | Bool_t IsLoGainBad() const { return (fInfo[1]&kLoGainSaturation
|
---|
124 | || !(fInfo[1]&kConversionHiLoValid)
|
---|
125 | || fInfo[1]&kLoGainOscillating ); }
|
---|
126 |
|
---|
127 | void Merge(const MBadPixelsPix &pix);
|
---|
128 |
|
---|
129 | const TArrayC &GetInfo() const { return fInfo; }
|
---|
130 |
|
---|
131 | ClassDef(MBadPixelsPix, 1) // Storage Container for bad pixel information of a single pixel
|
---|
132 | };
|
---|
133 |
|
---|
134 | #endif
|
---|
135 |
|
---|