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

Last change on this file since 8417 was 8408, checked in by tbretz, 18 years ago
*** empty log message ***
File size: 4.8 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;
25
26class MCalibrateData : public MTask
27{
28public:
29 enum CalibrationMode_t
30 {
31 kSkip = 0,
32 kNone = 1,
33 kFlatCharge = 2,
34 kBlindPixel = 3,
35 kFfactor = 4,
36 kPinDiode = 5,
37 kCombined = 6,
38 kDummy = 7
39 };
40
41 enum PedestalType_t
42 {
43 kNo = BIT(0),
44 kRun = BIT(1),
45 kEvent = BIT(2)
46 };
47
48 enum SignalType_t
49 {
50 kPhe,
51 kPhot
52 };
53
54 static const CalibrationMode_t gkDefault;
55
56private:
57 static const Float_t gkCalibConvMinLimit; //! Minimum limit for conv. factor
58 static const Float_t gkCalibConvMaxLimit; //! Maximum limit for conv. factor
59
60 Float_t fCalibConvMinLimit; // Minimum limit for conv. factor
61 Float_t fCalibConvMaxLimit; // Maximum limit for conv. factor
62
63 MGeomCam *fGeomCam; //! Camera geometry container
64 MBadPixelsCam *fBadPixels; //! Bad Pixels information
65 MCalibrationChargeCam *fCalibrations; //! Calibration constants
66 MCalibrationIntensityChargeCam *fIntensCalib; //! Calibration constants from interlaced calib.
67 MCalibrationQECam *fQEs; //! Quantum efficiencies
68 MCalibrationIntensityQECam *fIntensQE; //! Quantum efficiencies from interlaced calib.
69 MExtractedSignalCam *fSignals; //! Integrated charge in FADCs counts
70 MSignalCam *fCerPhotEvt; //! Cerenkov Photon Event used for calculation
71 MCalibConstCam *fCalibConstCam; //! Temporary calib consts storage
72
73 CalibrationMode_t fCalibrationMode; // Flag defining the calibration mode (CalibrationMode_t)
74 Byte_t fPedestalFlag; // Flags defining to calibrate the pedestal each event or each run
75 Byte_t fSignalType; // Flag defining the signal type (kphot or kphe)
76
77 Float_t fRenormFactor; // Possible renormalization factor for signals (-> phes)
78 Float_t fScaleFactor; // Possible scale factor for signals
79
80 TString fFileNameScale; // File name for list of scale factors
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(ostream &out) const;
98
99public:
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 */
Note: See TracBrowser for help on using the repository browser.