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