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

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