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

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