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

Last change on this file since 3614 was 3601, checked in by gaug, 22 years ago
*** empty log message ***
File size: 3.0 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 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 kHiGainNotCalibrated = BIT(1),
31 kLoGainNotCalibrated = BIT(2),
32 kHiGainNotFitted = BIT(3),
33 kLoGainNotFitted = BIT(4),
34 kHiGainOscillating = BIT(5),
35 kLoGainOscillating = 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 };
45
46 void Reset();
47 void Clear(Option_t *o="");
48 void Copy(TObject &object) const
49 {
50 static_cast<MBadPixelsPix&>(object).fInfo = fInfo;
51 }
52
53 // Setter
54 void SetUnsuitable ( UnsuitableType_t typ ) { fInfo[0] |= typ; }
55 void SetUncalibrated( UncalibratedType_t typ ) { fInfo[1] |= typ; }
56
57 // Getter
58 Bool_t IsUnsuitable ( UnsuitableType_t typ ) const { return fInfo[0]&typ; }
59 Bool_t IsUncalibrated( UncalibratedType_t typ ) const { return fInfo[1]&typ; }
60
61 Bool_t IsOK() const { return fInfo[0]==0; }
62 Bool_t IsBad() const { return fInfo[0]!=0; }
63
64 Bool_t IsLoGainBad() const { return IsUnsuitable (kUnsuitableRun )
65 || IsUncalibrated(kLoGainSaturation )
66 || IsUncalibrated(kLoGainNotCalibrated)
67 || IsUncalibrated(kLoGainOscillating ) ; }
68 Bool_t IsHiGainBad() const { return IsUnsuitable (kUnsuitableRun )
69 || IsUncalibrated(kHiGainNotCalibrated)
70 || IsUncalibrated(kHiGainOscillating ) ; }
71
72 Bool_t IsCalibrationSignalOK() const { return !( IsUncalibrated(kChargeIsPedestal )
73 || IsUncalibrated(kChargeErrNotValid )
74 || IsUncalibrated(kChargeRelErrNotValid)
75 || IsUncalibrated(kChargeSigmaNotValid )
76 || IsUncalibrated(kMeanTimeInFirstBin )
77 || IsUncalibrated(kMeanTimeInLast2Bins ) ); }
78
79 Bool_t IsCalibrationResultOK() const { return !IsUnsuitable(kUnsuitableRun)
80 && IsCalibrationSignalOK()
81 && !IsHiGainBad()
82 && !IsLoGainBad() ; }
83
84 void Merge(const MBadPixelsPix &pix);
85
86 const TArrayI &GetInfo() const { return fInfo; }
87
88 ClassDef(MBadPixelsPix, 1) // Storage Container for bad pixel information of a single pixel
89};
90
91#endif
92
Note: See TracBrowser for help on using the repository browser.