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 | class MGeomCam;
|
---|
24 | class MBadPixelsCam;
|
---|
25 | class MPedestalCam;
|
---|
26 | class MCalibrationChargeCam;
|
---|
27 | class MCalibrationQECam;
|
---|
28 | class MExtractedSignalCam;
|
---|
29 |
|
---|
30 | class MPedPhotCam;
|
---|
31 | class MCerPhotEvt;
|
---|
32 |
|
---|
33 | class MCalibrateData : public MTask
|
---|
34 | {
|
---|
35 | private:
|
---|
36 |
|
---|
37 | static const TString fgNamePedADCRunContainer; //! "MPedestalCam"
|
---|
38 | static const TString fgNamePedADCEventContainer; //! "MPedestalCamFromData"
|
---|
39 | static const TString fgNamePedPhotRunContainer; //! "MPedPhotCam"
|
---|
40 | static const TString fgNamePedPhotEventContainer; //! "MPedPhotCamFromData"
|
---|
41 |
|
---|
42 | MGeomCam *fGeomCam; //! Camera geometry container
|
---|
43 | MPedestalCam *fPedestal; //! Pedestals/slice [ADC counts]
|
---|
44 | MPedestalCam *fPedestalFromData; //! Pedestals/slice [ADC counts]
|
---|
45 | MBadPixelsCam *fBadPixels; //! Bad Pixels information
|
---|
46 | MCalibrationChargeCam *fCalibrations; //! Calibration constants
|
---|
47 | MCalibrationQECam *fQEs; //! Quantum efficiencies
|
---|
48 | MExtractedSignalCam *fSignals; //! Integrated charge in FADCs counts
|
---|
49 |
|
---|
50 | MPedPhotCam *fPedPhot; // Pedestals/(used slices) [photons]
|
---|
51 | MPedPhotCam *fPedPhotFromData; // Pedestals/(used slices) [photons]
|
---|
52 | MCerPhotEvt *fCerPhotEvt; // Cerenkov Photon Event used for calculation
|
---|
53 |
|
---|
54 | UShort_t fCalibrationMode; // Flag defining the calibration mode (CalibrationMode_t)
|
---|
55 | Byte_t fPedestalFlag; // Flags defining to calibrate the pedestal each event or each run
|
---|
56 |
|
---|
57 | TString fNamePedADCRunContainer; // name of fPedestal
|
---|
58 | TString fNamePedADCEventContainer; // name of fPedestalFromData
|
---|
59 | TString fNamePedPhotRunContainer; // name of fPedPhot
|
---|
60 | TString fNamePedPhotEventContainer; // name of fPedPhotFromData
|
---|
61 |
|
---|
62 | Bool_t CalibratePedestal ( MPedestalCam *, MPedPhotCam * );
|
---|
63 |
|
---|
64 | Bool_t GetConversionFactor(UInt_t,
|
---|
65 | Float_t &, Float_t &, Float_t &,
|
---|
66 | Float_t &, Float_t &);
|
---|
67 |
|
---|
68 | Int_t PreProcess( MParList *pList );
|
---|
69 | Bool_t ReInit ( MParList *pList );
|
---|
70 | Int_t Process ( );
|
---|
71 |
|
---|
72 | void StreamPrimitive( ofstream &out ) const;
|
---|
73 |
|
---|
74 | public:
|
---|
75 |
|
---|
76 | enum CalibrationMode_t { kNone=0,kFlatCharge=1,
|
---|
77 | kBlindPixel=2,kFfactor=3,kPinDiode=4,kCombined=5, kDummy=6 };
|
---|
78 |
|
---|
79 | static const CalibrationMode_t kDefault = kFfactor;
|
---|
80 |
|
---|
81 | enum PedestalType_t {
|
---|
82 | kNo = BIT(0),
|
---|
83 | kRun = BIT(1),
|
---|
84 | kEvent = BIT(2)
|
---|
85 | };
|
---|
86 |
|
---|
87 | MCalibrateData( CalibrationMode_t calmode=kDefault,
|
---|
88 | const char *name=NULL, const char *title=NULL);
|
---|
89 |
|
---|
90 | void EnablePedestalType ( PedestalType_t i ) { fPedestalFlag |= i; }
|
---|
91 | void SetPedestalType ( PedestalType_t i=kRun ) { fPedestalFlag = i; }
|
---|
92 | Bool_t TestFlag ( PedestalType_t i ) const { return fPedestalFlag & i; }
|
---|
93 |
|
---|
94 | void SetCalibrationMode ( CalibrationMode_t calmode=kDefault ) { fCalibrationMode=calmode; }
|
---|
95 |
|
---|
96 | void SetNamePedADCRunContainer ( const char *name=fgNamePedADCRunContainer ) {
|
---|
97 | fNamePedADCRunContainer = name; }
|
---|
98 | void SetNamePedADCEventContainer ( const char *name=fgNamePedADCEventContainer ) {
|
---|
99 | fNamePedADCEventContainer = name; }
|
---|
100 | void SetNamePedPhotRunContainer ( const char *name=fgNamePedPhotRunContainer ) {
|
---|
101 | fNamePedPhotRunContainer = name; }
|
---|
102 | void SetNamePedPhotEventContainer( const char *name=fgNamePedPhotEventContainer) {
|
---|
103 | fNamePedPhotEventContainer = name; }
|
---|
104 |
|
---|
105 | ClassDef(MCalibrateData, 0) // Task to calibrate FADC counts into Cherenkov photons
|
---|
106 | };
|
---|
107 |
|
---|
108 | #endif /* MCalibrateData */
|
---|
109 |
|
---|
110 |
|
---|
111 |
|
---|
112 |
|
---|
113 |
|
---|
114 |
|
---|