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

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