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

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