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

Last change on this file since 5023 was 4752, checked in by tbretz, 20 years ago
*** empty log message ***
File size: 4.1 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
23class MGeomCam;
24class MBadPixelsCam;
25class MPedestalCam;
26class MCalibrationChargeCam;
27class MCalibrationQECam;
28class MExtractedSignalCam;
29
30class MPedPhotCam;
31class MCerPhotEvt;
32
33class MCalibrateData : public MTask
34{
35private:
36 static const TString fgNamePedADCContainer; //! "MPedestalCam"
37 static const TString fgNamePedPhotContainer; //! "MPedPhotCam"
38
39 MGeomCam *fGeomCam; //! Camera geometry container
40 MPedestalCam *fPedestal; //! Pedestals/slice [ADC counts]
41 MBadPixelsCam *fBadPixels; //! Bad Pixels information
42 MCalibrationChargeCam *fCalibrations; //! Calibration constants
43 MCalibrationQECam *fQEs; //! Quantum efficiencies
44 MExtractedSignalCam *fSignals; //! Integrated charge in FADCs counts
45
46 MPedPhotCam *fPedPhot; //! Pedestals/(used slices) [photons]
47 MCerPhotEvt *fCerPhotEvt; //! Cerenkov Photon Event used for calculation
48
49 UShort_t fCalibrationMode; // Flag defining the calibration mode (CalibrationMode_t)
50 Byte_t fPedestalFlag; // Flags defining to calibrate the pedestal each event or each run
51
52 TString fNamePedADCContainer; // name of fPedestal
53 TString fNamePedPhotContainer; // name of fPedPhot
54
55 void Calibrate(Bool_t data, Bool_t pedestal) const;
56
57 Bool_t GetConversionFactor(UInt_t, Float_t &, Float_t &, Float_t &, Float_t &, Float_t &) const;
58
59 Int_t PreProcess(MParList *pList);
60 Bool_t ReInit(MParList *pList);
61 Int_t Process();
62 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
63 void StreamPrimitive(ofstream &out) const;
64
65public:
66
67 enum CalibrationMode_t
68 {
69 kSkip = 0,
70 kNone = 1,
71 kFlatCharge = 2,
72 kBlindPixel = 3,
73 kFfactor = 4,
74 kPinDiode = 5,
75 kCombined = 6,
76 kDummy = 7
77 };
78
79 static const CalibrationMode_t kDefault = kFfactor;
80
81 enum PedestalType_t
82 {
83 kNo = BIT(0),
84 kRun = BIT(1),
85 kEvent = BIT(2)
86 };
87
88 MCalibrateData(CalibrationMode_t calmode=kDefault,
89 const char *name=NULL, const char *title=NULL);
90
91 void EnablePedestalType(PedestalType_t i) { fPedestalFlag |= i; }
92 void SetPedestalFlag(PedestalType_t i=kRun) { fPedestalFlag = i; }
93 Bool_t TestPedestalFlag(PedestalType_t i) const { return fPedestalFlag & i; }
94
95 void SetCalibrationMode ( CalibrationMode_t calmode=kDefault ) { fCalibrationMode=calmode; }
96
97 void SetNamePedADCContainer(const char *name=fgNamePedADCContainer.Data())
98 {
99 fNamePedADCContainer = name;
100 }
101 void SetNamePedPhotContainer(const char *name=fgNamePedPhotContainer.Data())
102 {
103 fNamePedPhotContainer = name;
104 }
105
106 ClassDef(MCalibrateData, 0) // Task to calibrate FADC counts into Cherenkov photons
107};
108
109#endif /* MCalibrateData */
110
111
112
113
114
115
Note: See TracBrowser for help on using the repository browser.