source: trunk/Mars/mcalib/MCalibrateData.h@ 13228

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