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 | // MPedestalCam *fPedestalExt; //! Input container for calibrated pedestal
|
---|
75 | // MPedestalCam *fPedestalRndm; //! Input container for calibrated pedestal
|
---|
76 | // MPedPhotCam *fPedPhotCam; //! Output container for calibrated pedestal
|
---|
77 |
|
---|
78 | CalibrationMode_t fCalibrationMode; // Flag defining the calibration mode (CalibrationMode_t)
|
---|
79 | Byte_t fPedestalFlag; // Flags defining to calibrate the pedestal each event or each run
|
---|
80 | Byte_t fSignalType; // Flag defining the signal type (kphot or kphe)
|
---|
81 |
|
---|
82 | Float_t fRenormFactor; // Possible renormalization factor for signals (-> phes)
|
---|
83 | Float_t fScaleFactor; // Possible scale factor for signals
|
---|
84 |
|
---|
85 | TString fFileNameScale; // File name for list of scale factors
|
---|
86 |
|
---|
87 | TList fNamesPedestal; // Names of input and output pedestal conatainer
|
---|
88 | TList fPedestalCams; //! List of pointers to input MPedestalCam
|
---|
89 | TList fPedPhotCams; //! List of pointers to corresponding output MPedPhotCam
|
---|
90 |
|
---|
91 | MArrayF fCalibConsts; //! Array of calibration constants for each pixel, calculated only once!
|
---|
92 | MArrayF fCalibFFactors; //! Array of calibration F-Factors for each pixel, calculated only once!
|
---|
93 | MArrayF fHiLoConv; //! Array of calibration constants for each pixel, calculated only once!
|
---|
94 | MArrayF fHiLoConvErr; //! Array of calibration F-Factors for each pixel, calculated only once!
|
---|
95 |
|
---|
96 | Int_t Calibrate(Bool_t data, Bool_t pedestal) const;
|
---|
97 |
|
---|
98 | Int_t PreProcess(MParList *pList);
|
---|
99 | Bool_t ReInit(MParList *pList);
|
---|
100 | Int_t Process();
|
---|
101 | Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
|
---|
102 | void StreamPrimitive(ostream &out) const;
|
---|
103 |
|
---|
104 | public:
|
---|
105 | MCalibrateData(CalibrationMode_t calmode=gkDefault,
|
---|
106 | const char *name=NULL, const char *title=NULL);
|
---|
107 |
|
---|
108 | void AddPedestal(const char *name="Cam");
|
---|
109 | void AddPedestal(const char *pedestal, const char *pedphot);
|
---|
110 |
|
---|
111 | void EnablePedestalType(PedestalType_t i) { fPedestalFlag |= i; }
|
---|
112 |
|
---|
113 | //Int_t GetSize() const { return fCalibConsts.GetSize(); }
|
---|
114 |
|
---|
115 | void Print(Option_t *o="") const;
|
---|
116 |
|
---|
117 | void SetPedestalFlag(PedestalType_t i=kRun) { fPedestalFlag = i; }
|
---|
118 | Bool_t TestPedestalFlag(PedestalType_t i) const { return fPedestalFlag&i ? kTRUE : kFALSE; }
|
---|
119 |
|
---|
120 | void SetCalibrationMode ( CalibrationMode_t calmode=gkDefault) { fCalibrationMode=calmode; }
|
---|
121 | void SetSignalType ( SignalType_t sigtype=kPhe ) { fSignalType =sigtype; }
|
---|
122 |
|
---|
123 | void SetCalibConvMinLimit( const Float_t f=gkCalibConvMinLimit ) { fCalibConvMinLimit = f; }
|
---|
124 | void SetCalibConvMaxLimit( const Float_t f=gkCalibConvMaxLimit ) { fCalibConvMaxLimit = f; }
|
---|
125 |
|
---|
126 | void SetScaleFactor(const Float_t f=1) { fScaleFactor=1; }
|
---|
127 |
|
---|
128 | Bool_t UpdateConversionFactors( const MCalibrationChargeCam *updatecam=NULL);
|
---|
129 |
|
---|
130 | ClassDef(MCalibrateData, 1) // Task to calibrate FADC counts into photons or photo-electrons
|
---|
131 | };
|
---|
132 |
|
---|
133 | #endif /* MCalibrateData */
|
---|