| 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 | Bool_t CheckEnvLocal(); | 
|---|
| 51 | Byte_t GetDataFlag() { return fDataFlag; } | 
|---|
| 52 |  | 
|---|
| 53 | Bool_t IsNoStorage    () const { return TESTBIT(fStorage,kNoStorage);    } | 
|---|
| 54 | Bool_t IsHistsStorage () const { return TESTBIT(fStorage,kHistsStorage); } | 
|---|
| 55 |  | 
|---|
| 56 | public: | 
|---|
| 57 |  | 
|---|
| 58 | MJCalib(); | 
|---|
| 59 |  | 
|---|
| 60 | Bool_t IsUseRawData()  const { return fDataFlag==kIsUseRawData;  } | 
|---|
| 61 | Bool_t IsUseRootData() const { return fDataFlag==kIsUseRootData; } | 
|---|
| 62 | Bool_t IsUseMC()       const { return fDataFlag==kIsUseMC;       } | 
|---|
| 63 |  | 
|---|
| 64 | Bool_t IsUseBlindPixel() const { return TESTBIT(fDevices,kUseBlindPixel); } | 
|---|
| 65 | Bool_t IsUsePINDiode  () const { return TESTBIT(fDevices,kUsePINDiode);   } | 
|---|
| 66 |  | 
|---|
| 67 | void SetUseRawData () { fDataFlag=kIsUseRawData;  } | 
|---|
| 68 | void SetUseRootData() { fDataFlag=kIsUseRootData; } | 
|---|
| 69 | void SetUseMC      () { fDataFlag=kIsUseMC;       } | 
|---|
| 70 |  | 
|---|
| 71 | void SetDataType(DataType_t type) { fDataFlag=type; } | 
|---|
| 72 |  | 
|---|
| 73 | void SetCheckedPixId ( const Int_t  i=fgCheckedPixId ) { fCheckedPixId  = i; } | 
|---|
| 74 |  | 
|---|
| 75 | void SetNoStorage    ( const Bool_t b=kTRUE ) { b ? SETBIT(fStorage,kNoStorage)    : CLRBIT(fStorage,kNoStorage); } | 
|---|
| 76 | void SetHistsStorage ( const Bool_t b=kTRUE ) { b ? SETBIT(fStorage,kHistsStorage) : CLRBIT(fStorage,kHistsStorage); } | 
|---|
| 77 |  | 
|---|
| 78 | //void SetHiLoCalibration( const Bool_t b=kTRUE )  { fIsHiLoCalibration = b; } | 
|---|
| 79 | void SetPixelCheck     ( const Bool_t b=kTRUE )  { fIsPixelCheck        = b; } | 
|---|
| 80 | void SetPulsePosCheck  ( const Bool_t b=kTRUE )  { fIsPulsePosCheck     = b; } | 
|---|
| 81 |  | 
|---|
| 82 | void SetUseBlindPixel(const Bool_t b=kTRUE) { b ? SETBIT(fDevices,kUseBlindPixel) : CLRBIT(fDevices,kUseBlindPixel); } | 
|---|
| 83 | void SetUsePINDiode(const Bool_t b=kTRUE)   { b ? SETBIT(fDevices,kUsePINDiode) : CLRBIT(fDevices,kUsePINDiode); } | 
|---|
| 84 |  | 
|---|
| 85 | ClassDef(MJCalib, 0) // Base class for calibration jobs | 
|---|
| 86 | }; | 
|---|
| 87 |  | 
|---|
| 88 | #endif | 
|---|