1 | #ifndef MARS_MJCalibration
|
---|
2 | #define MARS_MJCalibration
|
---|
3 |
|
---|
4 | #ifndef MARS_MJob
|
---|
5 | #include "MJob.h"
|
---|
6 | #endif
|
---|
7 | #ifndef MARS_MCalibrationIntensityChargeCam
|
---|
8 | #include "MCalibrationIntensityChargeCam.h"
|
---|
9 | #endif
|
---|
10 | #ifndef MARS_MCalibrationChargeCam
|
---|
11 | #include "MCalibrationChargeCam.h"
|
---|
12 | #endif
|
---|
13 | #ifndef MARS_MCalibrationIntensityBlindCam
|
---|
14 | #include "MCalibrationIntensityBlindCam.h"
|
---|
15 | #endif
|
---|
16 | #ifndef MARS_MCalibrationBlindCam
|
---|
17 | #include "MCalibrationBlindCam.h"
|
---|
18 | #endif
|
---|
19 | #ifndef MARS_MCalibrationChargePINDiode
|
---|
20 | #include "MCalibrationChargePINDiode.h"
|
---|
21 | #endif
|
---|
22 | #ifndef MARS_MCalibrationIntensityRelTimeCam
|
---|
23 | #include "MCalibrationIntensityRelTimeCam.h"
|
---|
24 | #endif
|
---|
25 | #ifndef MARS_MCalibrationRelTimeCam
|
---|
26 | #include "MCalibrationRelTimeCam.h"
|
---|
27 | #endif
|
---|
28 | #ifndef MARS_MCalibrationIntensityQECam
|
---|
29 | #include "MCalibrationIntensityQECam.h"
|
---|
30 | #endif
|
---|
31 | #ifndef MARS_MCalibrationQECam
|
---|
32 | #include "MCalibrationQECam.h"
|
---|
33 | #endif
|
---|
34 | #ifndef MARS_MBadPixelsIntensityCam
|
---|
35 | #include "MBadPixelsIntensityCam.h"
|
---|
36 | #endif
|
---|
37 | #ifndef MARS_MBadPixelsCam
|
---|
38 | #include "MBadPixelsCam.h"
|
---|
39 | #endif
|
---|
40 | #ifndef MARS_MPedestalCam
|
---|
41 | #include "MPedestalCam.h"
|
---|
42 | #endif
|
---|
43 |
|
---|
44 | class TH1D;
|
---|
45 |
|
---|
46 | class MTask;
|
---|
47 | class MRunIter;
|
---|
48 | class MParList;
|
---|
49 | class MPedestalCam;
|
---|
50 | class MExtractor;
|
---|
51 | class MExtractTime;
|
---|
52 | class MEvtLoop;
|
---|
53 | class MExtractBlindPixel;
|
---|
54 | class MHCalibrationChargeBlindCam;
|
---|
55 | class MHCamera;
|
---|
56 |
|
---|
57 | class MJCalibration : public MJob
|
---|
58 | {
|
---|
59 | private:
|
---|
60 |
|
---|
61 | static const Int_t gkIFAEBoxInaugurationRun; //! Run number of first IFAE box calibration
|
---|
62 | static const Int_t gkSecondBlindPixelInstallation; //! Run number upon which second blind pixel was installed
|
---|
63 | static const Int_t gkSpecialPixelsContInstallation; //! Run number upon which third blind pixel was installed
|
---|
64 | static const Int_t gkThirdBlindPixelInstallation; //! Run number upon which third blind pixel was installed
|
---|
65 |
|
---|
66 | static const TString fgReferenceFile; //! default for fReferenceFile ("mjobs/calibrationref.rc")
|
---|
67 |
|
---|
68 | Double_t fConvFADC2PheMin; //! Histogram minimum for conversion factor to phes
|
---|
69 | Double_t fConvFADC2PheMax; //! Histogram maximum for conversion factor to phes
|
---|
70 | Double_t fConvFADC2PhotMin; //! Histogram minimum for conversion factor to phs
|
---|
71 | Double_t fConvFADC2PhotMax; //! Histogram maixmum for conversion factor to phs
|
---|
72 | Double_t fQEMin; //! Histogram minimum for quantum efficiency
|
---|
73 | Double_t fQEMax; //! Histogram maximum for quantum efficiency
|
---|
74 | Double_t fArrivalTimeMin; //! Histogram minimum for arrival times
|
---|
75 | Double_t fArrivalTimeMax; //! Histogram maximum for arrival times
|
---|
76 |
|
---|
77 | Float_t fRefConvFADC2PheInner; //! Reference value for the conversion factor to phes - inner
|
---|
78 | Float_t fRefConvFADC2PheOuter; //! Reference value for the conversion factor to phes - outer
|
---|
79 | Float_t fRefConvFADC2PhotInner; //! Reference value for the conversion factor to phs - inner
|
---|
80 | Float_t fRefConvFADC2PhotOuter; //! Reference value for the conversion factor to phs - outer
|
---|
81 | Float_t fRefQEInner; //! Reference value for the quantum eff. cascades - inner
|
---|
82 | Float_t fRefQEOuter; //! Reference value for the quantum eff. cascades - outer
|
---|
83 | Float_t fRefArrivalTimeInner; //! Reference value for the arrival time - inner
|
---|
84 | Float_t fRefArrivalTimeOuter; //! Reference value for the arrival time - outer
|
---|
85 | Float_t fRefArrivalTimeRmsInner; //! Reference value for the arrival time - inner
|
---|
86 | Float_t fRefArrivalTimeRmsOuter; //! Reference value for the arrival time - outer
|
---|
87 | Float_t fRefTimeOffsetInner; //! Reference value for the time offset - inner
|
---|
88 | Float_t fRefTimeOffsetOuter; //! Reference value for the time offset - outer
|
---|
89 | Float_t fRefTimeResolutionInner; //! Reference value for the time resolution - inner
|
---|
90 | Float_t fRefTimeResolutionOuter; //! Reference value for the time resolution - outer
|
---|
91 |
|
---|
92 | TString fReferenceFile; // File name containing the reference values
|
---|
93 |
|
---|
94 | MRunIter *fRuns; // Calibration files
|
---|
95 |
|
---|
96 | MExtractor *fExtractor; // Signal extractor
|
---|
97 | MExtractTime *fTimeExtractor; // Arrival Time extractor
|
---|
98 |
|
---|
99 | MBadPixelsIntensityCam fIntensBadCam; // Bad Pixels cam, can be set from previous runs
|
---|
100 | MBadPixelsCam fBadPixels; // Bad Pixels cam, can be set from previous runs
|
---|
101 | MCalibrationIntensityChargeCam fIntensCalibCam; // Calibration conversion factors FADC2Phe for diff. intens.
|
---|
102 | MCalibrationChargeCam fCalibrationCam; // Calibration conversion factors FADC2Phe
|
---|
103 | MCalibrationIntensityBlindCam fIntensBlindCam; // Calibration from Blind Pixel(s)
|
---|
104 | MCalibrationBlindCam fCalibrationBlindCam; // Calibration from Blind Pixel(s)
|
---|
105 | MCalibrationChargePINDiode fCalibrationPINDiode; // Calibration from PIN Diode
|
---|
106 | MCalibrationIntensityQECam fIntensQECam; // Quantum efficiency for diff. intensities,
|
---|
107 | MCalibrationQECam fQECam; // Quantum efficiency, can be set from previous runs
|
---|
108 | MCalibrationIntensityRelTimeCam fIntensRelTimeCam; // Calibration constants rel. times for diff. intensities
|
---|
109 | MCalibrationRelTimeCam fRelTimeCam; // Calibration constants rel. times
|
---|
110 |
|
---|
111 | MPedestalCam fExtractorCam; // Pedestal Cam with extractor resolution
|
---|
112 |
|
---|
113 | MCalibrationCam::PulserColor_t fColor; // Colour of the pulsed LEDs
|
---|
114 |
|
---|
115 | enum Display_t // Possible Display types
|
---|
116 | {
|
---|
117 | kFullDisplay,
|
---|
118 | kDataCheckDisplay,
|
---|
119 | kNormalDisplay
|
---|
120 | };
|
---|
121 |
|
---|
122 | Display_t fDisplayType; // Chosen Display type
|
---|
123 |
|
---|
124 | enum Device_t // Possible devices for calibration
|
---|
125 | {
|
---|
126 | kUseBlindPixel,
|
---|
127 | kUsePINDiode
|
---|
128 | };
|
---|
129 |
|
---|
130 | Byte_t fDevices; // Bit-field for used devices for calibration
|
---|
131 |
|
---|
132 | enum Storage_t // Possible devices for calibration
|
---|
133 | {
|
---|
134 | kNoStorage,
|
---|
135 | kHistsStorage
|
---|
136 | }; // Possible flags for the storage of results
|
---|
137 |
|
---|
138 | Byte_t fStorage; // Bit-field for chosen storage type
|
---|
139 |
|
---|
140 | enum { kRelTimes, kDataCheck, kDebug, kIntensity }; // Possible flags
|
---|
141 |
|
---|
142 | Byte_t fFlags; // Bit-field for the flags
|
---|
143 |
|
---|
144 | TString fGeometry; // Class name geometry
|
---|
145 |
|
---|
146 | Bool_t IsUseBlindPixel() const { return TESTBIT(fDevices,kUseBlindPixel); }
|
---|
147 | Bool_t IsUsePINDiode () const { return TESTBIT(fDevices,kUsePINDiode); }
|
---|
148 |
|
---|
149 | Bool_t IsRelTimes () const { return TESTBIT(fFlags,kRelTimes); }
|
---|
150 | Bool_t IsDataCheck () const { return TESTBIT(fFlags,kDataCheck); }
|
---|
151 | Bool_t IsDebug () const { return TESTBIT(fFlags,kDebug); }
|
---|
152 | Bool_t IsIntensity () const { return TESTBIT(fFlags,kIntensity); }
|
---|
153 |
|
---|
154 | Bool_t IsNoStorage () const { return TESTBIT(fStorage,kNoStorage); }
|
---|
155 | Bool_t IsHistsStorage () const { return TESTBIT(fStorage,kHistsStorage); }
|
---|
156 |
|
---|
157 | void DrawTab(MParList &plist, const char *cont, const char *name, Option_t *opt);
|
---|
158 |
|
---|
159 | void DisplayResult ( MParList &plist );
|
---|
160 | void DisplayReferenceLines( MHCamera *cam , const Int_t what ) const;
|
---|
161 | void DisplayOutliers ( TH1D *hist, const char* whatsmall, const char* whatbig ) const;
|
---|
162 | void DisplayDoubleProject ( MHCamera *cam , const char* whatsmall, const char* whatbig ) const;
|
---|
163 | const Int_t CountBadPixels ( MHCamera *cam , const Int_t what ) const;
|
---|
164 | void FixDataCheckHist ( TH1D *hist ) const;
|
---|
165 |
|
---|
166 | Bool_t WriteResult (MParList &plist);
|
---|
167 | //Bool_t WriteEventloop( MEvtLoop &evtloop ) const;
|
---|
168 | Bool_t WriteTasks ( MTask *t1, MTask *t2) const;
|
---|
169 | Bool_t CheckEnvLocal ();
|
---|
170 |
|
---|
171 | // WORKAROUNDS!!!
|
---|
172 | void InitBlindPixel(MExtractBlindPixel &blindext,
|
---|
173 | MHCalibrationChargeBlindCam &blindcam);
|
---|
174 |
|
---|
175 | const char* GetOutputFileName() const;
|
---|
176 |
|
---|
177 | public:
|
---|
178 | MJCalibration(const char *name=NULL, const char *title=NULL);
|
---|
179 |
|
---|
180 | const char* GetOutputFile() const;
|
---|
181 |
|
---|
182 | MCalibrationIntensityChargeCam &GetIntensCalibrationCam() { return fIntensCalibCam; }
|
---|
183 | MCalibrationIntensityRelTimeCam &GetIntensRelTimeCam() { return fIntensRelTimeCam; }
|
---|
184 | MCalibrationIntensityQECam &GetIntensQECam() { return fIntensQECam; }
|
---|
185 | MBadPixelsIntensityCam &GetIntensBadCam() { return fIntensBadCam; }
|
---|
186 |
|
---|
187 | MCalibrationChargeCam &GetCalibrationCam() { return fCalibrationCam; }
|
---|
188 | MCalibrationRelTimeCam &GetRelTimeCam() { return fRelTimeCam; }
|
---|
189 | MCalibrationQECam &GetQECam() { return fQECam; }
|
---|
190 | MBadPixelsCam &GetBadPixels() { return fBadPixels; }
|
---|
191 |
|
---|
192 | // Containers and pointers
|
---|
193 | void SetBadPixels ( const MBadPixelsCam &bad) { bad.Copy(fBadPixels); }
|
---|
194 | void SetColor ( const MCalibrationCam::PulserColor_t color) { fColor = color; }
|
---|
195 | void SetExtractor ( MExtractor* ext) { fExtractor = ext; }
|
---|
196 | void SetExtractorCam ( const MPedestalCam &ped) { ped.Copy(fExtractorCam); fExtractorCam.SetName(ped.GetName()); }
|
---|
197 | void SetInput ( MRunIter *iter) { fRuns = iter; }
|
---|
198 | void SetQECam ( const MCalibrationQECam &qe) { qe.Copy(fQECam); }
|
---|
199 | void SetTimeExtractor( MExtractTime* ext) { fTimeExtractor = ext; }
|
---|
200 |
|
---|
201 | // Displays
|
---|
202 | void SetFullDisplay() { fDisplayType = kFullDisplay; }
|
---|
203 | void SetDataCheckDisplay() { fDisplayType = kDataCheckDisplay; }
|
---|
204 | void SetNormalDisplay() { fDisplayType = kNormalDisplay; }
|
---|
205 |
|
---|
206 | // Camera Geomtry
|
---|
207 | void SetGeometry(const char *geom) { fGeometry = geom; }
|
---|
208 |
|
---|
209 | // Flags
|
---|
210 | void SetRelTimeCalibration( const Bool_t b=kTRUE ) { b ? SETBIT(fFlags,kRelTimes) : CLRBIT(fFlags,kRelTimes); }
|
---|
211 | void SetDataCheck ( const Bool_t b=kTRUE ) { b ? SetDataCheckDisplay(), SETBIT(fFlags,kDataCheck)
|
---|
212 | : CLRBIT(fFlags,kDataCheck); }
|
---|
213 | void SetDebug ( const Bool_t b=kTRUE ) { b ? SETBIT(fFlags,kDebug) : CLRBIT(fFlags,kDebug); }
|
---|
214 | void SetIntensity ( const Bool_t b=kTRUE ) { b ? SETBIT(fFlags,kIntensity) : CLRBIT(fFlags,kIntensity); }
|
---|
215 |
|
---|
216 | // Devices
|
---|
217 | void SetUseBlindPixel(const Bool_t b=kTRUE);
|
---|
218 | void SetUsePINDiode(const Bool_t b=kTRUE);
|
---|
219 |
|
---|
220 | // Storage
|
---|
221 | void SetNoStorage ( const Bool_t b=kTRUE ) { b ? SETBIT(fStorage,kNoStorage) : CLRBIT(fStorage,kNoStorage); }
|
---|
222 | void SetHistsStorage ( const Bool_t b=kTRUE ) { b ? SETBIT(fStorage,kHistsStorage) : CLRBIT(fStorage,kHistsStorage); }
|
---|
223 |
|
---|
224 | void SetReferenceFile( const TString ref=fgReferenceFile ) { fReferenceFile = ref; }
|
---|
225 |
|
---|
226 | // Precessing
|
---|
227 | Bool_t ReadCalibrationCam();
|
---|
228 | Bool_t ProcessFile(MPedestalCam &pedcam);
|
---|
229 | Bool_t Process(MPedestalCam &pedcam);
|
---|
230 |
|
---|
231 | ClassDef(MJCalibration, 0) // Tool to run a calibration per pulser colour and intensity
|
---|
232 | };
|
---|
233 |
|
---|
234 | #endif
|
---|