source: trunk/MagicSoft/Mars/mbadpixels/MBadPixelsPix.h@ 6005

Last change on this file since 6005 was 5996, checked in by gaug, 20 years ago
*** empty log message ***
File size: 4.5 KB
Line 
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
12class MBadPixelsPix : public MParContainer
13{
14private:
15 TArrayI fInfo;
16
17public:
18 MBadPixelsPix(const char* name=NULL, const char* title=NULL);
19
20 enum UnsuitableType_t {
21 kUnsuitableRun = BIT(1),
22 kUnsuitableEvt = BIT(2),
23 kUnsuitable = kUnsuitableRun|kUnsuitableEvt,
24 kUnreliableRun = BIT(3),
25 kUnreliableEvt = BIT(4),
26 kUnreliable = kUnreliableRun|kUnreliableEvt
27 };
28
29 static const Int_t fgRunMask; // All types which are not event wise determined
30
31 // All types are initialized to normal behaviour
32 enum UncalibratedType_t {
33 kHiGainNotFitted = BIT(1),
34 kLoGainNotFitted = BIT(2),
35 kRelTimeNotFitted = BIT(3),
36 kHiGainOscillating = BIT(4),
37 kLoGainOscillating = BIT(5),
38 kRelTimeOscillating = BIT(6),
39 kLoGainSaturation = BIT(7),
40 kChargeIsPedestal = BIT(8),
41 kChargeErrNotValid = BIT(9),
42 kChargeRelErrNotValid = BIT(10),
43 kChargeSigmaNotValid = BIT(11),
44 kMeanTimeInFirstBin = BIT(12),
45 kMeanTimeInLast2Bins = BIT(13),
46 kDeviatingNumPhes = BIT(14),
47 kDeviatingNumPhots = BIT(15),
48 kDeviatingFFactor = BIT(16),
49 kDeviatingTimeResolution = BIT(17),
50 kConversionHiLoNotValid = BIT(18),
51 kHiGainOverFlow = BIT(19),
52 kLoGainOverFlow = BIT(20),
53 kHiLoNotFitted = BIT(21),
54 kHiLoOscillating = BIT(22)
55 };
56
57 // This is just a start..
58 enum HardwareType_t {
59 kHVNotNominal = BIT(1)
60 };
61
62
63 void Reset();
64 void Clear(Option_t *o="");
65 void Copy(TObject &object) const
66 {
67 static_cast<MBadPixelsPix&>(object).fInfo = fInfo;
68 }
69
70 // Setter
71 void SetUnsuitable (UnsuitableType_t typ) { fInfo[0] |= typ; }
72 void SetUncalibrated(UncalibratedType_t typ) { fInfo[1] |= typ; }
73 void SetHardware (HardwareType_t typ) { fInfo[2] |= typ; }
74
75 // Getter
76 Bool_t IsUnsuitable (UnsuitableType_t typ) const { return fInfo[0]&typ; }
77 Bool_t IsUncalibrated(UncalibratedType_t typ) const { return fInfo[1]&typ; }
78 Bool_t IsHardwareBad (HardwareType_t typ) const { return fInfo[2]&typ; }
79
80 Bool_t IsUnsuitable() const { return fInfo[0]&kUnsuitable; }
81 Bool_t IsUnreliable() const { return fInfo[0]&kUnreliable; }
82
83 Bool_t IsOK() const { return fInfo[0]==0; }
84 Bool_t IsBad() const { return fInfo[0]!=0; }
85
86 Bool_t IsLoGainBad() const { return IsUnsuitable (kUnsuitableRun )
87 || IsUncalibrated(kLoGainSaturation )
88 || IsUncalibrated(kConversionHiLoNotValid)
89 || IsUncalibrated(kLoGainOscillating ) ; }
90 Bool_t IsHiGainBad() const { return IsUnsuitable (kUnsuitableRun )
91 || IsUncalibrated(kHiGainOscillating ) ; }
92
93 Int_t GetUnsuitableCalLevel() const {
94 if (!IsUnsuitable()) return 0;
95 if (IsUncalibrated( kChargeIsPedestal )) return 1;
96 if (IsUncalibrated( kChargeRelErrNotValid)) return 2;
97 if (IsUncalibrated( kLoGainSaturation )) return 3;
98 if (IsUncalibrated( kMeanTimeInFirstBin )) return 4;
99 if (IsUncalibrated( kMeanTimeInLast2Bins )) return 5;
100 if (IsUncalibrated( kDeviatingNumPhots )) return 6;
101 if (IsUncalibrated( kHiGainOverFlow )) return 7;
102 if (IsUncalibrated( kLoGainOverFlow )) return 8;
103 return 9;
104 }
105
106 Int_t GetUnreliableCalLevel() const {
107 if (!IsUnreliable() || IsUnsuitable()) return 0;
108 if (IsUncalibrated( kChargeSigmaNotValid )) return 1;
109 if (IsUncalibrated( kDeviatingNumPhes )) return 2;
110 if (IsUncalibrated( kHiGainNotFitted )) return 3;
111 if (IsUncalibrated( kLoGainNotFitted )) return 4;
112 if (IsUncalibrated( kRelTimeNotFitted )) return 5;
113 if (IsUncalibrated( kHiGainOscillating )) return 6;
114 if (IsUncalibrated( kLoGainOscillating )) return 7;
115 if (IsUncalibrated( kRelTimeOscillating )) return 8;
116 if (IsUncalibrated( kDeviatingFFactor )) return 9;
117 return 10;
118 }
119
120
121
122 void Merge(const MBadPixelsPix &pix);
123
124 const TArrayI &GetInfo() const { return fInfo; }
125
126 ClassDef(MBadPixelsPix, 1) // Storage Container for bad pixel information of a single pixel
127};
128
129#endif
130
Note: See TracBrowser for help on using the repository browser.