1 | /* ======================================================================== *\
|
---|
2 | !
|
---|
3 | ! *
|
---|
4 | ! * This file is part of MARS, the MAGIC Analysis and Reconstruction
|
---|
5 | ! * Software. It is distributed to you in the hope that it can be a useful
|
---|
6 | ! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
|
---|
7 | ! * It is distributed WITHOUT ANY WARRANTY.
|
---|
8 | ! *
|
---|
9 | ! * Permission to use, copy, modify and distribute this software and its
|
---|
10 | ! * documentation for any purpose is hereby granted without fee,
|
---|
11 | ! * provided that the above copyright notice appear in all copies and
|
---|
12 | ! * that both that copyright notice and this permission notice appear
|
---|
13 | ! * in supporting documentation. It is provided "as is" without express
|
---|
14 | ! * or implied warranty.
|
---|
15 | ! *
|
---|
16 | !
|
---|
17 | !
|
---|
18 | ! Author(s): Markus Gaug 02/2004 <mailto:markus@ifae.es>
|
---|
19 | !
|
---|
20 | ! Copyright: MAGIC Software Development, 2000-2004
|
---|
21 | !
|
---|
22 | !
|
---|
23 | \* ======================================================================== */
|
---|
24 |
|
---|
25 | /////////////////////////////////////////////////////////////////////////////
|
---|
26 | //
|
---|
27 | // MCalibrationQEPix
|
---|
28 | //
|
---|
29 | // Storage container of the calibrated Quantrum Efficiency of one pixel.
|
---|
30 | // This container (like MCalibrationQECam) is designed to persist during
|
---|
31 | // several eventloops over different calibration files, especially those
|
---|
32 | // with different colour LEDs. This class contains all measured Quantum
|
---|
33 | // Efficiencies with the calibration system for each individual pixel.
|
---|
34 | //
|
---|
35 | // At the moment, this calibration works in the following steps:
|
---|
36 | //
|
---|
37 | // 1) MHCalibrationChargeCam extracts mean and sigma (and its errors) of
|
---|
38 | // the summed FADC slices distribution and stores them in MCalibrationCam
|
---|
39 | //
|
---|
40 | // 2) MHCalibrationChargeBlindPix extracts the mean of a Poisson fit to the
|
---|
41 | // single photo-electron spectrum and stores it in MCalibrationChargeBlindPix
|
---|
42 | //
|
---|
43 | // 3) MHCalibrationChargePINDiode extracts the mean of a charge distribution
|
---|
44 | // of the signals collected by the PIN Diode and stores it in
|
---|
45 | // MCalibrationChargePINDiode
|
---|
46 | //
|
---|
47 | // 4) MCalibrationChargeCalc calculates for every pixel the number of
|
---|
48 | // photo-electrons with the F-Factor method and stores them in MCalibrationChargePix
|
---|
49 | //
|
---|
50 | // 5) MCalibrationChargeCalc calculates the (weighted) average number of photo-
|
---|
51 | // electrons from the pixels with the area index 0 (Inner pixels for the MAGIC
|
---|
52 | // camera) and divides this number by gkDefaultQEGreen, gkDefaultQEBlue,
|
---|
53 | // gkDefaultQEUV or gkDefaultQECT1, depending on the used pulser LED colour,
|
---|
54 | // and further by MCalibrationQECam::gkPlexiglassQE. The obtained number is then
|
---|
55 | // divided further by MGeomCam::GetPixRatio(pixel idx) (1. for inner pixels) and
|
---|
56 | // gives the NUMBER OF PHOTONS incident on every pixel light guide OUTSIDE THE PLEXIGLASS
|
---|
57 | // of the camera, obtained with the F-Factor method. (In the case of the MAGIC camera,
|
---|
58 | // this number is thus BY CONSTRUCTION four times bigger for the outer pixels than for
|
---|
59 | // the inner ones.)
|
---|
60 | //
|
---|
61 | // 6) MCalibrationChargeCalc calculates the mean photon flux per mm^2 in the camera
|
---|
62 | // from the MCalibrationChargeBlindPix and multiplies it with the light guides area
|
---|
63 | // of each pixel (MGeomPix::GetA()) and divides it by the quantum efficiency of the
|
---|
64 | // plexi-glass (MCalibrationQECam::gkPlexiglassQE). The obtained number gives the
|
---|
65 | // NUMBER OF PHOTONS incident on every pixel light guide OUTSIDE THE PLEXIGLASS of the camera,
|
---|
66 | // obtained with the Blind Pixel method.
|
---|
67 | //
|
---|
68 | // 7) MCalibrationChargeCalc calculates the mean photon flux per mm^2 in the camera
|
---|
69 | // from the MCalibrationChargePINDiode and multiplies it with the light guides area
|
---|
70 | // of each pixel (MGeomPix::GetA()). The obtained number gives the NUMBER OF PHOTONS
|
---|
71 | // incident on every pixels light guid OUTSIDE THE PLEXIGLASS of the camera,
|
---|
72 | // obtained with the PIN Diode method.
|
---|
73 | //
|
---|
74 | // 8) Each of the three photons numbers is divided by the mean sum of FADC counts
|
---|
75 | // and defined as MEASURED QUANTUM EFFICIENCY AT A GIVEN COLOUR. They are stored
|
---|
76 | // in the variables SetQEBlindPixel(qe, color), SetQEFFactor(qe,color) and
|
---|
77 | // SetQEPINDiode(qe,color)
|
---|
78 | //
|
---|
79 | // 9) Errors are propagated and corresponding variances get stored in
|
---|
80 | // SetQEBlindPixelVar(var,color), SetQEFFactorVar(var,color) and
|
---|
81 | // SetQEPINDiodeVar(var,color).
|
---|
82 | //
|
---|
83 | // 10) After every eventloop, MCalibrationChargeCalc calls the functions UpdateBlindPixelMethod(),
|
---|
84 | // UpdateFFactorMethod() and UpdatePINDiodeMethod() which calculate the ratio
|
---|
85 | // measured QE / gkDefaultQEGreen (or gkDefaultQEBlue or gkDefaultQEUV or gkDefaultQECT1)
|
---|
86 | // and calculates an weighted average of these quantum-efficiency normalizations obtained
|
---|
87 | // by one of the three methods.
|
---|
88 | //
|
---|
89 | // 11) A call to GetQECascadesBlindPixel(zenith), GetQECascadesFFactor(zenith) or
|
---|
90 | // GetQECascadesPINDiode(zenith) returns then the normalization multiplied with an average QE
|
---|
91 | // folded into a cascades spectrum. This number should be dependent on zenith angle, but
|
---|
92 | // this feature is not yet implemented, instead a fixed number gkDefaultAverageQE is used.
|
---|
93 | //
|
---|
94 | // The number gkDefaultAverageQE = 0.18 +- 0.02 can be obtained in the following way:
|
---|
95 | //
|
---|
96 | // * Transmission probability Plexiglass: 0.96
|
---|
97 | //
|
---|
98 | // * Averaged QE coated PMTs: zenith value
|
---|
99 | // 0. 0.237
|
---|
100 | // 20. 0.237
|
---|
101 | // 40. 0.236
|
---|
102 | // 60. 0.234
|
---|
103 | // (from D.Paneque et al., NIM A 504, 2003, 109-115
|
---|
104 | //
|
---|
105 | // * PMT photoelectron collection efficiency: 0.9
|
---|
106 | // (from D.Paneque, email 14.2.2004)
|
---|
107 | //
|
---|
108 | // * Light guides efficiency: 0.94
|
---|
109 | // (from D.Paneque, email 14.2.2004)
|
---|
110 | //
|
---|
111 | // "Concerning the light guides effiency estimation... Daniel Ferenc
|
---|
112 | // is preparing some work (simulations) to estimate it. Yet so far, he has
|
---|
113 | // been busy with other stuff, and this work is still UNfinished.
|
---|
114 | //
|
---|
115 | // The estimation I did comes from:
|
---|
116 | // 1) Reflectivity of light guide walls is 85 % (aluminum)
|
---|
117 | // 2) At ZERO degree light incidence, 37% of the light hits such walls
|
---|
118 | // (0.15X37%= 5.6% of light lost)
|
---|
119 | // 3) When increasing the light incidence angle, more and more light hits
|
---|
120 | // the walls.
|
---|
121 | //
|
---|
122 | // However, the loses due to larger amount of photons hitting the walls is more
|
---|
123 | // or less counteracted by the fact that more and more photon trajectories cross
|
---|
124 | // the PMT photocathode twice, increasing the effective sensitivity of the PMT.
|
---|
125 | //
|
---|
126 | // Jurgen Gebauer did some quick measurements about this issue. I attach a
|
---|
127 | // plot. You can see that the angular dependence is (more or less) in agreement
|
---|
128 | // with a CosTheta function (below 20-25 degrees),
|
---|
129 | // which is the variation of teh entrance window cross section. So, in
|
---|
130 | // first approximation, no loses when increasing light incidence angle;
|
---|
131 | // and therefore, the factor 0.94."
|
---|
132 | //
|
---|
133 | // See also: MJCalibration, MCalibrationChargeCalc,
|
---|
134 | // MCalibrationChargeCam, MCalibrationChargePix,
|
---|
135 | // MHCalibrationChargeCam, MHCalibrationChargePix,
|
---|
136 | // MHCalibrationChargePINDiode, MHCalibrationChargeBlindPix
|
---|
137 | //
|
---|
138 | /////////////////////////////////////////////////////////////////////////////
|
---|
139 | #include "MCalibrationQEPix.h"
|
---|
140 | #include "MCalibrationCam.h"
|
---|
141 |
|
---|
142 | #include "MLog.h"
|
---|
143 | #include "MLogManip.h"
|
---|
144 |
|
---|
145 | #include "TArrayF.h"
|
---|
146 | #include "TArrayC.h"
|
---|
147 |
|
---|
148 | ClassImp(MCalibrationQEPix);
|
---|
149 |
|
---|
150 | using namespace std;
|
---|
151 |
|
---|
152 | const Float_t MCalibrationQEPix::gkDefaultQEGreen = 0.192;
|
---|
153 | const Float_t MCalibrationQEPix::gkDefaultQEBlue = 0.27;
|
---|
154 | const Float_t MCalibrationQEPix::gkDefaultQEUV = 0.285;
|
---|
155 | const Float_t MCalibrationQEPix::gkDefaultQECT1 = 0.285;
|
---|
156 | const Float_t MCalibrationQEPix::gkDefaultQEGreenErr = 0.05 ;
|
---|
157 | const Float_t MCalibrationQEPix::gkDefaultQEBlueErr = 0.07 ;
|
---|
158 | const Float_t MCalibrationQEPix::gkDefaultQEUVErr = 0.07 ;
|
---|
159 | const Float_t MCalibrationQEPix::gkDefaultQECT1Err = 0.07 ;
|
---|
160 | const Float_t MCalibrationQEPix::gkDefaultAverageQE = 0.18;
|
---|
161 | const Float_t MCalibrationQEPix::gkDefaultAverageQEErr = 0.02;
|
---|
162 | // --------------------------------------------------------------------------
|
---|
163 | //
|
---|
164 | // Default Constructor:
|
---|
165 | //
|
---|
166 | // Initializes all TArrays to MCalibrationCam::gkNumPulserColors
|
---|
167 | //
|
---|
168 | // Calls:
|
---|
169 | // - Clear()
|
---|
170 | //
|
---|
171 | MCalibrationQEPix::MCalibrationQEPix(const char *name, const char *title)
|
---|
172 | : fQEBlindPixel ( MCalibrationCam::gkNumPulserColors),
|
---|
173 | fQEBlindPixelVar ( MCalibrationCam::gkNumPulserColors ),
|
---|
174 | fQECombined ( MCalibrationCam::gkNumPulserColors ),
|
---|
175 | fQECombinedVar ( MCalibrationCam::gkNumPulserColors ),
|
---|
176 | fQEFFactor ( MCalibrationCam::gkNumPulserColors ),
|
---|
177 | fQEFFactorVar ( MCalibrationCam::gkNumPulserColors ),
|
---|
178 | fQEPINDiode ( MCalibrationCam::gkNumPulserColors ),
|
---|
179 | fQEPINDiodeVar ( MCalibrationCam::gkNumPulserColors ),
|
---|
180 | fAverageQE ( gkDefaultAverageQE ),
|
---|
181 | fValidFlags ( MCalibrationCam::gkNumPulserColors )
|
---|
182 | {
|
---|
183 |
|
---|
184 | fName = name ? name : "MCalibrationQEPix";
|
---|
185 | fTitle = title ? title : "Container of the calibrated quantum efficiency ";
|
---|
186 |
|
---|
187 | Clear();
|
---|
188 |
|
---|
189 | }
|
---|
190 |
|
---|
191 | // ----------------------------------------------------------------------------------------------
|
---|
192 | //
|
---|
193 | // Search all available QE's of a certain colour after the blind pixel method,
|
---|
194 | // compare them to the default QE of that colour and
|
---|
195 | // add up a weighted average (wav) and a sum of weights (sumw)
|
---|
196 | //
|
---|
197 | // FIXME: This has to be replaced by a decent fit the QE-spectrum!
|
---|
198 | //
|
---|
199 | void MCalibrationQEPix::AddAverageBlindPixelQEs(const MCalibrationCam::PulserColor_t col, Float_t &wav, Float_t &sumw )
|
---|
200 | {
|
---|
201 |
|
---|
202 | if (IsBlindPixelMethodValid (col))
|
---|
203 | {
|
---|
204 | const Float_t newavqe = GetQEBlindPixel(col) / GetDefaultQE (col) ;
|
---|
205 | const Float_t newavqevar = ( GetQEBlindPixelRelVar(col) + GetDefaultQERelVar(col) ) * newavqe * newavqe;
|
---|
206 | wav += newavqe / newavqevar;
|
---|
207 | sumw += 1. / newavqevar ;
|
---|
208 | }
|
---|
209 | }
|
---|
210 |
|
---|
211 | // ----------------------------------------------------------------------------------------------
|
---|
212 | //
|
---|
213 | // Search all available QE's of a certain colour after the combination of the three methods
|
---|
214 | // compare them to the default QE of that colour and
|
---|
215 | // add up a weighted average (wav) and a sum of weights (sumw)
|
---|
216 | //
|
---|
217 | // FIXME: This has to be replaced by a decent fit the QE-spectrum!
|
---|
218 | //
|
---|
219 | void MCalibrationQEPix::AddAverageCombinedQEs(const MCalibrationCam::PulserColor_t col, Float_t &wav, Float_t &sumw )
|
---|
220 | {
|
---|
221 |
|
---|
222 | if (IsCombinedMethodValid (col))
|
---|
223 | {
|
---|
224 | const Float_t newavqe = GetQECombined(col) / GetDefaultQE (col) ;
|
---|
225 | const Float_t newavqevar = ( GetQECombinedRelVar(col) + GetDefaultQERelVar(col) ) * newavqe * newavqe;
|
---|
226 | wav += newavqe / newavqevar;
|
---|
227 | sumw += 1./ newavqevar;
|
---|
228 |
|
---|
229 | }
|
---|
230 | }
|
---|
231 |
|
---|
232 | // ----------------------------------------------------------------------------------------------
|
---|
233 | //
|
---|
234 | // Search all available QE's of a certain colour after the F-Factor method,
|
---|
235 | // compare them to the default QE of that colour and
|
---|
236 | // add up a weighted average (wav) and a sum of weights (sumw)
|
---|
237 | //
|
---|
238 | // FIXME: This has to be replaced by a decent fit the QE-spectrum!
|
---|
239 | //
|
---|
240 | void MCalibrationQEPix::AddAverageFFactorQEs(const MCalibrationCam::PulserColor_t col, Float_t &wav, Float_t &sumw )
|
---|
241 | {
|
---|
242 |
|
---|
243 | if (IsFFactorMethodValid (col))
|
---|
244 | {
|
---|
245 | const Float_t newavqe = GetQEFFactor(col) / GetDefaultQE (col) ;
|
---|
246 | const Float_t newavqevar = ( GetQEFFactorRelVar(col) + GetDefaultQERelVar(col) ) * newavqe * newavqe;
|
---|
247 | wav += newavqe / newavqevar;
|
---|
248 | sumw += 1./ newavqevar;
|
---|
249 |
|
---|
250 | }
|
---|
251 |
|
---|
252 |
|
---|
253 | }
|
---|
254 |
|
---|
255 | // ----------------------------------------------------------------------------------------------
|
---|
256 | //
|
---|
257 | // Search all available QE's of a certain colour after the PIN Diode method,
|
---|
258 | // compare them to the default QE of that colour and
|
---|
259 | // add up a weighted average (wav) and a sum of weights (sumw)
|
---|
260 | //
|
---|
261 | // FIXME: This has to be replaced by a decent fit the QE-spectrum!
|
---|
262 | //
|
---|
263 | void MCalibrationQEPix::AddAveragePINDiodeQEs(const MCalibrationCam::PulserColor_t col, Float_t &wav, Float_t &sumw )
|
---|
264 | {
|
---|
265 |
|
---|
266 | if (IsPINDiodeMethodValid (col))
|
---|
267 | {
|
---|
268 | const Float_t newavqe = GetQEPINDiode(col) / GetDefaultQE (col) ;
|
---|
269 | const Float_t newavqevar = ( GetQEPINDiodeRelVar(col) + GetDefaultQERelVar(col) ) * newavqe * newavqe;
|
---|
270 | wav += newavqe / newavqevar;
|
---|
271 | sumw += 1./ newavqevar;
|
---|
272 | }
|
---|
273 | }
|
---|
274 |
|
---|
275 |
|
---|
276 |
|
---|
277 | // ------------------------------------------------------------------------
|
---|
278 | //
|
---|
279 | // Sets all quantum efficiencies to the gkDefaultQE*
|
---|
280 | // Sets all Variances to the square root of gkDefaultQE*Err
|
---|
281 | // Sets all flags to kFALSE
|
---|
282 | // Sets all fAvNorm-Variables to 1.;
|
---|
283 | // Sets all fAvNorm-Variances to 0.;
|
---|
284 | //
|
---|
285 | // Calls:
|
---|
286 | // - MCalibrationPix::Clear()
|
---|
287 | //
|
---|
288 | void MCalibrationQEPix::Clear(Option_t *o)
|
---|
289 | {
|
---|
290 |
|
---|
291 | SetAverageQEBlindPixelAvailable ( kFALSE );
|
---|
292 | SetAverageQEFFactorAvailable ( kFALSE );
|
---|
293 | SetAverageQECombinedAvailable ( kFALSE );
|
---|
294 | SetAverageQEPINDiodeAvailable ( kFALSE );
|
---|
295 |
|
---|
296 | fQEBlindPixel [ MCalibrationCam::kGREEN ] = gkDefaultQEGreen;
|
---|
297 | fQEBlindPixelVar [ MCalibrationCam::kGREEN ] = gkDefaultQEGreenErr*gkDefaultQEGreenErr;
|
---|
298 | fQEFFactor [ MCalibrationCam::kGREEN ] = gkDefaultQEGreen;
|
---|
299 | fQEFFactorVar [ MCalibrationCam::kGREEN ] = gkDefaultQEGreenErr*gkDefaultQEGreenErr;
|
---|
300 | fQECombined [ MCalibrationCam::kGREEN ] = gkDefaultQEGreen;
|
---|
301 | fQECombinedVar [ MCalibrationCam::kGREEN ] = gkDefaultQEGreenErr*gkDefaultQEGreenErr;
|
---|
302 | fQEPINDiode [ MCalibrationCam::kGREEN ] = gkDefaultQEGreen;
|
---|
303 | fQEPINDiodeVar [ MCalibrationCam::kGREEN ] = gkDefaultQEGreenErr*gkDefaultQEGreenErr;
|
---|
304 |
|
---|
305 | SetBlindPixelMethodValid ( kFALSE, MCalibrationCam::kGREEN);
|
---|
306 | SetFFactorMethodValid ( kFALSE, MCalibrationCam::kGREEN);
|
---|
307 | SetCombinedMethodValid ( kFALSE, MCalibrationCam::kGREEN);
|
---|
308 | SetPINDiodeMethodValid ( kFALSE, MCalibrationCam::kGREEN);
|
---|
309 |
|
---|
310 | fQEBlindPixel [ MCalibrationCam::kBLUE ] = gkDefaultQEBlue;
|
---|
311 | fQEBlindPixelVar [ MCalibrationCam::kBLUE ] = gkDefaultQEBlueErr*gkDefaultQEBlueErr;
|
---|
312 | fQEFFactor [ MCalibrationCam::kBLUE ] = gkDefaultQEBlue;
|
---|
313 | fQEFFactorVar [ MCalibrationCam::kBLUE ] = gkDefaultQEBlueErr*gkDefaultQEBlueErr;
|
---|
314 | fQECombined [ MCalibrationCam::kBLUE ] = gkDefaultQEBlue;
|
---|
315 | fQECombinedVar [ MCalibrationCam::kBLUE ] = gkDefaultQEBlueErr*gkDefaultQEBlueErr;
|
---|
316 | fQEPINDiode [ MCalibrationCam::kBLUE ] = gkDefaultQEBlue;
|
---|
317 | fQEPINDiodeVar [ MCalibrationCam::kBLUE ] = gkDefaultQEBlueErr*gkDefaultQEBlueErr;
|
---|
318 |
|
---|
319 | SetBlindPixelMethodValid ( kFALSE, MCalibrationCam::kBLUE);
|
---|
320 | SetFFactorMethodValid ( kFALSE, MCalibrationCam::kBLUE);
|
---|
321 | SetCombinedMethodValid ( kFALSE, MCalibrationCam::kBLUE);
|
---|
322 | SetPINDiodeMethodValid ( kFALSE, MCalibrationCam::kBLUE);
|
---|
323 |
|
---|
324 | fQEBlindPixel [ MCalibrationCam::kUV ] = gkDefaultQEUV;
|
---|
325 | fQEBlindPixelVar [ MCalibrationCam::kUV ] = gkDefaultQEUVErr*gkDefaultQEUVErr;
|
---|
326 | fQEFFactor [ MCalibrationCam::kUV ] = gkDefaultQEUV;
|
---|
327 | fQEFFactorVar [ MCalibrationCam::kUV ] = gkDefaultQEUVErr*gkDefaultQEUVErr;
|
---|
328 | fQECombined [ MCalibrationCam::kUV ] = gkDefaultQEUV;
|
---|
329 | fQECombinedVar [ MCalibrationCam::kUV ] = gkDefaultQEUVErr*gkDefaultQEUVErr;
|
---|
330 | fQEPINDiode [ MCalibrationCam::kUV ] = gkDefaultQEUV;
|
---|
331 | fQEPINDiodeVar [ MCalibrationCam::kUV ] = gkDefaultQEUVErr*gkDefaultQEUVErr;
|
---|
332 |
|
---|
333 | SetBlindPixelMethodValid ( kFALSE, MCalibrationCam::kUV);
|
---|
334 | SetFFactorMethodValid ( kFALSE, MCalibrationCam::kUV);
|
---|
335 | SetCombinedMethodValid ( kFALSE, MCalibrationCam::kUV);
|
---|
336 | SetPINDiodeMethodValid ( kFALSE, MCalibrationCam::kUV);
|
---|
337 |
|
---|
338 | fQEBlindPixel [ MCalibrationCam::kCT1 ] = gkDefaultQECT1;
|
---|
339 | fQEBlindPixelVar [ MCalibrationCam::kCT1 ] = gkDefaultQECT1Err*gkDefaultQECT1Err;
|
---|
340 | fQEFFactor [ MCalibrationCam::kCT1 ] = gkDefaultQECT1;
|
---|
341 | fQEFFactorVar [ MCalibrationCam::kCT1 ] = gkDefaultQECT1Err*gkDefaultQECT1Err;
|
---|
342 | fQECombined [ MCalibrationCam::kCT1 ] = gkDefaultQECT1;
|
---|
343 | fQECombinedVar [ MCalibrationCam::kCT1 ] = gkDefaultQECT1Err*gkDefaultQECT1Err;
|
---|
344 | fQEPINDiode [ MCalibrationCam::kCT1 ] = gkDefaultQECT1;
|
---|
345 | fQEPINDiodeVar [ MCalibrationCam::kCT1 ] = gkDefaultQECT1Err*gkDefaultQECT1Err;
|
---|
346 |
|
---|
347 | SetBlindPixelMethodValid ( kFALSE, MCalibrationCam::kCT1);
|
---|
348 | SetFFactorMethodValid ( kFALSE, MCalibrationCam::kCT1);
|
---|
349 | SetCombinedMethodValid ( kFALSE, MCalibrationCam::kCT1);
|
---|
350 | SetPINDiodeMethodValid ( kFALSE, MCalibrationCam::kCT1);
|
---|
351 |
|
---|
352 | fAvNormBlindPixel = 1.;
|
---|
353 | fAvNormBlindPixelVar = 0.;
|
---|
354 | fAvNormCombined = 1.;
|
---|
355 | fAvNormCombinedVar = 0.;
|
---|
356 | fAvNormFFactor = 1.;
|
---|
357 | fAvNormFFactorVar = 0.;
|
---|
358 | fAvNormPINDiode = 1.;
|
---|
359 | fAvNormPINDiodeVar = 0.;
|
---|
360 |
|
---|
361 | MCalibrationPix::Clear();
|
---|
362 | }
|
---|
363 |
|
---|
364 |
|
---|
365 | // -----------------------------------------------------------------
|
---|
366 | //
|
---|
367 | // Return the average Default QE (depending on zenith angle)
|
---|
368 | //
|
---|
369 | const Float_t MCalibrationQEPix::GetAverageQE( const Float_t zenith ) const
|
---|
370 | {
|
---|
371 | // return gkDefaultAverageQE ;
|
---|
372 | return fAverageQE;
|
---|
373 | }
|
---|
374 |
|
---|
375 | // -----------------------------------------------------------------
|
---|
376 | //
|
---|
377 | // Return the relative variance of the average Default QE (depending on zenith angle)
|
---|
378 | //
|
---|
379 | const Float_t MCalibrationQEPix::GetAverageQERelVar( const Float_t zenith ) const
|
---|
380 | {
|
---|
381 | return gkDefaultAverageQEErr * gkDefaultAverageQEErr / (gkDefaultAverageQE * gkDefaultAverageQE );
|
---|
382 | }
|
---|
383 |
|
---|
384 | // -----------------------------------------------------------------
|
---|
385 | //
|
---|
386 | // Return the relative variance of the average normalization (Blind Pixel Method)
|
---|
387 | //
|
---|
388 | const Float_t MCalibrationQEPix::GetAvNormBlindPixelRelVar( ) const
|
---|
389 | {
|
---|
390 | return fAvNormBlindPixelVar / (fAvNormBlindPixel * fAvNormBlindPixel );
|
---|
391 | }
|
---|
392 |
|
---|
393 | // -----------------------------------------------------------------
|
---|
394 | //
|
---|
395 | // Return the relative variance of the average normalization (Combined Method)
|
---|
396 | //
|
---|
397 | const Float_t MCalibrationQEPix::GetAvNormCombinedRelVar( ) const
|
---|
398 | {
|
---|
399 | return fAvNormCombinedVar / (fAvNormCombined * fAvNormCombined );
|
---|
400 | }
|
---|
401 |
|
---|
402 | // -----------------------------------------------------------------
|
---|
403 | //
|
---|
404 | // Return the relative variance of the average normalization (F-Factor Method)
|
---|
405 | //
|
---|
406 | const Float_t MCalibrationQEPix::GetAvNormFFactorRelVar( ) const
|
---|
407 | {
|
---|
408 | return fAvNormFFactorVar / (fAvNormFFactor * fAvNormFFactor );
|
---|
409 | }
|
---|
410 |
|
---|
411 | // -----------------------------------------------------------------
|
---|
412 | //
|
---|
413 | // Return the relative variance of the average normalization (PIN Diode Method)
|
---|
414 | //
|
---|
415 | const Float_t MCalibrationQEPix::GetAvNormPINDiodeRelVar( ) const
|
---|
416 | {
|
---|
417 | return fAvNormPINDiodeVar / (fAvNormPINDiode * fAvNormPINDiode );
|
---|
418 | }
|
---|
419 |
|
---|
420 | // ------------------------------------------------------------------------------
|
---|
421 | //
|
---|
422 | // Get the default Quantum efficiency for pulser colour "col"
|
---|
423 | //
|
---|
424 | Float_t MCalibrationQEPix::GetDefaultQE( const MCalibrationCam::PulserColor_t col ) const
|
---|
425 | {
|
---|
426 | switch (col)
|
---|
427 | {
|
---|
428 | case MCalibrationCam::kGREEN:
|
---|
429 | return gkDefaultQEGreen;
|
---|
430 | break;
|
---|
431 | case MCalibrationCam::kBLUE:
|
---|
432 | return gkDefaultQEBlue;
|
---|
433 | break;
|
---|
434 | case MCalibrationCam::kUV:
|
---|
435 | return gkDefaultQEUV;
|
---|
436 | break;
|
---|
437 | case MCalibrationCam::kCT1:
|
---|
438 | return gkDefaultQECT1;
|
---|
439 | break;
|
---|
440 | default:
|
---|
441 | return gkDefaultQECT1;
|
---|
442 | break;
|
---|
443 | }
|
---|
444 | return -1.;
|
---|
445 | }
|
---|
446 |
|
---|
447 | // ------------------------------------------------------------------------------
|
---|
448 | //
|
---|
449 | // Get the relative variance of the default Quantum efficiency for pulser colour "col"
|
---|
450 | //
|
---|
451 | Float_t MCalibrationQEPix::GetDefaultQERelVar( const MCalibrationCam::PulserColor_t col ) const
|
---|
452 | {
|
---|
453 | switch (col)
|
---|
454 | {
|
---|
455 | case MCalibrationCam::kGREEN:
|
---|
456 | return gkDefaultQEGreenErr * gkDefaultQEGreenErr / (gkDefaultQEGreen * gkDefaultQEGreen );
|
---|
457 | break;
|
---|
458 | case MCalibrationCam::kBLUE:
|
---|
459 | return gkDefaultQEBlueErr * gkDefaultQEBlueErr / (gkDefaultQEBlue * gkDefaultQEBlue );
|
---|
460 | break;
|
---|
461 | case MCalibrationCam::kUV:
|
---|
462 | return gkDefaultQEUVErr * gkDefaultQEUVErr / (gkDefaultQEUV * gkDefaultQEUV );
|
---|
463 | break;
|
---|
464 | case MCalibrationCam::kCT1:
|
---|
465 | return gkDefaultQECT1Err * gkDefaultQECT1Err / (gkDefaultQECT1 * gkDefaultQECT1 );
|
---|
466 | break;
|
---|
467 | default:
|
---|
468 | return gkDefaultQECT1Err * gkDefaultQECT1Err / (gkDefaultQECT1 * gkDefaultQECT1 );
|
---|
469 | break;
|
---|
470 | }
|
---|
471 | return -1.;
|
---|
472 | }
|
---|
473 |
|
---|
474 | // ------------------------------------------------------------------------------
|
---|
475 | //
|
---|
476 | // Get the calculated Quantum efficiency with the blind pixel method,
|
---|
477 | // obtained with pulser colour "col"
|
---|
478 | //
|
---|
479 | Float_t MCalibrationQEPix::GetQEBlindPixel( const MCalibrationCam::PulserColor_t col ) const
|
---|
480 | {
|
---|
481 | return fQEBlindPixel[col];
|
---|
482 | }
|
---|
483 |
|
---|
484 | // ------------------------------------------------------------------------------
|
---|
485 | //
|
---|
486 | // Get the error on the calculated Quantum efficiency with the blind pixel method,
|
---|
487 | // obtained with pulser colour "col"
|
---|
488 | // Tests for variances smaller than 0. (e.g. if it has not yet been set)
|
---|
489 | // and returns -1. in that case
|
---|
490 | //
|
---|
491 | Float_t MCalibrationQEPix::GetQEBlindPixelErr( const MCalibrationCam::PulserColor_t col ) const
|
---|
492 | {
|
---|
493 |
|
---|
494 | if (fQEBlindPixelVar[col] < 0.)
|
---|
495 | return -1.;
|
---|
496 |
|
---|
497 | return TMath::Sqrt(fQEBlindPixelVar[col]);
|
---|
498 |
|
---|
499 | }
|
---|
500 |
|
---|
501 | // ------------------------------------------------------------------------------
|
---|
502 | //
|
---|
503 | // Get the relative variance of the calculated Quantum efficiency with the blind pixel method,
|
---|
504 | // obtained with pulser colour "col"
|
---|
505 | // Tests for variances smaller than 0. (e.g. if it has not yet been set)
|
---|
506 | // and returns -1. in that case
|
---|
507 | // Tests for quantum efficiency equal to 0. and returns -1. in that case
|
---|
508 | //
|
---|
509 | Float_t MCalibrationQEPix::GetQEBlindPixelRelVar( const MCalibrationCam::PulserColor_t col ) const
|
---|
510 | {
|
---|
511 |
|
---|
512 | if (fQEBlindPixelVar[col] < 0.)
|
---|
513 | return -1.;
|
---|
514 | if (fQEBlindPixel[col] < 0.)
|
---|
515 | return -1.;
|
---|
516 | return fQEBlindPixelVar[col] / ( fQEBlindPixel[col] * fQEBlindPixel[col] );
|
---|
517 |
|
---|
518 | }
|
---|
519 |
|
---|
520 | // ------------------------------------------------------------------------------
|
---|
521 | //
|
---|
522 | // Get the calculated Quantum efficiency with the combination of the three methods
|
---|
523 | // obtained with pulser colour "col"
|
---|
524 | //
|
---|
525 | Float_t MCalibrationQEPix::GetQECombined( const MCalibrationCam::PulserColor_t col ) const
|
---|
526 | {
|
---|
527 | return fQECombined[col];
|
---|
528 | }
|
---|
529 |
|
---|
530 |
|
---|
531 | // ------------------------------------------------------------------------------
|
---|
532 | //
|
---|
533 | // Get the error on the calculated Quantum efficiency with the combination of the three methods
|
---|
534 | // obtained with pulser colour "col"
|
---|
535 | // Tests for variances smaller than 0. (e.g. if it has not yet been set)
|
---|
536 | // and returns -1. in that case
|
---|
537 | //
|
---|
538 | Float_t MCalibrationQEPix::GetQECombinedErr( const MCalibrationCam::PulserColor_t col ) const
|
---|
539 | {
|
---|
540 |
|
---|
541 | if (fQECombinedVar[col] < 0.)
|
---|
542 | return -1.;
|
---|
543 |
|
---|
544 | return TMath::Sqrt(fQECombinedVar[col]);
|
---|
545 |
|
---|
546 | }
|
---|
547 |
|
---|
548 |
|
---|
549 | // ----------------------------------------------------------------------------------------
|
---|
550 | //
|
---|
551 | // Get the relative variance of the calculated Quantum efficiency with the combination of
|
---|
552 | // the three methods,
|
---|
553 | // obtained with pulser colour "col"
|
---|
554 | // Tests for variances smaller than 0. (e.g. if it has not yet been set)
|
---|
555 | // and returns -1. in that case
|
---|
556 | // Tests for quantum efficiency equal to 0. and returns -1. in that case
|
---|
557 | //
|
---|
558 | Float_t MCalibrationQEPix::GetQECombinedRelVar( const MCalibrationCam::PulserColor_t col ) const
|
---|
559 | {
|
---|
560 |
|
---|
561 | if (fQECombinedVar[col] < 0.)
|
---|
562 | return -1.;
|
---|
563 | if (fQECombined[col] < 0.)
|
---|
564 | return -1.;
|
---|
565 | return fQECombinedVar[col] / ( fQECombined[col] * fQECombined[col] );
|
---|
566 |
|
---|
567 | }
|
---|
568 |
|
---|
569 | // ------------------------------------------------------------------------------
|
---|
570 | //
|
---|
571 | // Get the calculated Quantum efficiency with the F-Factor method
|
---|
572 | // obtained with pulser colour "col"
|
---|
573 | //
|
---|
574 | Float_t MCalibrationQEPix::GetQEFFactor( const MCalibrationCam::PulserColor_t col ) const
|
---|
575 | {
|
---|
576 | return fQEFFactor[col];
|
---|
577 | }
|
---|
578 |
|
---|
579 |
|
---|
580 | // ------------------------------------------------------------------------------
|
---|
581 | //
|
---|
582 | // Get the error on the calculated Quantum efficiency with the F-Factor method,
|
---|
583 | // obtained with pulser colour "col"
|
---|
584 | // Tests for variances smaller than 0. (e.g. if it has not yet been set)
|
---|
585 | // and returns -1. in that case
|
---|
586 | //
|
---|
587 | Float_t MCalibrationQEPix::GetQEFFactorErr( const MCalibrationCam::PulserColor_t col ) const
|
---|
588 | {
|
---|
589 |
|
---|
590 | if (fQEFFactorVar[col] < 0.)
|
---|
591 | return -1.;
|
---|
592 |
|
---|
593 | return TMath::Sqrt(fQEFFactorVar[col]);
|
---|
594 |
|
---|
595 | }
|
---|
596 |
|
---|
597 |
|
---|
598 | // ----------------------------------------------------------------------------------------
|
---|
599 | //
|
---|
600 | // Get the relative variance of the calculated Quantum efficiency with the F-Factor method,
|
---|
601 | // obtained with pulser colour "col"
|
---|
602 | // Tests for variances smaller than 0. (e.g. if it has not yet been set)
|
---|
603 | // and returns -1. in that case
|
---|
604 | // Tests for quantum efficiency equal to 0. and returns -1. in that case
|
---|
605 | //
|
---|
606 | Float_t MCalibrationQEPix::GetQEFFactorRelVar( const MCalibrationCam::PulserColor_t col ) const
|
---|
607 | {
|
---|
608 |
|
---|
609 | if (fQEFFactorVar[col] < 0.)
|
---|
610 | return -1.;
|
---|
611 | if (fQEFFactor[col] < 0.)
|
---|
612 | return -1.;
|
---|
613 | return fQEFFactorVar[col] / ( fQEFFactor[col] * fQEFFactor[col] );
|
---|
614 |
|
---|
615 | }
|
---|
616 |
|
---|
617 | // ------------------------------------------------------------------------------
|
---|
618 | //
|
---|
619 | // Get the calculated Quantum efficiency with the PIN-Diode method
|
---|
620 | // obtained with pulser colour "col"
|
---|
621 | //
|
---|
622 | Float_t MCalibrationQEPix::GetQEPINDiode( const MCalibrationCam::PulserColor_t col ) const
|
---|
623 | {
|
---|
624 | return fQEPINDiode[col];
|
---|
625 | }
|
---|
626 |
|
---|
627 |
|
---|
628 | // ------------------------------------------------------------------------------
|
---|
629 | //
|
---|
630 | // Get the error on the calculated Quantum efficiency with the PIN Diode method,
|
---|
631 | // obtained with pulser colour "col"
|
---|
632 | // Tests for variances smaller than 0. (e.g. if it has not yet been set)
|
---|
633 | // and returns -1. in that case
|
---|
634 | //
|
---|
635 | Float_t MCalibrationQEPix::GetQEPINDiodeErr( const MCalibrationCam::PulserColor_t col ) const
|
---|
636 | {
|
---|
637 |
|
---|
638 | if (fQEPINDiodeVar[col] < 0.)
|
---|
639 | return -1.;
|
---|
640 |
|
---|
641 | return TMath::Sqrt(fQEPINDiodeVar[col]);
|
---|
642 |
|
---|
643 | }
|
---|
644 |
|
---|
645 | // ----------------------------------------------------------------------------------------
|
---|
646 | //
|
---|
647 | // Get the relative variance of the calculated Quantum efficiency with the PIN Diode method,
|
---|
648 | // obtained with pulser colour "col"
|
---|
649 | // Tests for variances smaller than 0. (e.g. if it has not yet been set)
|
---|
650 | // and returns -1. in that case
|
---|
651 | // Tests for quantum efficiency equal to 0. and returns -1. in that case
|
---|
652 | //
|
---|
653 | Float_t MCalibrationQEPix::GetQEPINDiodeRelVar( const MCalibrationCam::PulserColor_t col ) const
|
---|
654 | {
|
---|
655 |
|
---|
656 | if (fQEPINDiodeVar[col] < 0.)
|
---|
657 | return -1.;
|
---|
658 | if (fQEPINDiode[col] < 0.)
|
---|
659 | return -1.;
|
---|
660 | return fQEPINDiodeVar[col] / ( fQEPINDiode[col] * fQEPINDiode[col] );
|
---|
661 |
|
---|
662 | }
|
---|
663 |
|
---|
664 | // ------------------------------------------------------------------------------
|
---|
665 | //
|
---|
666 | // Get the averaged Quantum efficiency folded over the cascade spectrum, obtained
|
---|
667 | // with the blind pixel method and averaged over the results from the different colours.
|
---|
668 | //
|
---|
669 | Float_t MCalibrationQEPix::GetQECascadesBlindPixel( const Float_t zenith ) const
|
---|
670 | {
|
---|
671 | return fAvNormBlindPixel * GetAverageQE ( zenith );
|
---|
672 | }
|
---|
673 |
|
---|
674 | // ------------------------------------------------------------------------------
|
---|
675 | //
|
---|
676 | // Get the variance of the averaged Quantum efficiency folded over the cascade spectrum,
|
---|
677 | // obtained with the blind pixel method and averaged over the results from the
|
---|
678 | // different colours.
|
---|
679 | //
|
---|
680 | Float_t MCalibrationQEPix::GetQECascadesBlindPixelVar( const Float_t zenith ) const
|
---|
681 | {
|
---|
682 | return ( GetAvNormBlindPixelRelVar() + GetAverageQERelVar(zenith))
|
---|
683 | * GetQECascadesBlindPixel(zenith) * GetQECascadesBlindPixel(zenith);
|
---|
684 | }
|
---|
685 |
|
---|
686 | // ------------------------------------------------------------------------------
|
---|
687 | //
|
---|
688 | // Get the error on the averaged Quantum efficiency folded over the cascade spectrum,
|
---|
689 | // obtained with the blind pixel method and averaged over the results from the
|
---|
690 | // different colours.
|
---|
691 | //
|
---|
692 | Float_t MCalibrationQEPix::GetQECascadesBlindPixelErr( const Float_t zenith ) const
|
---|
693 | {
|
---|
694 | const Float_t var = GetQECascadesBlindPixelVar(zenith);
|
---|
695 |
|
---|
696 | if (var < 0.)
|
---|
697 | return -1.;
|
---|
698 |
|
---|
699 | return TMath::Sqrt(var);
|
---|
700 | }
|
---|
701 |
|
---|
702 | // ------------------------------------------------------------------------------
|
---|
703 | //
|
---|
704 | // Get the averaged Quantum efficiency folded over the cascade spectrum, obtained
|
---|
705 | // with the combination of the three methods and averaged over the results
|
---|
706 | // from the different colours.
|
---|
707 | //
|
---|
708 | Float_t MCalibrationQEPix::GetQECascadesCombined( const Float_t zenith ) const
|
---|
709 | {
|
---|
710 | return fAvNormCombined * GetAverageQE ( zenith );
|
---|
711 | }
|
---|
712 |
|
---|
713 | // ------------------------------------------------------------------------------
|
---|
714 | //
|
---|
715 | // Get the error on the averaged Quantum efficiency folded over the cascade spectrum,
|
---|
716 | // obtained with the combined method and averaged over the results from the
|
---|
717 | // different colours.
|
---|
718 | //
|
---|
719 | Float_t MCalibrationQEPix::GetQECascadesCombinedErr( const Float_t zenith ) const
|
---|
720 | {
|
---|
721 | const Float_t var = GetQECascadesCombinedVar(zenith);
|
---|
722 |
|
---|
723 | if (var < 0.)
|
---|
724 | return -1.;
|
---|
725 |
|
---|
726 | return TMath::Sqrt(var);
|
---|
727 | }
|
---|
728 |
|
---|
729 | // ------------------------------------------------------------------------------
|
---|
730 | //
|
---|
731 | // Get the variance of the averaged Quantum efficiency folded over the cascade spectrum,
|
---|
732 | // obtained with the combination of the three methods and averaged over the results from the
|
---|
733 | // different colours.
|
---|
734 | //
|
---|
735 | Float_t MCalibrationQEPix::GetQECascadesCombinedVar( const Float_t zenith ) const
|
---|
736 | {
|
---|
737 | return ( GetAvNormCombinedRelVar() + GetAverageQERelVar(zenith))
|
---|
738 | * GetQECascadesCombined(zenith) * GetQECascadesCombined(zenith);
|
---|
739 | }
|
---|
740 |
|
---|
741 | // ------------------------------------------------------------------------------
|
---|
742 | //
|
---|
743 | // Get the averaged Quantum efficiency folded over the cascade spectrum, obtained
|
---|
744 | // with the F-Factor method and averaged over the results from the different colours.
|
---|
745 | //
|
---|
746 | Float_t MCalibrationQEPix::GetQECascadesFFactor( const Float_t zenith ) const
|
---|
747 | {
|
---|
748 | return fAvNormFFactor * GetAverageQE ( zenith );
|
---|
749 | }
|
---|
750 |
|
---|
751 | // ------------------------------------------------------------------------------
|
---|
752 | //
|
---|
753 | // Get the error on the averaged Quantum efficiency folded over the cascade spectrum,
|
---|
754 | // obtained with the F-Factor method and averaged over the results from the
|
---|
755 | // different colours.
|
---|
756 | //
|
---|
757 | Float_t MCalibrationQEPix::GetQECascadesFFactorErr( const Float_t zenith ) const
|
---|
758 | {
|
---|
759 | const Float_t var = GetQECascadesFFactorVar(zenith);
|
---|
760 |
|
---|
761 | if (var < 0.)
|
---|
762 | return -1.;
|
---|
763 |
|
---|
764 | return TMath::Sqrt(var);
|
---|
765 | }
|
---|
766 |
|
---|
767 | // ------------------------------------------------------------------------------
|
---|
768 | //
|
---|
769 | // Get the variance of the averaged Quantum efficiency folded over the cascade spectrum,
|
---|
770 | // obtained with the F-Factor method and averaged over the results from the
|
---|
771 | // different colours.
|
---|
772 | //
|
---|
773 | Float_t MCalibrationQEPix::GetQECascadesFFactorVar( const Float_t zenith ) const
|
---|
774 | {
|
---|
775 | return ( GetAvNormFFactorRelVar() + GetAverageQERelVar(zenith))
|
---|
776 | * GetQECascadesFFactor(zenith) * GetQECascadesFFactor(zenith);
|
---|
777 | }
|
---|
778 |
|
---|
779 | // ------------------------------------------------------------------------------
|
---|
780 | //
|
---|
781 | // Get the averaged Quantum efficiency folded over the cascade spectrum, obtained
|
---|
782 | // with the PIN Diode method and averaged over the results from the different colours.
|
---|
783 | //
|
---|
784 | Float_t MCalibrationQEPix::GetQECascadesPINDiode( const Float_t zenith ) const
|
---|
785 | {
|
---|
786 | return fAvNormPINDiode * GetAverageQE ( zenith );
|
---|
787 | }
|
---|
788 |
|
---|
789 | // ------------------------------------------------------------------------------
|
---|
790 | //
|
---|
791 | // Get the error on the averaged Quantum efficiency folded over the cascade spectrum,
|
---|
792 | // obtained with the PIN Diode method and averaged over the results from the
|
---|
793 | // different colours.
|
---|
794 | //
|
---|
795 | Float_t MCalibrationQEPix::GetQECascadesPINDiodeErr( const Float_t zenith ) const
|
---|
796 | {
|
---|
797 | const Float_t var = GetQECascadesPINDiodeVar(zenith);
|
---|
798 |
|
---|
799 | if (var < 0.)
|
---|
800 | return -1.;
|
---|
801 |
|
---|
802 | return TMath::Sqrt(var);
|
---|
803 | }
|
---|
804 |
|
---|
805 | // ------------------------------------------------------------------------------
|
---|
806 | //
|
---|
807 | // Get the variance of the averaged Quantum efficiency folded over the cascade spectrum,
|
---|
808 | // obtained with the PIN Diode method and averaged over the results from the
|
---|
809 | // different colours.
|
---|
810 | //
|
---|
811 | Float_t MCalibrationQEPix::GetQECascadesPINDiodeVar( const Float_t zenith ) const
|
---|
812 | {
|
---|
813 | return ( GetAvNormPINDiodeRelVar() + GetAverageQERelVar(zenith))
|
---|
814 | * GetQECascadesPINDiode(zenith) * GetQECascadesPINDiode(zenith);
|
---|
815 | }
|
---|
816 |
|
---|
817 | // ------------------------------------------------------------------------------
|
---|
818 | //
|
---|
819 | // Test if the average QE can be obtained from the blind pixel method
|
---|
820 | //
|
---|
821 | Bool_t MCalibrationQEPix::IsAverageQEBlindPixelAvailable() const
|
---|
822 | {
|
---|
823 | return TESTBIT(fAvailableFlags,kAverageQEBlindPixelAvailable);
|
---|
824 | }
|
---|
825 |
|
---|
826 | // ------------------------------------------------------------------------------
|
---|
827 | //
|
---|
828 | // Test if the average QE can be obtained from the combination of the three methods
|
---|
829 | //
|
---|
830 | Bool_t MCalibrationQEPix::IsAverageQECombinedAvailable() const
|
---|
831 | {
|
---|
832 | return TESTBIT(fAvailableFlags,kAverageQECombinedAvailable);
|
---|
833 | }
|
---|
834 |
|
---|
835 | // ------------------------------------------------------------------------------
|
---|
836 | //
|
---|
837 | // Test if the average QE can be obtained from the F-Factor method
|
---|
838 | //
|
---|
839 | Bool_t MCalibrationQEPix::IsAverageQEFFactorAvailable() const
|
---|
840 | {
|
---|
841 | return TESTBIT(fAvailableFlags,kAverageQEFFactorAvailable);
|
---|
842 | }
|
---|
843 |
|
---|
844 | // ------------------------------------------------------------------------------
|
---|
845 | //
|
---|
846 | // Test if the average QE can be obtained from the PIN Diode method
|
---|
847 | //
|
---|
848 | Bool_t MCalibrationQEPix::IsAverageQEPINDiodeAvailable() const
|
---|
849 | {
|
---|
850 | return TESTBIT(fAvailableFlags,kAverageQEPINDiodeAvailable);
|
---|
851 | }
|
---|
852 |
|
---|
853 | // ------------------------------------------------------------------------------
|
---|
854 | //
|
---|
855 | // Test if any of the three colours has already been calibrated with the blind pixel method
|
---|
856 | //
|
---|
857 | Bool_t MCalibrationQEPix::IsBlindPixelMethodValid () const
|
---|
858 | {
|
---|
859 |
|
---|
860 | if (IsBlindPixelMethodValid (MCalibrationCam::kGREEN))
|
---|
861 | return kTRUE;
|
---|
862 | if (IsBlindPixelMethodValid (MCalibrationCam::kBLUE ))
|
---|
863 | return kTRUE;
|
---|
864 | if (IsBlindPixelMethodValid (MCalibrationCam::kUV ))
|
---|
865 | return kTRUE;
|
---|
866 | if (IsBlindPixelMethodValid (MCalibrationCam::kCT1 ))
|
---|
867 | return kTRUE;
|
---|
868 |
|
---|
869 | return kFALSE;
|
---|
870 | }
|
---|
871 |
|
---|
872 | // ------------------------------------------------------------------------------
|
---|
873 | //
|
---|
874 | // Test if any of the three colours has already been calibrated with the combination
|
---|
875 | // of the three methods
|
---|
876 | //
|
---|
877 | Bool_t MCalibrationQEPix::IsCombinedMethodValid () const
|
---|
878 | {
|
---|
879 | if (IsCombinedMethodValid (MCalibrationCam::kGREEN))
|
---|
880 | return kTRUE;
|
---|
881 | if (IsCombinedMethodValid (MCalibrationCam::kBLUE ))
|
---|
882 | return kTRUE;
|
---|
883 | if (IsCombinedMethodValid (MCalibrationCam::kUV ))
|
---|
884 | return kTRUE;
|
---|
885 | if (IsCombinedMethodValid (MCalibrationCam::kCT1 ))
|
---|
886 | return kTRUE;
|
---|
887 |
|
---|
888 | return kFALSE;
|
---|
889 | }
|
---|
890 |
|
---|
891 | // ------------------------------------------------------------------------------
|
---|
892 | //
|
---|
893 | // Test if any of the three colours has already been calibrated with the F-Factor method
|
---|
894 | //
|
---|
895 | Bool_t MCalibrationQEPix::IsFFactorMethodValid () const
|
---|
896 | {
|
---|
897 | if (IsFFactorMethodValid (MCalibrationCam::kGREEN))
|
---|
898 | return kTRUE;
|
---|
899 | if (IsFFactorMethodValid (MCalibrationCam::kBLUE ))
|
---|
900 | return kTRUE;
|
---|
901 | if (IsFFactorMethodValid (MCalibrationCam::kUV ))
|
---|
902 | return kTRUE;
|
---|
903 | if (IsFFactorMethodValid (MCalibrationCam::kCT1 ))
|
---|
904 | return kTRUE;
|
---|
905 |
|
---|
906 | return kFALSE;
|
---|
907 | }
|
---|
908 |
|
---|
909 |
|
---|
910 | // ------------------------------------------------------------------------------
|
---|
911 | //
|
---|
912 | // Test if any of the three colours has already been calibrated with the PIN Diode method
|
---|
913 | //
|
---|
914 | Bool_t MCalibrationQEPix::IsPINDiodeMethodValid () const
|
---|
915 | {
|
---|
916 | if (IsPINDiodeMethodValid (MCalibrationCam::kGREEN))
|
---|
917 | return kTRUE;
|
---|
918 | if (IsPINDiodeMethodValid (MCalibrationCam::kBLUE ))
|
---|
919 | return kTRUE;
|
---|
920 | if (IsPINDiodeMethodValid (MCalibrationCam::kUV ))
|
---|
921 | return kTRUE;
|
---|
922 | if (IsPINDiodeMethodValid (MCalibrationCam::kCT1 ))
|
---|
923 | return kTRUE;
|
---|
924 |
|
---|
925 | return kFALSE;
|
---|
926 | }
|
---|
927 |
|
---|
928 | // ------------------------------------------------------------------------------
|
---|
929 | //
|
---|
930 | // Test if the colour "col" has already been calibrated with the Blind Pixel method
|
---|
931 | //
|
---|
932 | Bool_t MCalibrationQEPix::IsBlindPixelMethodValid (MCalibrationCam::PulserColor_t col) const
|
---|
933 | {
|
---|
934 | return TESTBIT(fValidFlags[ MCalibrationCam::kGREEN ],kBlindPixelMethodValid);
|
---|
935 | }
|
---|
936 |
|
---|
937 | // ------------------------------------------------------------------------------
|
---|
938 | //
|
---|
939 | // Test if the colour "col" has already been calibrated with the combination of
|
---|
940 | // the three methods
|
---|
941 | //
|
---|
942 | Bool_t MCalibrationQEPix::IsCombinedMethodValid (MCalibrationCam::PulserColor_t col) const
|
---|
943 | {
|
---|
944 | return TESTBIT(fValidFlags[ MCalibrationCam::kGREEN ],kCombinedMethodValid);
|
---|
945 | }
|
---|
946 |
|
---|
947 | // ------------------------------------------------------------------------------
|
---|
948 | //
|
---|
949 | // Test if the colour "col" has already been calibrated with the F-Factor method
|
---|
950 | //
|
---|
951 | Bool_t MCalibrationQEPix::IsFFactorMethodValid (MCalibrationCam::PulserColor_t col) const
|
---|
952 | {
|
---|
953 | return TESTBIT(fValidFlags[ MCalibrationCam::kGREEN ],kFFactorMethodValid);
|
---|
954 | }
|
---|
955 |
|
---|
956 | // ------------------------------------------------------------------------------
|
---|
957 | //
|
---|
958 | // Test if the colour "col" has already been calibrated with the PIN Diode method
|
---|
959 | //
|
---|
960 | Bool_t MCalibrationQEPix::IsPINDiodeMethodValid (MCalibrationCam::PulserColor_t col) const
|
---|
961 | {
|
---|
962 | return TESTBIT(fValidFlags[ MCalibrationCam::kGREEN ],kPINDiodeMethodValid);
|
---|
963 | }
|
---|
964 |
|
---|
965 | // ------------------------------------------------------------------------------
|
---|
966 | //
|
---|
967 | // Set the bit Average QE Blind Pixel method available from outside (only for MC!)
|
---|
968 | //
|
---|
969 | void MCalibrationQEPix::SetAverageQEBlindPixelAvailable ( Bool_t b )
|
---|
970 | {
|
---|
971 | if (b)
|
---|
972 | SETBIT(fAvailableFlags,kAverageQEBlindPixelAvailable);
|
---|
973 | else
|
---|
974 | CLRBIT(fAvailableFlags,kAverageQEBlindPixelAvailable);
|
---|
975 | }
|
---|
976 |
|
---|
977 | // ------------------------------------------------------------------------------
|
---|
978 | //
|
---|
979 | // Set the bit Average QE combination of three methods available from outside (only for MC!)
|
---|
980 | //
|
---|
981 | void MCalibrationQEPix::SetAverageQECombinedAvailable ( Bool_t b )
|
---|
982 | {
|
---|
983 | if (b)
|
---|
984 | SETBIT(fAvailableFlags,kAverageQECombinedAvailable);
|
---|
985 | else
|
---|
986 | CLRBIT(fAvailableFlags,kAverageQECombinedAvailable);
|
---|
987 | }
|
---|
988 |
|
---|
989 | // ------------------------------------------------------------------------------
|
---|
990 | //
|
---|
991 | // Set the bit Average QE F-Factor method available from outside (only for MC!)
|
---|
992 | //
|
---|
993 | void MCalibrationQEPix::SetAverageQEFFactorAvailable ( Bool_t b )
|
---|
994 | {
|
---|
995 | if (b)
|
---|
996 | SETBIT(fAvailableFlags,kAverageQEFFactorAvailable);
|
---|
997 | else
|
---|
998 | CLRBIT(fAvailableFlags,kAverageQEFFactorAvailable);
|
---|
999 | }
|
---|
1000 |
|
---|
1001 | // ------------------------------------------------------------------------------
|
---|
1002 | //
|
---|
1003 | // Set the bit Average QE PIN Diode method available from outside (only for MC!)
|
---|
1004 | //
|
---|
1005 | void MCalibrationQEPix::SetAverageQEPINDiodeAvailable ( Bool_t b )
|
---|
1006 | {
|
---|
1007 | if (b)
|
---|
1008 | SETBIT(fAvailableFlags,kAverageQEPINDiodeAvailable);
|
---|
1009 | else
|
---|
1010 | CLRBIT(fAvailableFlags,kAverageQEPINDiodeAvailable);
|
---|
1011 | }
|
---|
1012 |
|
---|
1013 | // ------------------------------------------------------------------------------
|
---|
1014 | //
|
---|
1015 | // Set the bit QE Blind Pixel method available from colour "col"
|
---|
1016 | //
|
---|
1017 | void MCalibrationQEPix::SetBlindPixelMethodValid ( Bool_t b, MCalibrationCam::PulserColor_t col )
|
---|
1018 | {
|
---|
1019 | if (b)
|
---|
1020 | SETBIT(fValidFlags[ MCalibrationCam::kGREEN ],kBlindPixelMethodValid);
|
---|
1021 | else
|
---|
1022 | CLRBIT(fValidFlags[ MCalibrationCam::kGREEN ],kBlindPixelMethodValid);
|
---|
1023 | }
|
---|
1024 |
|
---|
1025 | // ------------------------------------------------------------------------------
|
---|
1026 | //
|
---|
1027 | // Set the bit QE Combination of three methods available from colour "col"
|
---|
1028 | //
|
---|
1029 | void MCalibrationQEPix::SetCombinedMethodValid ( Bool_t b, MCalibrationCam::PulserColor_t col )
|
---|
1030 | {
|
---|
1031 | if (b)
|
---|
1032 | SETBIT(fValidFlags[ MCalibrationCam::kGREEN ],kCombinedMethodValid);
|
---|
1033 | else
|
---|
1034 | CLRBIT(fValidFlags[ MCalibrationCam::kGREEN ],kCombinedMethodValid);
|
---|
1035 | }
|
---|
1036 |
|
---|
1037 | // ------------------------------------------------------------------------------
|
---|
1038 | //
|
---|
1039 | // Set the bit QE F-Factor method available from colour "col"
|
---|
1040 | //
|
---|
1041 | void MCalibrationQEPix::SetFFactorMethodValid ( Bool_t b, MCalibrationCam::PulserColor_t col )
|
---|
1042 | {
|
---|
1043 | if (b)
|
---|
1044 | SETBIT(fValidFlags[ MCalibrationCam::kGREEN ],kFFactorMethodValid);
|
---|
1045 | else
|
---|
1046 | CLRBIT(fValidFlags[ MCalibrationCam::kGREEN ],kFFactorMethodValid);
|
---|
1047 | }
|
---|
1048 |
|
---|
1049 | // ------------------------------------------------------------------------------
|
---|
1050 | //
|
---|
1051 | // Set the bit QE PIN Diode method available from colour "col"
|
---|
1052 | //
|
---|
1053 | void MCalibrationQEPix::SetPINDiodeMethodValid ( Bool_t b, MCalibrationCam::PulserColor_t col )
|
---|
1054 | {
|
---|
1055 | if (b)
|
---|
1056 | SETBIT(fValidFlags[ MCalibrationCam::kGREEN ],kPINDiodeMethodValid);
|
---|
1057 | else
|
---|
1058 | CLRBIT(fValidFlags[ MCalibrationCam::kGREEN ],kPINDiodeMethodValid);
|
---|
1059 | }
|
---|
1060 |
|
---|
1061 | // ------------------------------------------------------------------------------
|
---|
1062 | //
|
---|
1063 | // Update the Blind Pixel Method: Calculate new average QE's
|
---|
1064 | //
|
---|
1065 | Bool_t MCalibrationQEPix::UpdateBlindPixelMethod()
|
---|
1066 | {
|
---|
1067 |
|
---|
1068 | Float_t weightedav = 0.;
|
---|
1069 | Float_t sumweights = 0.;
|
---|
1070 |
|
---|
1071 | AddAverageBlindPixelQEs(MCalibrationCam::kGREEN, weightedav, sumweights);
|
---|
1072 | AddAverageBlindPixelQEs(MCalibrationCam::kBLUE , weightedav, sumweights);
|
---|
1073 | AddAverageBlindPixelQEs(MCalibrationCam::kUV , weightedav, sumweights);
|
---|
1074 | AddAverageBlindPixelQEs(MCalibrationCam::kCT1 , weightedav, sumweights);
|
---|
1075 |
|
---|
1076 | if (weightedav == 0. || sumweights == 0.)
|
---|
1077 | return kFALSE;
|
---|
1078 |
|
---|
1079 | weightedav /= sumweights;
|
---|
1080 |
|
---|
1081 | fAvNormBlindPixel = gkDefaultAverageQE * weightedav;
|
---|
1082 | fAvNormBlindPixelVar = GetAverageQERelVar() + (sumweights / weightedav / weightedav );
|
---|
1083 | fAvNormBlindPixelVar *= fAvNormBlindPixel * fAvNormBlindPixel;
|
---|
1084 |
|
---|
1085 | return kTRUE;
|
---|
1086 | }
|
---|
1087 |
|
---|
1088 | // ------------------------------------------------------------------------------
|
---|
1089 | //
|
---|
1090 | // Update the Combination of the three Methods: Calculate new average QE's
|
---|
1091 | //
|
---|
1092 | Bool_t MCalibrationQEPix::UpdateCombinedMethod()
|
---|
1093 | {
|
---|
1094 |
|
---|
1095 | Float_t weightedav = 0.;
|
---|
1096 | Float_t sumweights = 0.;
|
---|
1097 |
|
---|
1098 | AddAverageCombinedQEs(MCalibrationCam::kGREEN, weightedav, sumweights);
|
---|
1099 | AddAverageCombinedQEs(MCalibrationCam::kBLUE , weightedav, sumweights);
|
---|
1100 | AddAverageCombinedQEs(MCalibrationCam::kUV , weightedav, sumweights);
|
---|
1101 | AddAverageCombinedQEs(MCalibrationCam::kCT1 , weightedav, sumweights);
|
---|
1102 |
|
---|
1103 | if (weightedav == 0. || sumweights == 0.)
|
---|
1104 | return kFALSE;
|
---|
1105 |
|
---|
1106 | weightedav /= sumweights;
|
---|
1107 |
|
---|
1108 | fAvNormCombined = gkDefaultAverageQE * weightedav;
|
---|
1109 | fAvNormCombinedVar = GetAverageQERelVar() + (sumweights / weightedav / weightedav );
|
---|
1110 | fAvNormCombinedVar *= fAvNormCombined * fAvNormCombined;
|
---|
1111 |
|
---|
1112 | return kTRUE;
|
---|
1113 |
|
---|
1114 | }
|
---|
1115 |
|
---|
1116 | // ------------------------------------------------------------------------------
|
---|
1117 | //
|
---|
1118 | // Update the F-Factor Method: Calculate new average QE's
|
---|
1119 | //
|
---|
1120 | Bool_t MCalibrationQEPix::UpdateFFactorMethod()
|
---|
1121 | {
|
---|
1122 |
|
---|
1123 | Float_t weightedav = 0.;
|
---|
1124 | Float_t sumweights = 0.;
|
---|
1125 |
|
---|
1126 | AddAverageFFactorQEs(MCalibrationCam::kGREEN, weightedav, sumweights);
|
---|
1127 | AddAverageFFactorQEs(MCalibrationCam::kBLUE , weightedav, sumweights);
|
---|
1128 | AddAverageFFactorQEs(MCalibrationCam::kUV , weightedav, sumweights);
|
---|
1129 | AddAverageFFactorQEs(MCalibrationCam::kCT1 , weightedav, sumweights);
|
---|
1130 |
|
---|
1131 | if (weightedav == 0. || sumweights == 0.)
|
---|
1132 | return kFALSE;
|
---|
1133 |
|
---|
1134 | fAvNormFFactor = weightedav / sumweights;
|
---|
1135 | fAvNormFFactorVar = 1./ sumweights ;
|
---|
1136 |
|
---|
1137 | SetAverageQEFFactorAvailable();
|
---|
1138 |
|
---|
1139 | return kTRUE;
|
---|
1140 |
|
---|
1141 |
|
---|
1142 | }
|
---|
1143 |
|
---|
1144 | // ------------------------------------------------------------------------------
|
---|
1145 | //
|
---|
1146 | // Update the PIN Diode Method: Calculate new average QE's
|
---|
1147 | //
|
---|
1148 | Bool_t MCalibrationQEPix::UpdatePINDiodeMethod()
|
---|
1149 | {
|
---|
1150 |
|
---|
1151 | Float_t weightedav = 0.;
|
---|
1152 | Float_t sumweights = 0.;
|
---|
1153 |
|
---|
1154 | AddAveragePINDiodeQEs(MCalibrationCam::kGREEN, weightedav, sumweights);
|
---|
1155 | AddAveragePINDiodeQEs(MCalibrationCam::kBLUE , weightedav, sumweights);
|
---|
1156 | AddAveragePINDiodeQEs(MCalibrationCam::kUV , weightedav, sumweights);
|
---|
1157 | AddAveragePINDiodeQEs(MCalibrationCam::kCT1 , weightedav, sumweights);
|
---|
1158 |
|
---|
1159 | if (weightedav == 0. || sumweights == 0.)
|
---|
1160 | return kFALSE;
|
---|
1161 |
|
---|
1162 | weightedav /= sumweights;
|
---|
1163 |
|
---|
1164 | fAvNormPINDiode = gkDefaultAverageQE * weightedav;
|
---|
1165 | fAvNormPINDiodeVar = GetAverageQERelVar() + (sumweights / weightedav / weightedav );
|
---|
1166 | fAvNormPINDiodeVar *= fAvNormPINDiode * fAvNormPINDiode;
|
---|
1167 |
|
---|
1168 | return kTRUE;
|
---|
1169 |
|
---|
1170 |
|
---|
1171 | }
|
---|
1172 |
|
---|