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 MCerPhotEvt;
|
---|
10 | class MPedPhotCam;
|
---|
11 | class MArrivalTime;
|
---|
12 | class MBadPixelsCam;
|
---|
13 |
|
---|
14 | class MBadPixelsTreat : public MTask
|
---|
15 | {
|
---|
16 | private:
|
---|
17 | MGeomCam *fGeomCam; //!
|
---|
18 | MPedPhotCam *fPedPhot; //!
|
---|
19 | MCerPhotEvt *fEvt; //!
|
---|
20 | MArrivalTime *fTimes; //!
|
---|
21 | MBadPixelsCam *fBadPixels; //!
|
---|
22 |
|
---|
23 | Byte_t fFlags; // flag for the method which is used
|
---|
24 | Byte_t fNumMinNeighbors;
|
---|
25 |
|
---|
26 | TString fNamePedPhotCam; // name of the 'MPedPhotCam' container
|
---|
27 |
|
---|
28 | enum
|
---|
29 | {
|
---|
30 | kUseInterpolation = 1,
|
---|
31 | kUseCentralPixel = 2,
|
---|
32 | kProcessPedestalRun = 3,
|
---|
33 | kProcessPedestalEvt = 4,
|
---|
34 | kProcessTimes = 5,
|
---|
35 | kHardTreatment = 6
|
---|
36 | };
|
---|
37 |
|
---|
38 | static Double_t Pow2(Double_t x) { return x*x; }
|
---|
39 |
|
---|
40 | void InterpolateTimes() const;
|
---|
41 | void InterpolateSignal() 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 SetNamePedPhotCam(const char *name) { fNamePedPhotCam = name; }
|
---|
95 |
|
---|
96 | ClassDef(MBadPixelsTreat, 1) // Task to treat bad pixels (interpolation, unmapping)
|
---|
97 | };
|
---|
98 |
|
---|
99 | #endif
|
---|
100 |
|
---|