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 | static const Int_t fgRunMask; // All types which are not event wise determined
|
---|
27 |
|
---|
28 | // All types are initialized to normal behaviour
|
---|
29 | enum UncalibratedType_t {
|
---|
30 | kHiGainNotFitted = BIT(1),
|
---|
31 | kLoGainNotFitted = BIT(2),
|
---|
32 | kRelTimeNotFitted = BIT(3),
|
---|
33 | kHiGainOscillating = BIT(4),
|
---|
34 | kLoGainOscillating = BIT(5),
|
---|
35 | kRelTimeOscillating = BIT(6),
|
---|
36 | kLoGainSaturation = BIT(7),
|
---|
37 | kChargeIsPedestal = BIT(8 ),
|
---|
38 | kChargeErrNotValid = BIT(9 ),
|
---|
39 | kChargeRelErrNotValid = BIT(10),
|
---|
40 | kChargeSigmaNotValid = BIT(11),
|
---|
41 | kMeanTimeInFirstBin = BIT(12),
|
---|
42 | kMeanTimeInLast2Bins = BIT(13),
|
---|
43 | kDeviatingNumPhes = BIT(14),
|
---|
44 | kDeviatingFFactor = BIT(15),
|
---|
45 | kConversionHiLoNotValid = BIT(16)
|
---|
46 | };
|
---|
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 SetUnsuitable ( UnsuitableType_t typ ) { fInfo[0] |= typ; }
|
---|
57 | void SetUncalibrated( UncalibratedType_t typ ) { fInfo[1] |= typ; }
|
---|
58 |
|
---|
59 | // Getter
|
---|
60 | Bool_t IsUnsuitable ( UnsuitableType_t typ ) const { return fInfo[0]&typ; }
|
---|
61 | Bool_t IsUncalibrated( UncalibratedType_t typ ) const { return fInfo[1]&typ; }
|
---|
62 |
|
---|
63 | Bool_t IsOK() const { return fInfo[0]==0; }
|
---|
64 | Bool_t IsBad() const { return fInfo[0]!=0; }
|
---|
65 |
|
---|
66 | Bool_t IsLoGainBad() const { return IsUnsuitable (kUnsuitableRun )
|
---|
67 | || IsUncalibrated(kLoGainSaturation )
|
---|
68 | || IsUncalibrated(kConversionHiLoNotValid)
|
---|
69 | || IsUncalibrated(kLoGainOscillating ) ; }
|
---|
70 | Bool_t IsHiGainBad() const { return IsUnsuitable (kUnsuitableRun )
|
---|
71 | || IsUncalibrated(kHiGainOscillating ) ; }
|
---|
72 |
|
---|
73 | void Merge(const MBadPixelsPix &pix);
|
---|
74 |
|
---|
75 | const TArrayI &GetInfo() const { return fInfo; }
|
---|
76 |
|
---|
77 | ClassDef(MBadPixelsPix, 1) // Storage Container for bad pixel information of a single pixel
|
---|
78 | };
|
---|
79 |
|
---|
80 | #endif
|
---|
81 |
|
---|