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

Last change on this file since 5856 was 5854, checked in by gaug, 20 years ago
*** empty log message ***
File size: 4.6 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;
36
37class MCalibrateData : public MTask
38{
39private:
40
41 MGeomCam *fGeomCam; //! Camera geometry container
42 MBadPixelsCam *fBadPixels; //! Bad Pixels information
43 MCalibrationChargeCam *fCalibrations; //! Calibration constants
44 MCalibrationQECam *fQEs; //! Quantum efficiencies
45 MExtractedSignalCam *fSignals; //! Integrated charge in FADCs counts
46 MCerPhotEvt *fCerPhotEvt; //! Cerenkov Photon Event used for calculation
47
48 UShort_t fCalibrationMode; // Flag defining the calibration mode (CalibrationMode_t)
49 Byte_t fPedestalFlag; // Flags defining to calibrate the pedestal each event or each run
50 Byte_t fSignalType; // Flag defining the signal type (kphot or kphe)
51
52 Float_t fRenormFactor; // Possible renormalization factor for signals (-> phes)
53
54 TList fNamesPedestal; // Names of input and output pedestal conatainer
55 TList fPedestalCams; //! List of pointers to input MPedestalCam
56 TList fPedPhotCams; //! List of pointers to corresponding output MPedPhotCam
57
58 MArrayF fCalibConsts; //! Array of calibration constants for each pixel, calculated only once!
59 MArrayF fCalibFFactors; //! Array of calibration F-Factors for each pixel, calculated only once!
60 MArrayF fHiLoConv; //! Array of calibration constants for each pixel, calculated only once!
61 MArrayF fHiLoConvErr; //! Array of calibration F-Factors for each pixel, calculated only once!
62
63 Int_t Calibrate(Bool_t data, Bool_t pedestal) const;
64
65 Int_t PreProcess(MParList *pList);
66 Bool_t ReInit(MParList *pList);
67 Int_t Process();
68 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
69 void StreamPrimitive(ofstream &out) const;
70
71public:
72
73 enum CalibrationMode_t
74 {
75 kSkip = 0,
76 kNone = 1,
77 kFlatCharge = 2,
78 kBlindPixel = 3,
79 kFfactor = 4,
80 kPinDiode = 5,
81 kCombined = 6,
82 kDummy = 7
83 };
84
85 static const CalibrationMode_t kDefault = kFfactor;
86
87 enum PedestalType_t
88 {
89 kNo = BIT(0),
90 kRun = BIT(1),
91 kEvent = BIT(2)
92 };
93
94 enum SignalType_t
95 {
96 kPhe,
97 kPhot
98 };
99
100 MCalibrateData(CalibrationMode_t calmode=kDefault,
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 void SetPedestalFlag(PedestalType_t i=kRun) { fPedestalFlag = i; }
108 Bool_t TestPedestalFlag(PedestalType_t i) const { return fPedestalFlag&i ? kTRUE : kFALSE; }
109
110 void SetCalibrationMode ( CalibrationMode_t calmode=kDefault ) { fCalibrationMode=calmode; }
111 void SetSignalType ( SignalType_t sigtype=kPhot ) { fSignalType =sigtype; }
112
113 Bool_t UpdateConversionFactors();
114
115 ClassDef(MCalibrateData, 1) // Task to calibrate FADC counts into Cherenkov photons
116};
117
118#endif /* MCalibrateData */
119
120
121
122
123
124
Note: See TracBrowser for help on using the repository browser.