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

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