| 1 | #ifndef MARS_MBadPixelsTreat | 
|---|
| 2 | #define MARS_MBadPixelsTreat | 
|---|
| 3 |  | 
|---|
| 4 | #ifndef MARS_MTask | 
|---|
| 5 | #include "MTask.h" | 
|---|
| 6 | #endif | 
|---|
| 7 |  | 
|---|
| 8 | class MGeomCam; | 
|---|
| 9 | class MSignalCam; | 
|---|
| 10 | class MPedPhotCam; | 
|---|
| 11 | class MBadPixelsCam; | 
|---|
| 12 |  | 
|---|
| 13 | class MBadPixelsTreat : public MTask | 
|---|
| 14 | { | 
|---|
| 15 | private: | 
|---|
| 16 | MGeomCam      *fGeomCam;   //! | 
|---|
| 17 | MSignalCam    *fEvt;       //! | 
|---|
| 18 | MBadPixelsCam *fBadPixels; //! | 
|---|
| 19 |  | 
|---|
| 20 | TList fPedPhotCams; | 
|---|
| 21 |  | 
|---|
| 22 | Byte_t fFlags;       // flag for the method which is used | 
|---|
| 23 | Byte_t fNumMinNeighbors; | 
|---|
| 24 |  | 
|---|
| 25 | TList fNamePedPhotCams; | 
|---|
| 26 |  | 
|---|
| 27 | enum | 
|---|
| 28 | { | 
|---|
| 29 | kUseInterpolation   = 1, | 
|---|
| 30 | kUseCentralPixel    = 2, | 
|---|
| 31 | kProcessPedestalRun = 3, | 
|---|
| 32 | kProcessPedestalEvt = 4, | 
|---|
| 33 | kProcessTimes       = 5, | 
|---|
| 34 | kHardTreatment      = 6 | 
|---|
| 35 | }; | 
|---|
| 36 |  | 
|---|
| 37 | static Double_t Pow2(Double_t x) { return x*x; } | 
|---|
| 38 |  | 
|---|
| 39 | void InterpolateTimes() const; | 
|---|
| 40 | void InterpolateSignal() const; | 
|---|
| 41 | void InterpolatePedestals(MPedPhotCam &pedphot) const; | 
|---|
| 42 | void InterpolatePedestals() const; | 
|---|
| 43 |  | 
|---|
| 44 | void   Unmap() const; | 
|---|
| 45 | Bool_t IsPixelBad(Int_t idx) const; | 
|---|
| 46 |  | 
|---|
| 47 | Bool_t ReInit(MParList *pList); | 
|---|
| 48 | Int_t  PreProcess(MParList *pList); | 
|---|
| 49 | Int_t  Process(); | 
|---|
| 50 | Int_t  ReadEnv(const TEnv &env, TString prefix, Bool_t print); | 
|---|
| 51 | void   StreamPrimitive(ofstream &out) const; | 
|---|
| 52 |  | 
|---|
| 53 | public: | 
|---|
| 54 | MBadPixelsTreat(const char *name=NULL, const char *title=NULL); | 
|---|
| 55 |  | 
|---|
| 56 | void SetUseInterpolation(Bool_t b=kTRUE) | 
|---|
| 57 | { | 
|---|
| 58 | b ? SETBIT(fFlags, kUseInterpolation) : CLRBIT(fFlags, kUseInterpolation); | 
|---|
| 59 | } | 
|---|
| 60 | void SetUseCentralPixel(Bool_t b=kTRUE) | 
|---|
| 61 | { | 
|---|
| 62 | b ? SETBIT(fFlags, kUseCentralPixel) : CLRBIT(fFlags, kUseCentralPixel); | 
|---|
| 63 | } | 
|---|
| 64 | void SetProcessPedestalRun(Bool_t b=kTRUE) | 
|---|
| 65 | { | 
|---|
| 66 | b ? SETBIT(fFlags, kProcessPedestalRun) : CLRBIT(fFlags, kProcessPedestalRun); | 
|---|
| 67 | } | 
|---|
| 68 | void SetProcessPedestalEvt(Bool_t b=kTRUE) | 
|---|
| 69 | { | 
|---|
| 70 | b ? SETBIT(fFlags, kProcessPedestalEvt) : CLRBIT(fFlags, kProcessPedestalEvt); | 
|---|
| 71 | } | 
|---|
| 72 | void SetProcessPedestal(Bool_t b=kTRUE) | 
|---|
| 73 | { | 
|---|
| 74 | SetProcessPedestalRun(!b); | 
|---|
| 75 | SetProcessPedestalEvt(b); | 
|---|
| 76 | } | 
|---|
| 77 | void SetProcessTimes(Bool_t b=kTRUE) | 
|---|
| 78 | { | 
|---|
| 79 | b ? SETBIT(fFlags, kProcessTimes) : CLRBIT(fFlags, kProcessTimes); | 
|---|
| 80 | } | 
|---|
| 81 | void SetHardTreatment(Bool_t b=kTRUE) | 
|---|
| 82 | { | 
|---|
| 83 | b ? SETBIT(fFlags, kHardTreatment) : CLRBIT(fFlags, kHardTreatment); | 
|---|
| 84 | } | 
|---|
| 85 |  | 
|---|
| 86 | Bool_t IsHardTreatment() const      { return TESTBIT(fFlags, kHardTreatment); } | 
|---|
| 87 | Bool_t IsProcessPedestalRun() const { return TESTBIT(fFlags, kProcessPedestalRun); } | 
|---|
| 88 | Bool_t IsProcessPedestalEvt() const { return TESTBIT(fFlags, kProcessPedestalEvt); } | 
|---|
| 89 | Bool_t IsProcessTimes() const       { return TESTBIT(fFlags, kProcessTimes); } | 
|---|
| 90 | Bool_t IsUseCentralPixel() const    { return TESTBIT(fFlags, kUseCentralPixel); } | 
|---|
| 91 | Bool_t IsUseInterpolation() const   { return TESTBIT(fFlags, kUseInterpolation); } | 
|---|
| 92 |  | 
|---|
| 93 | void SetNumMinNeighbors(Byte_t num) { fNumMinNeighbors=num; } | 
|---|
| 94 | void AddNamePedPhotCam(const char *name="MPedPhotCam"); | 
|---|
| 95 | void SetNamePedPhotCam(const char *name) | 
|---|
| 96 | { | 
|---|
| 97 | AddNamePedPhotCam(name); | 
|---|
| 98 | } // Deprecated! Use AddNamePedPhotCam instead (directly) | 
|---|
| 99 |  | 
|---|
| 100 | ClassDef(MBadPixelsTreat, 1) // Task to treat bad pixels (interpolation, unmapping) | 
|---|
| 101 | }; | 
|---|
| 102 |  | 
|---|
| 103 | #endif | 
|---|
| 104 |  | 
|---|