| 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 | MPedPhotCam   *fPedPhot1;  //! Pedestal from extractor used for "no-signal" in InterpolateTimes | 
|---|
| 21 | MPedPhotCam   *fPedPhot2;  //! Pedestal from extractor used for "no-signal" in InterpolateTimes | 
|---|
| 22 |  | 
|---|
| 23 |  | 
|---|
| 24 | TList fPedPhotCams; | 
|---|
| 25 |  | 
|---|
| 26 | Byte_t  fFlags;                // flag for the method which is used | 
|---|
| 27 | Byte_t  fNumMinNeighbors;      // Number of neighbors required | 
|---|
| 28 | Float_t fMaxArrivalTimeDiff;   // Maximum allowed arrival time difference of neighboring pixels | 
|---|
| 29 |  | 
|---|
| 30 | TList fNamePedPhotCams; | 
|---|
| 31 |  | 
|---|
| 32 | enum | 
|---|
| 33 | { | 
|---|
| 34 | kUseInterpolation   = 1, | 
|---|
| 35 | kUseCentralPixel    = 2, | 
|---|
| 36 | kProcessPedestalRun = 3, | 
|---|
| 37 | kProcessPedestalEvt = 4, | 
|---|
| 38 | kProcessTimes       = 5, | 
|---|
| 39 | kHardTreatment      = 6 | 
|---|
| 40 | }; | 
|---|
| 41 |  | 
|---|
| 42 | static Double_t Pow2(Double_t x) { return x*x; } | 
|---|
| 43 |  | 
|---|
| 44 | void InterpolateTimes() const; | 
|---|
| 45 | void InterpolateSignal() const; | 
|---|
| 46 | void InterpolatePedestals(MPedPhotCam &pedphot) const; | 
|---|
| 47 | void InterpolatePedestals() const; | 
|---|
| 48 |  | 
|---|
| 49 | void   Unmap() const; | 
|---|
| 50 | Bool_t IsPixelBad(Int_t idx) const; | 
|---|
| 51 |  | 
|---|
| 52 | Bool_t ReInit(MParList *pList); | 
|---|
| 53 | Int_t  PreProcess(MParList *pList); | 
|---|
| 54 | Int_t  Process(); | 
|---|
| 55 | Int_t  ReadEnv(const TEnv &env, TString prefix, Bool_t print); | 
|---|
| 56 |  | 
|---|
| 57 | void   StreamPrimitive(ostream &out) const; | 
|---|
| 58 |  | 
|---|
| 59 | public: | 
|---|
| 60 | MBadPixelsTreat(const char *name=NULL, const char *title=NULL); | 
|---|
| 61 |  | 
|---|
| 62 | void SetUseInterpolation(Bool_t b=kTRUE) | 
|---|
| 63 | { | 
|---|
| 64 | b ? SETBIT(fFlags, kUseInterpolation) : CLRBIT(fFlags, kUseInterpolation); | 
|---|
| 65 | } | 
|---|
| 66 | void SetUseCentralPixel(Bool_t b=kTRUE) | 
|---|
| 67 | { | 
|---|
| 68 | b ? SETBIT(fFlags, kUseCentralPixel) : CLRBIT(fFlags, kUseCentralPixel); | 
|---|
| 69 | } | 
|---|
| 70 | void SetProcessPedestalRun(Bool_t b=kTRUE) | 
|---|
| 71 | { | 
|---|
| 72 | b ? SETBIT(fFlags, kProcessPedestalRun) : CLRBIT(fFlags, kProcessPedestalRun); | 
|---|
| 73 | } | 
|---|
| 74 | void SetProcessPedestalEvt(Bool_t b=kTRUE) | 
|---|
| 75 | { | 
|---|
| 76 | b ? SETBIT(fFlags, kProcessPedestalEvt) : CLRBIT(fFlags, kProcessPedestalEvt); | 
|---|
| 77 | } | 
|---|
| 78 | void SetProcessPedestal(Bool_t b=kTRUE) | 
|---|
| 79 | { | 
|---|
| 80 | SetProcessPedestalRun(!b); | 
|---|
| 81 | SetProcessPedestalEvt(b); | 
|---|
| 82 | } | 
|---|
| 83 | void SetProcessTimes(Bool_t b=kTRUE) | 
|---|
| 84 | { | 
|---|
| 85 | b ? SETBIT(fFlags, kProcessTimes) : CLRBIT(fFlags, kProcessTimes); | 
|---|
| 86 | } | 
|---|
| 87 | void SetHardTreatment(Bool_t b=kTRUE) | 
|---|
| 88 | { | 
|---|
| 89 | b ? SETBIT(fFlags, kHardTreatment) : CLRBIT(fFlags, kHardTreatment); | 
|---|
| 90 | } | 
|---|
| 91 |  | 
|---|
| 92 | Bool_t IsHardTreatment() const      { return TESTBIT(fFlags, kHardTreatment); } | 
|---|
| 93 | Bool_t IsProcessPedestalRun() const { return TESTBIT(fFlags, kProcessPedestalRun); } | 
|---|
| 94 | Bool_t IsProcessPedestalEvt() const { return TESTBIT(fFlags, kProcessPedestalEvt); } | 
|---|
| 95 | Bool_t IsProcessTimes() const       { return TESTBIT(fFlags, kProcessTimes); } | 
|---|
| 96 | Bool_t IsUseCentralPixel() const    { return TESTBIT(fFlags, kUseCentralPixel); } | 
|---|
| 97 | Bool_t IsUseInterpolation() const   { return TESTBIT(fFlags, kUseInterpolation); } | 
|---|
| 98 |  | 
|---|
| 99 | void SetNumMinNeighbors(Byte_t num)   { fNumMinNeighbors=num; } | 
|---|
| 100 | void SetMaxArrivalTimeDiff(Float_t d) { fMaxArrivalTimeDiff=d; } | 
|---|
| 101 | void AddNamePedPhotCam(const char *name="MPedPhotCam"); | 
|---|
| 102 | void SetNamePedPhotCam(const char *name) | 
|---|
| 103 | { | 
|---|
| 104 | AddNamePedPhotCam(name); | 
|---|
| 105 | } // Deprecated! Use AddNamePedPhotCam instead (directly) | 
|---|
| 106 |  | 
|---|
| 107 | ClassDef(MBadPixelsTreat, 1) // Task to treat bad pixels (interpolation, unmapping) | 
|---|
| 108 | }; | 
|---|
| 109 |  | 
|---|
| 110 | #endif | 
|---|
| 111 |  | 
|---|