1 | #ifndef MARS_MBadPixelsPix
|
---|
2 | #define MARS_MBadPixelsPix
|
---|
3 |
|
---|
4 | #ifndef MARS_MParContainer
|
---|
5 | #include "MParContainer.h"
|
---|
6 | #endif
|
---|
7 |
|
---|
8 | #ifndef ROOT_TArrayI
|
---|
9 | #include <TArrayI.h>
|
---|
10 | #endif
|
---|
11 |
|
---|
12 | class MBadPixelsPix : public MParContainer
|
---|
13 | {
|
---|
14 | private:
|
---|
15 | TArrayI 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 | kUnreliableRun = BIT(3)
|
---|
24 | };
|
---|
25 |
|
---|
26 | // All types are initialized to normal behaviour
|
---|
27 | enum CalibrationType_t {
|
---|
28 | kHiGainSaturation = BIT(1),
|
---|
29 | kLoGainSaturation = BIT(2),
|
---|
30 | kHiGainNotFitted = BIT(3),
|
---|
31 | kLoGainNotFitted = BIT(4),
|
---|
32 | kChargeIsPedestal = BIT(5),
|
---|
33 | kChargeErrNotValid = BIT(6),
|
---|
34 | kChargeRelErrNotValid = BIT(7),
|
---|
35 | kChargeSigmaNotValid = BIT(8),
|
---|
36 | kConvHiLoNotValid = BIT(9),
|
---|
37 | kHiGainOscillating = BIT(10),
|
---|
38 | kLoGainOscillating = BIT(11),
|
---|
39 | kMeanTimeInFirstBin = BIT(12),
|
---|
40 | kMeanTimeInLastBin = BIT(13),
|
---|
41 | kBlindPixelMethodNotValid = BIT(14),
|
---|
42 | kFFactorMethodNotValid = BIT(15),
|
---|
43 | kPINDiodeMethodNotValid = BIT(16),
|
---|
44 | kCombinedMethodNotValid = BIT(17)
|
---|
45 | };
|
---|
46 |
|
---|
47 |
|
---|
48 | static const Int_t fgRunMask; // All types which are not event wise determined
|
---|
49 |
|
---|
50 | void Reset();
|
---|
51 | void Clear(Option_t *o="");
|
---|
52 | void Copy(TObject &object) const
|
---|
53 | {
|
---|
54 | static_cast<MBadPixelsPix&>(object).fInfo = fInfo;
|
---|
55 | }
|
---|
56 |
|
---|
57 | // Setter
|
---|
58 | void SetUnsuitableRun(UnsuitableType_t typ=kUnsuitableRun) { fInfo[0] |= typ; }
|
---|
59 | void SetSuitableRun(UnsuitableType_t typ=kUnsuitableRun) { fInfo[0] &= ~typ; }
|
---|
60 |
|
---|
61 | void SetUnsuitableEvt(UnsuitableType_t typ=kUnsuitableEvt) { fInfo[0] |= typ; }
|
---|
62 | void SetSuitableEvt(UnsuitableType_t typ=kUnsuitableEvt) { fInfo[0] &= ~typ; }
|
---|
63 |
|
---|
64 | void SetUnreliableRun(UnsuitableType_t typ=kUnreliableRun) { fInfo[0] |= typ; }
|
---|
65 | void SetReliableRun(UnsuitableType_t typ=kUnreliableRun) { fInfo[0] &= ~typ; }
|
---|
66 |
|
---|
67 | // Calibration
|
---|
68 | void SetHiGainSaturation ( CalibrationType_t typ=kHiGainSaturation )
|
---|
69 | { fInfo[1] |= typ; }
|
---|
70 | void SetLoGainSaturation ( CalibrationType_t typ=kLoGainSaturation )
|
---|
71 | { fInfo[1] |= typ; }
|
---|
72 | void SetCombinedMethodNotValid ( CalibrationType_t typ=kCombinedMethodNotValid )
|
---|
73 | { fInfo[1] |= typ; }
|
---|
74 | void SetPINDiodeMethodNotValid ( CalibrationType_t typ=kPINDiodeMethodNotValid )
|
---|
75 | { fInfo[1] |= typ; }
|
---|
76 | void SetFFactorMethodNotValid ( CalibrationType_t typ=kFFactorMethodNotValid )
|
---|
77 | { fInfo[1] |= typ; }
|
---|
78 | void SetBlindPixelMethodNotValid ( CalibrationType_t typ=kBlindPixelMethodNotValid )
|
---|
79 | { fInfo[1] |= typ; }
|
---|
80 | void SetMeanTimeInLastBin ( CalibrationType_t typ=kMeanTimeInLastBin )
|
---|
81 | { fInfo[1] |= typ; }
|
---|
82 | void SetMeanTimeInFirstBin ( CalibrationType_t typ=kMeanTimeInFirstBin )
|
---|
83 | { fInfo[1] |= typ; }
|
---|
84 | void SetLoGainOscillating ( CalibrationType_t typ=kLoGainOscillating )
|
---|
85 | { fInfo[1] |= typ; }
|
---|
86 | void SetHiGainOscillating ( CalibrationType_t typ=kHiGainOscillating )
|
---|
87 | { fInfo[1] |= typ; }
|
---|
88 | void SetConvHiLoNotValid ( CalibrationType_t typ=kConvHiLoNotValid )
|
---|
89 | { fInfo[1] |= typ; }
|
---|
90 | void SetChargeSigmaNotValid ( CalibrationType_t typ=kChargeSigmaNotValid )
|
---|
91 | { fInfo[1] |= typ; }
|
---|
92 | void SetChargeRelErrNotValid ( CalibrationType_t typ=kChargeRelErrNotValid )
|
---|
93 | { fInfo[1] |= typ; }
|
---|
94 | void SetChargeErrNotValid ( CalibrationType_t typ=kChargeErrNotValid )
|
---|
95 | { fInfo[1] |= typ; }
|
---|
96 | void SetChargeIsPedestal ( CalibrationType_t typ=kChargeIsPedestal )
|
---|
97 | { fInfo[1] |= typ; }
|
---|
98 | void SetLoGainNotFitted ( CalibrationType_t typ=kLoGainNotFitted )
|
---|
99 | { fInfo[1] |= typ; }
|
---|
100 | void SetHiGainNotFitted ( CalibrationType_t typ=kHiGainNotFitted )
|
---|
101 | { fInfo[1] |= typ; }
|
---|
102 |
|
---|
103 | // Getter
|
---|
104 | Bool_t IsUnsuitableRun(UnsuitableType_t typ=kUnsuitableRun) const { return fInfo[0]&typ; }
|
---|
105 | Bool_t IsSuitableRun(UnsuitableType_t typ=kUnsuitableRun) const { return !(fInfo[0]&typ); }
|
---|
106 |
|
---|
107 | Bool_t IsUnsuitableEvt(UnsuitableType_t typ=kUnsuitableEvt) const { return fInfo[0]&typ; }
|
---|
108 | Bool_t IsSuitableEvt(UnsuitableType_t typ=kUnsuitableEvt) const { return !(fInfo[0]&typ); }
|
---|
109 |
|
---|
110 | Bool_t IsUnreliableRun(UnsuitableType_t typ=kUnreliableRun) const { return fInfo[0]&typ; }
|
---|
111 | Bool_t IsReliableRun(UnsuitableType_t typ=kUnreliableRun) const { return !(fInfo[0]&typ); }
|
---|
112 |
|
---|
113 | Bool_t IsOK() const { return fInfo[0]==0; }
|
---|
114 | Bool_t IsBad() const { return fInfo[0]!=0; }
|
---|
115 |
|
---|
116 | Bool_t IsHiGainSaturation () const { return fInfo[1] & kHiGainSaturation ; }
|
---|
117 | Bool_t IsLoGainSaturation () const { return fInfo[1] & kLoGainSaturation ; }
|
---|
118 | Bool_t IsCombinedMethodNotValid () const { return fInfo[1] & kCombinedMethodNotValid; }
|
---|
119 | Bool_t IsPINDiodeMethodNotValid () const { return fInfo[1] & kPINDiodeMethodNotValid; }
|
---|
120 | Bool_t IsFFactorMethodNotValid () const { return fInfo[1] & kFFactorMethodNotValid; }
|
---|
121 | Bool_t IsBlindPixelMethodNotValid () const { return fInfo[1] & kBlindPixelMethodNotValid; }
|
---|
122 | Bool_t IsMeanTimeInLastBin () const { return fInfo[1] & kMeanTimeInLastBin; }
|
---|
123 | Bool_t IsMeanTimeInFirstBin () const { return fInfo[1] & kMeanTimeInFirstBin; }
|
---|
124 | Bool_t IsLoGainOscillating () const { return fInfo[1] & kLoGainOscillating; }
|
---|
125 | Bool_t IsHiGainOscillating () const { return fInfo[1] & kHiGainOscillating; }
|
---|
126 | Bool_t IsConvHiLoNotValid () const { return fInfo[1] & kConvHiLoNotValid; }
|
---|
127 | Bool_t IsChargeSigmaNotValid () const { return fInfo[1] & kChargeSigmaNotValid; }
|
---|
128 | Bool_t IsChargeRelErrNotValid () const { return fInfo[1] & kChargeRelErrNotValid; }
|
---|
129 | Bool_t IsChargeErrNotValid () const { return fInfo[1] & kChargeErrNotValid; }
|
---|
130 | Bool_t IsChargeIsPedestal () const { return fInfo[1] & kChargeIsPedestal; }
|
---|
131 | Bool_t IsLoGainNotFitted () const { return fInfo[1] & kLoGainNotFitted; }
|
---|
132 | Bool_t IsHiGainNotFitted () const { return fInfo[1] & kHiGainNotFitted; }
|
---|
133 |
|
---|
134 | Bool_t IsLoGainBad() const { return IsLoGainSaturation() || IsConvHiLoNotValid() || IsLoGainOscillating() ;}
|
---|
135 | Bool_t IsHiGainBad() const { return (IsHiGainSaturation() && IsConvHiLoNotValid()) || IsHiGainOscillating(); }
|
---|
136 |
|
---|
137 | Bool_t IsCalibrationSignalOK() const { return !( IsChargeIsPedestal()
|
---|
138 | || IsChargeErrNotValid()
|
---|
139 | || IsChargeRelErrNotValid()
|
---|
140 | || IsChargeSigmaNotValid()
|
---|
141 | || IsMeanTimeInFirstBin()
|
---|
142 | || IsMeanTimeInLastBin() ); }
|
---|
143 | Bool_t IsCalibrationFitOK() const { return !( (!IsHiGainSaturation() && IsHiGainNotFitted())
|
---|
144 | || ( IsHiGainSaturation() && IsLoGainNotFitted()) ); }
|
---|
145 | Bool_t IsCalibrationOscillating() const { return ( !IsHiGainSaturation() && IsHiGainOscillating())
|
---|
146 | || ( IsHiGainSaturation() && IsLoGainOscillating()) ; }
|
---|
147 | Bool_t IsCalibrationResultOK() const { return IsCalibrationSignalOK()
|
---|
148 | && !IsCalibrationOscillating()
|
---|
149 | && IsCalibrationFitOK()
|
---|
150 | && ( (!IsHiGainSaturation() && !IsHiGainBad())
|
---|
151 | || (IsHiGainSaturation() && !IsLoGainBad()) ) ;}
|
---|
152 |
|
---|
153 | void Merge(const MBadPixelsPix &pix);
|
---|
154 |
|
---|
155 | const TArrayI &GetInfo() const { return fInfo; }
|
---|
156 |
|
---|
157 | ClassDef(MBadPixelsPix, 1) // Storage Container for bad pixel information of a single pixel
|
---|
158 | };
|
---|
159 |
|
---|
160 | #endif
|
---|
161 |
|
---|