source: branches/removing_cpp11_features/mbadpixels/MBadPixelsTreat.h@ 19127

Last change on this file since 19127 was 14855, checked in by tbretz, 12 years ago
Added the possibility to set name of MSignalCam
File size: 3.8 KB
Line 
1#ifndef MARS_MBadPixelsTreat
2#define MARS_MBadPixelsTreat
3
4#ifndef MARS_MTask
5#include "MTask.h"
6#endif
7
8class MGeomCam;
9class MSignalCam;
10class MPedPhotCam;
11class MBadPixelsCam;
12
13class MBadPixelsTreat : public MTask
14{
15private:
16 MGeomCam *fGeomCam; //! Camera geometry to get the area scaling factors
17 MSignalCam *fEvt; //! Signal Event to be interpolated
18 MBadPixelsCam *fBadPixels; //! Bad Pixels to be interpolated
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 TString fNameSignalCam;
24
25 TList fPedPhotCams; // List of PedPhotCams to be treated
26
27 Byte_t fFlags; // flag for the method which is used
28 Byte_t fNumMinNeighbors; // Number of neighbors required
29 Float_t fMaxArrivalTimeDiff; // Maximum allowed arrival time difference of neighboring pixels
30
31 TList fNamePedPhotCams;
32
33 enum
34 {
35 kUseInterpolation = 1,
36 kUseCentralPixel = 2,
37 kProcessPedestalRun = 3,
38 kProcessPedestalEvt = 4,
39 kProcessTimes = 5,
40 kHardTreatment = 6
41 };
42
43 static Double_t Pow2(Double_t x) { return x*x; }
44
45 void InterpolateTimes() const;
46 void InterpolateSignal() const;
47 void InterpolatePedestals(MPedPhotCam &pedphot) const;
48 void InterpolatePedestals() const;
49
50 void Unmap() const;
51 Bool_t IsPixelBad(Int_t idx) const;
52
53 Bool_t ReInit(MParList *pList);
54 Int_t PreProcess(MParList *pList);
55 Int_t Process();
56 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
57
58 void StreamPrimitive(std::ostream &out) const;
59
60public:
61 MBadPixelsTreat(const char *name=NULL, const char *title=NULL);
62
63 void SetUseInterpolation(Bool_t b=kTRUE)
64 {
65 b ? SETBIT(fFlags, kUseInterpolation) : CLRBIT(fFlags, kUseInterpolation);
66 }
67 void SetUseCentralPixel(Bool_t b=kTRUE)
68 {
69 b ? SETBIT(fFlags, kUseCentralPixel) : CLRBIT(fFlags, kUseCentralPixel);
70 }
71 void SetProcessPedestalRun(Bool_t b=kTRUE)
72 {
73 b ? SETBIT(fFlags, kProcessPedestalRun) : CLRBIT(fFlags, kProcessPedestalRun);
74 }
75 void SetProcessPedestalEvt(Bool_t b=kTRUE)
76 {
77 b ? SETBIT(fFlags, kProcessPedestalEvt) : CLRBIT(fFlags, kProcessPedestalEvt);
78 }
79 void SetProcessPedestal(Bool_t b=kTRUE)
80 {
81 SetProcessPedestalRun(!b);
82 SetProcessPedestalEvt(b);
83 }
84 void SetProcessTimes(Bool_t b=kTRUE)
85 {
86 b ? SETBIT(fFlags, kProcessTimes) : CLRBIT(fFlags, kProcessTimes);
87 }
88 void SetHardTreatment(Bool_t b=kTRUE)
89 {
90 b ? SETBIT(fFlags, kHardTreatment) : CLRBIT(fFlags, kHardTreatment);
91 }
92
93 Bool_t IsHardTreatment() const { return TESTBIT(fFlags, kHardTreatment); }
94 Bool_t IsProcessPedestalRun() const { return TESTBIT(fFlags, kProcessPedestalRun); }
95 Bool_t IsProcessPedestalEvt() const { return TESTBIT(fFlags, kProcessPedestalEvt); }
96 Bool_t IsProcessTimes() const { return TESTBIT(fFlags, kProcessTimes); }
97 Bool_t IsUseCentralPixel() const { return TESTBIT(fFlags, kUseCentralPixel); }
98 Bool_t IsUseInterpolation() const { return TESTBIT(fFlags, kUseInterpolation); }
99
100 void SetNumMinNeighbors(Byte_t num) { fNumMinNeighbors=num; }
101 void SetMaxArrivalTimeDiff(Float_t d) { fMaxArrivalTimeDiff=d; }
102 void SetNameSignalCam(const char *name="MSignalCam") { fNameSignalCam=name; }
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
Note: See TracBrowser for help on using the repository browser.