source: trunk/MagicSoft/Mars/mbadpixels/MBadPixelsTreat.h@ 7753

Last change on this file since 7753 was 7733, checked in by tbretz, 19 years ago
*** empty log message ***
File size: 3.5 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; //!
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 void StreamPrimitive(ofstream &out) const;
57
58public:
59 MBadPixelsTreat(const char *name=NULL, const char *title=NULL);
60
61 void SetUseInterpolation(Bool_t b=kTRUE)
62 {
63 b ? SETBIT(fFlags, kUseInterpolation) : CLRBIT(fFlags, kUseInterpolation);
64 }
65 void SetUseCentralPixel(Bool_t b=kTRUE)
66 {
67 b ? SETBIT(fFlags, kUseCentralPixel) : CLRBIT(fFlags, kUseCentralPixel);
68 }
69 void SetProcessPedestalRun(Bool_t b=kTRUE)
70 {
71 b ? SETBIT(fFlags, kProcessPedestalRun) : CLRBIT(fFlags, kProcessPedestalRun);
72 }
73 void SetProcessPedestalEvt(Bool_t b=kTRUE)
74 {
75 b ? SETBIT(fFlags, kProcessPedestalEvt) : CLRBIT(fFlags, kProcessPedestalEvt);
76 }
77 void SetProcessPedestal(Bool_t b=kTRUE)
78 {
79 SetProcessPedestalRun(!b);
80 SetProcessPedestalEvt(b);
81 }
82 void SetProcessTimes(Bool_t b=kTRUE)
83 {
84 b ? SETBIT(fFlags, kProcessTimes) : CLRBIT(fFlags, kProcessTimes);
85 }
86 void SetHardTreatment(Bool_t b=kTRUE)
87 {
88 b ? SETBIT(fFlags, kHardTreatment) : CLRBIT(fFlags, kHardTreatment);
89 }
90
91 Bool_t IsHardTreatment() const { return TESTBIT(fFlags, kHardTreatment); }
92 Bool_t IsProcessPedestalRun() const { return TESTBIT(fFlags, kProcessPedestalRun); }
93 Bool_t IsProcessPedestalEvt() const { return TESTBIT(fFlags, kProcessPedestalEvt); }
94 Bool_t IsProcessTimes() const { return TESTBIT(fFlags, kProcessTimes); }
95 Bool_t IsUseCentralPixel() const { return TESTBIT(fFlags, kUseCentralPixel); }
96 Bool_t IsUseInterpolation() const { return TESTBIT(fFlags, kUseInterpolation); }
97
98 void SetNumMinNeighbors(Byte_t num) { fNumMinNeighbors=num; }
99 void SetMaxArrivalTimeDiff(Float_t d) { fMaxArrivalTimeDiff=d; }
100 void AddNamePedPhotCam(const char *name="MPedPhotCam");
101 void SetNamePedPhotCam(const char *name)
102 {
103 AddNamePedPhotCam(name);
104 } // Deprecated! Use AddNamePedPhotCam instead (directly)
105
106 ClassDef(MBadPixelsTreat, 1) // Task to treat bad pixels (interpolation, unmapping)
107};
108
109#endif
110
Note: See TracBrowser for help on using the repository browser.