1 | #ifndef MARS_MJCalib
|
---|
2 | #define MARS_MJCalib
|
---|
3 |
|
---|
4 | #ifndef MARS_MJob
|
---|
5 | #include "MJob.h"
|
---|
6 | #endif
|
---|
7 |
|
---|
8 | class MRunIter;
|
---|
9 |
|
---|
10 | class MJCalib : public MJob
|
---|
11 | {
|
---|
12 | public:
|
---|
13 | enum DataType_t
|
---|
14 | {
|
---|
15 | kIsUseRootData,
|
---|
16 | kIsUseRawData,
|
---|
17 | kIsUseMC
|
---|
18 | };
|
---|
19 |
|
---|
20 | private:
|
---|
21 |
|
---|
22 | static const Int_t fgCheckedPixId; //! Default for fCheckedPixId
|
---|
23 |
|
---|
24 | Byte_t fDataFlag; // Bit-field to store the data type
|
---|
25 |
|
---|
26 | enum Storage_t // Possible devices for calibration
|
---|
27 | {
|
---|
28 | kNoStorage,
|
---|
29 | kHistsStorage
|
---|
30 | }; // Possible flags for the storage of results
|
---|
31 |
|
---|
32 | Byte_t fStorage; // Bit-field for chosen storage type
|
---|
33 |
|
---|
34 | enum Device_t // Possible devices for calibration
|
---|
35 | {
|
---|
36 | kUseBlindPixel,
|
---|
37 | kUsePINDiode
|
---|
38 | };
|
---|
39 |
|
---|
40 | Byte_t fDevices; // Bit-field for used devices for calibration
|
---|
41 |
|
---|
42 | protected:
|
---|
43 |
|
---|
44 | Bool_t fIsPixelCheck; // Check a test pixel?
|
---|
45 | Int_t fCheckedPixId; // ID of checked pixel
|
---|
46 |
|
---|
47 | Bool_t fIsPulsePosCheck; // Check pulse position?
|
---|
48 | Bool_t fIsHiLoCalibration; // Choose to calibrate the high-gain vs. low-gains
|
---|
49 |
|
---|
50 | MRunIter *fRuns; // Data files, only used for test applications, default is sequence files!
|
---|
51 |
|
---|
52 | Bool_t CheckEnvLocal();
|
---|
53 | Byte_t GetDataFlag() { return fDataFlag; }
|
---|
54 |
|
---|
55 | Bool_t IsNoStorage () const { return TESTBIT(fStorage,kNoStorage); }
|
---|
56 | Bool_t IsHistsStorage () const { return TESTBIT(fStorage,kHistsStorage); }
|
---|
57 |
|
---|
58 | public:
|
---|
59 |
|
---|
60 | MJCalib();
|
---|
61 |
|
---|
62 | void SetInput(MRunIter *iter) { fRuns = iter; }
|
---|
63 |
|
---|
64 | Bool_t IsUseRawData() const { return fDataFlag==kIsUseRawData; }
|
---|
65 | Bool_t IsUseRootData() const { return fDataFlag==kIsUseRootData; }
|
---|
66 | Bool_t IsUseMC() const { return fDataFlag==kIsUseMC; }
|
---|
67 |
|
---|
68 | Bool_t IsUseBlindPixel() const { return TESTBIT(fDevices,kUseBlindPixel); }
|
---|
69 | Bool_t IsUsePINDiode () const { return TESTBIT(fDevices,kUsePINDiode); }
|
---|
70 |
|
---|
71 | void SetUseRawData () { fDataFlag=kIsUseRawData; }
|
---|
72 | void SetUseRootData() { fDataFlag=kIsUseRootData; }
|
---|
73 | void SetUseMC () { fDataFlag=kIsUseMC; }
|
---|
74 |
|
---|
75 | void SetDataType(DataType_t type) { fDataFlag=type; }
|
---|
76 |
|
---|
77 | void SetCheckedPixId ( const Int_t i=fgCheckedPixId ) { fCheckedPixId = i; }
|
---|
78 |
|
---|
79 | void SetNoStorage ( const Bool_t b=kTRUE ) { b ? SETBIT(fStorage,kNoStorage) : CLRBIT(fStorage,kNoStorage); }
|
---|
80 | void SetHistsStorage ( const Bool_t b=kTRUE ) { b ? SETBIT(fStorage,kHistsStorage) : CLRBIT(fStorage,kHistsStorage); }
|
---|
81 |
|
---|
82 | void SetHiLoCalibration( const Bool_t b=kTRUE ) { fIsHiLoCalibration = b; }
|
---|
83 | void SetPixelCheck ( const Bool_t b=kTRUE ) { fIsPixelCheck = b; }
|
---|
84 | void SetPulsePosCheck ( const Bool_t b=kTRUE ) { fIsPulsePosCheck = b; }
|
---|
85 |
|
---|
86 | void SetUseBlindPixel(const Bool_t b=kTRUE) { b ? SETBIT(fDevices,kUseBlindPixel) : CLRBIT(fDevices,kUseBlindPixel); }
|
---|
87 | void SetUsePINDiode(const Bool_t b=kTRUE) { b ? SETBIT(fDevices,kUsePINDiode) : CLRBIT(fDevices,kUsePINDiode); }
|
---|
88 |
|
---|
89 | ClassDef(MJCalib, 0) // Base class for calibration jobs
|
---|
90 | };
|
---|
91 |
|
---|
92 | #endif
|
---|