1 | #ifndef MARS_MCalibrateData
|
---|
2 | #define MARS_MCalibrateData
|
---|
3 |
|
---|
4 | #ifndef MARS_MTask
|
---|
5 | #include "MTask.h"
|
---|
6 | #endif
|
---|
7 |
|
---|
8 | #ifndef MARS_MArrayF
|
---|
9 | #include "MArrayF.h"
|
---|
10 | #endif
|
---|
11 |
|
---|
12 | class MGeomCam;
|
---|
13 | class MBadPixelsCam;
|
---|
14 | class MPedestalCam;
|
---|
15 | class MPedPhotCam;
|
---|
16 | class MSignalCam;
|
---|
17 | class MCalibConstCam;
|
---|
18 | class MExtractedSignalCam;
|
---|
19 |
|
---|
20 | class MCalibrationChargeCam;
|
---|
21 | class MCalibrationQECam;
|
---|
22 |
|
---|
23 | class MCalibrationIntensityChargeCam;
|
---|
24 | class MCalibrationIntensityQECam;
|
---|
25 | class MCalibrationIntensityConstCam;
|
---|
26 |
|
---|
27 | class MCalibrateData : public MTask
|
---|
28 | {
|
---|
29 | public:
|
---|
30 | enum CalibrationMode_t
|
---|
31 | {
|
---|
32 | kSkip = 0,
|
---|
33 | kNone = 1,
|
---|
34 | kFlatCharge = 2,
|
---|
35 | kBlindPixel = 3,
|
---|
36 | kFfactor = 4,
|
---|
37 | kPinDiode = 5,
|
---|
38 | kCombined = 6,
|
---|
39 | kDummy = 7
|
---|
40 | };
|
---|
41 |
|
---|
42 | enum PedestalType_t
|
---|
43 | {
|
---|
44 | kNo = BIT(0),
|
---|
45 | kRun = BIT(1),
|
---|
46 | kEvent = BIT(2)
|
---|
47 | };
|
---|
48 |
|
---|
49 | enum SignalType_t
|
---|
50 | {
|
---|
51 | kPhe,
|
---|
52 | kPhot
|
---|
53 | };
|
---|
54 |
|
---|
55 | static const CalibrationMode_t gkDefault;
|
---|
56 |
|
---|
57 | private:
|
---|
58 | static const Float_t gkCalibConvMinLimit; //! Minimum limit for conv. factor
|
---|
59 | static const Float_t gkCalibConvMaxLimit; //! Maximum limit for conv. factor
|
---|
60 |
|
---|
61 | Float_t fCalibConvMinLimit; // Minimum limit for conv. factor
|
---|
62 | Float_t fCalibConvMaxLimit; // Maximum limit for conv. factor
|
---|
63 |
|
---|
64 | MGeomCam *fGeomCam; //! Camera geometry container
|
---|
65 | MBadPixelsCam *fBadPixels; //! Bad Pixels information
|
---|
66 | MCalibrationChargeCam *fCalibrations; //! Calibration constants
|
---|
67 | MCalibrationIntensityChargeCam *fIntensCalib; //! Calibration constants from interlaced calib.
|
---|
68 | MCalibrationQECam *fQEs; //! Quantum efficiencies
|
---|
69 | MCalibrationIntensityQECam *fIntensQE; //! Quantum efficiencies from interlaced calib.
|
---|
70 | MExtractedSignalCam *fSignals; //! Integrated charge in FADCs counts
|
---|
71 | MSignalCam *fCerPhotEvt; //! Cerenkov Photon Event used for calculation
|
---|
72 | MCalibConstCam *fCalibConstCam; //! Temporary calib consts storage
|
---|
73 | MCalibrationIntensityConstCam *fIntensConst; //! Temporary calib consts storage
|
---|
74 |
|
---|
75 | CalibrationMode_t fCalibrationMode; // Flag defining the calibration mode (CalibrationMode_t)
|
---|
76 | Byte_t fPedestalFlag; // Flags defining to calibrate the pedestal each event or each run
|
---|
77 | Byte_t fSignalType; // Flag defining the signal type (kphot or kphe)
|
---|
78 |
|
---|
79 | Float_t fRenormFactor; // Possible renormalization factor for signals (-> phes)
|
---|
80 | Float_t fScaleFactor; // Possible scale factor for signals
|
---|
81 |
|
---|
82 | TList fNamesPedestal; // Names of input and output pedestal conatainer
|
---|
83 | TList fPedestalCams; //! List of pointers to input MPedestalCam
|
---|
84 | TList fPedPhotCams; //! List of pointers to corresponding output MPedPhotCam
|
---|
85 |
|
---|
86 | MArrayF fCalibConsts; //! Array of calibration constants for each pixel, calculated only once!
|
---|
87 | MArrayF fCalibFFactors; //! Array of calibration F-Factors for each pixel, calculated only once!
|
---|
88 | MArrayF fHiLoConv; //! Array of calibration constants for each pixel, calculated only once!
|
---|
89 | MArrayF fHiLoConvErr; //! Array of calibration F-Factors for each pixel, calculated only once!
|
---|
90 |
|
---|
91 | Int_t Calibrate(Bool_t data, Bool_t pedestal) const;
|
---|
92 |
|
---|
93 | Int_t PreProcess(MParList *pList);
|
---|
94 | Bool_t ReInit(MParList *pList);
|
---|
95 | Int_t Process();
|
---|
96 | Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
|
---|
97 | void StreamPrimitive(ofstream &out) const;
|
---|
98 |
|
---|
99 | public:
|
---|
100 | MCalibrateData(CalibrationMode_t calmode=gkDefault,
|
---|
101 | const char *name=NULL, const char *title=NULL);
|
---|
102 |
|
---|
103 | void AddPedestal(const char *name="Cam");
|
---|
104 | void AddPedestal(const char *pedestal, const char *pedphot);
|
---|
105 |
|
---|
106 | void EnablePedestalType(PedestalType_t i) { fPedestalFlag |= i; }
|
---|
107 |
|
---|
108 | Int_t GetSize() const { return fCalibConsts.GetSize(); }
|
---|
109 |
|
---|
110 | void Print(Option_t *o="") const;
|
---|
111 |
|
---|
112 | void SetPedestalFlag(PedestalType_t i=kRun) { fPedestalFlag = i; }
|
---|
113 | Bool_t TestPedestalFlag(PedestalType_t i) const { return fPedestalFlag&i ? kTRUE : kFALSE; }
|
---|
114 |
|
---|
115 | void SetCalibrationMode ( CalibrationMode_t calmode=gkDefault) { fCalibrationMode=calmode; }
|
---|
116 | void SetSignalType ( SignalType_t sigtype=kPhe ) { fSignalType =sigtype; }
|
---|
117 |
|
---|
118 | void SetCalibConvMinLimit( const Float_t f=gkCalibConvMinLimit ) { fCalibConvMinLimit = f; }
|
---|
119 | void SetCalibConvMaxLimit( const Float_t f=gkCalibConvMaxLimit ) { fCalibConvMaxLimit = f; }
|
---|
120 |
|
---|
121 | void SetScaleFactor(const Float_t f=1) { fScaleFactor=1; }
|
---|
122 |
|
---|
123 | Bool_t UpdateConversionFactors( const MCalibrationChargeCam *updatecam=NULL);
|
---|
124 |
|
---|
125 | ClassDef(MCalibrateData, 1) // Task to calibrate FADC counts into photons or photo-electrons
|
---|
126 | };
|
---|
127 |
|
---|
128 | #endif /* MCalibrateData */
|
---|