source: trunk/MagicSoft/Mars/mcalib/MCalibrateData.h@ 7804

Last change on this file since 7804 was 7804, checked in by tbretz, 18 years ago
*** empty log message ***
File size: 4.9 KB
Line 
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
12class MGeomCam;
13class MBadPixelsCam;
14class MPedestalCam;
15class MPedPhotCam;
16class MSignalCam;
17class MCalibConstCam;
18class MExtractedSignalCam;
19
20class MCalibrationChargeCam;
21class MCalibrationQECam;
22
23class MCalibrationIntensityChargeCam;
24class MCalibrationIntensityQECam;
25class MCalibrationIntensityConstCam;
26
27class MCalibrateData : public MTask
28{
29public:
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
57private:
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 TString fFileNameScale; // File name for list of scale factors
83
84 TList fNamesPedestal; // Names of input and output pedestal conatainer
85 TList fPedestalCams; //! List of pointers to input MPedestalCam
86 TList fPedPhotCams; //! List of pointers to corresponding output MPedPhotCam
87
88 MArrayF fCalibConsts; //! Array of calibration constants for each pixel, calculated only once!
89 MArrayF fCalibFFactors; //! Array of calibration F-Factors for each pixel, calculated only once!
90 MArrayF fHiLoConv; //! Array of calibration constants for each pixel, calculated only once!
91 MArrayF fHiLoConvErr; //! Array of calibration F-Factors for each pixel, calculated only once!
92
93 Int_t Calibrate(Bool_t data, Bool_t pedestal) const;
94
95 Int_t PreProcess(MParList *pList);
96 Bool_t ReInit(MParList *pList);
97 Int_t Process();
98 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
99 void StreamPrimitive(ostream &out) const;
100
101public:
102 MCalibrateData(CalibrationMode_t calmode=gkDefault,
103 const char *name=NULL, const char *title=NULL);
104
105 void AddPedestal(const char *name="Cam");
106 void AddPedestal(const char *pedestal, const char *pedphot);
107
108 void EnablePedestalType(PedestalType_t i) { fPedestalFlag |= i; }
109
110 //Int_t GetSize() const { return fCalibConsts.GetSize(); }
111
112 void Print(Option_t *o="") const;
113
114 void SetPedestalFlag(PedestalType_t i=kRun) { fPedestalFlag = i; }
115 Bool_t TestPedestalFlag(PedestalType_t i) const { return fPedestalFlag&i ? kTRUE : kFALSE; }
116
117 void SetCalibrationMode ( CalibrationMode_t calmode=gkDefault) { fCalibrationMode=calmode; }
118 void SetSignalType ( SignalType_t sigtype=kPhe ) { fSignalType =sigtype; }
119
120 void SetCalibConvMinLimit( const Float_t f=gkCalibConvMinLimit ) { fCalibConvMinLimit = f; }
121 void SetCalibConvMaxLimit( const Float_t f=gkCalibConvMaxLimit ) { fCalibConvMaxLimit = f; }
122
123 void SetScaleFactor(const Float_t f=1) { fScaleFactor=1; }
124
125 Bool_t UpdateConversionFactors( const MCalibrationChargeCam *updatecam=NULL);
126
127 ClassDef(MCalibrateData, 1) // Task to calibrate FADC counts into photons or photo-electrons
128};
129
130#endif /* MCalibrateData */
Note: See TracBrowser for help on using the repository browser.