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

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