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

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