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

Last change on this file since 4467 was 4464, checked in by tbretz, 20 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 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 kDeviatingFFactor = BIT(15),
48 kDeviatingTimeResolution = BIT(16),
49 kConversionHiLoNotValid = BIT(17)
50 };
51
52 // This is just a start..
53 enum HardwareType_t {
54 kHVNotNominal = BIT(1)
55 };
56
57
58 void Reset();
59 void Clear(Option_t *o="");
60 void Copy(TObject &object) const
61 {
62 static_cast<MBadPixelsPix&>(object).fInfo = fInfo;
63 }
64
65 // Setter
66 void SetUnsuitable (UnsuitableType_t typ) { fInfo[0] |= typ; }
67 void SetUncalibrated(UncalibratedType_t typ) { fInfo[1] |= typ; }
68 void SetHardware (HardwareType_t typ) { fInfo[2] |= typ; }
69
70 // Getter
71 Bool_t IsUnsuitable (UnsuitableType_t typ) const { return fInfo[0]&typ; }
72 Bool_t IsUncalibrated(UncalibratedType_t typ) const { return fInfo[1]&typ; }
73 Bool_t IsHardwareBad (HardwareType_t typ) const { return fInfo[2]&typ; }
74
75 Bool_t IsUnsuitable() const { return fInfo[0]&kUnsuitable; }
76 Bool_t IsUnreliable() const { return fInfo[0]&kUnreliable; }
77
78 Bool_t IsOK() const { return fInfo[0]==0; }
79 Bool_t IsBad() const { return fInfo[0]!=0; }
80
81 Bool_t IsLoGainBad() const { return IsUnsuitable (kUnsuitableRun )
82 || IsUncalibrated(kLoGainSaturation )
83 || IsUncalibrated(kConversionHiLoNotValid)
84 || IsUncalibrated(kLoGainOscillating ) ; }
85 Bool_t IsHiGainBad() const { return IsUnsuitable (kUnsuitableRun )
86 || IsUncalibrated(kHiGainOscillating ) ; }
87
88 void Merge(const MBadPixelsPix &pix);
89
90 const TArrayI &GetInfo() const { return fInfo; }
91
92 ClassDef(MBadPixelsPix, 1) // Storage Container for bad pixel information of a single pixel
93};
94
95#endif
96
Note: See TracBrowser for help on using the repository browser.