source: trunk/MagicSoft/Mars/mcalib/MCalibrationQEPix.cc@ 4241

Last change on this file since 4241 was 4241, checked in by gaug, 20 years ago
*** empty log message ***
File size: 48.5 KB
Line 
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, see following figure with the
104// photon spectra at 2200 m altitude:)
105//
106//Begin_Html
107/*
108<img src="images/Photon_spectrum.png">
109*/
110//End_Html
111//
112// * PMT photoelectron collection efficiency: 0.9
113// (from D.Paneque, email 14.2.2004)
114//
115// * Light guides efficiency: 0.94
116// (from D.Paneque, email 14.2.2004)
117//
118// "Concerning the light guides effiency estimation... Daniel Ferenc
119// is preparing some work (simulations) to estimate it. Yet so far, he has
120// been busy with other stuff, and this work is still Unfinished.
121//
122// The estimation I did comes from:
123// 1) Reflectivity of light guide walls is 85 % (aluminum)
124// 2) At ZERO degree light incidence, 37% of the light hits such walls
125// (0.15X37%= 5.6% of light lost)
126// 3) When increasing the light incidence angle, more and more light hits
127// the walls.
128//
129// However, the loses due to larger amount of photons hitting the walls is more
130// or less counteracted by the fact that more and more photon trajectories cross
131// the PMT photocathode twice, increasing the effective sensitivity of the PMT.
132//
133//Begin_Html
134/*
135<img src="images/Normalized_Cherenkov_phe_spectrums_20deg_60deg_coatedPMT.png">
136*/
137//End_Html
138//
139// The plot shows the normalized spectrum of photo-electrons preceding from
140// a typical spectrum of Cherenkov photons produced by an atmospheric shower. The
141// green line is for observation zenith angles of 20 deg. and the red line for
142// 60 deg. The overall effective QE drops from about 20.8 to about 19.8.
143//
144// Jurgen Gebauer did some quick measurements about this issue. I attach a
145// plot. You can see that the angular dependence is (more or less) in agreement with a
146// CosTheta function (below 20-25 degrees), which is the variation of the entrance
147// window cross section. So, in first approximation, no losses when increasing light
148// incidence angle; and therefore, the factor 0.94.
149//
150//Begin_Html
151/*
152<img src="images/JuergensMeasurementWithCosThetaCurve.png">
153*/
154//End_Html
155//
156// The Quantum efficiencies for individual colours have been taken from:
157// D. Paneque et al., A Method to enhance the sensitivity of photomultipliers
158// of air Cherenkov Telescopes, NIM A 504, 2003, 109-115
159// (see following figure)
160//
161//Begin_Html
162/*
163<img src="images/QE_Paneque.png">
164*/
165//End_Html
166//
167//
168// See also: MJCalibration, MCalibrationChargeCalc,
169// MCalibrationChargeCam, MCalibrationChargePix,
170// MHCalibrationChargeCam, MHCalibrationChargePix,
171// MHCalibrationChargePINDiode, MHCalibrationChargeBlindPix
172//
173/////////////////////////////////////////////////////////////////////////////
174#include "MCalibrationQEPix.h"
175#include "MCalibrationCam.h"
176
177#include "MLog.h"
178#include "MLogManip.h"
179
180#include "TArrayF.h"
181#include "TArrayC.h"
182
183ClassImp(MCalibrationQEPix);
184
185using namespace std;
186
187const Float_t MCalibrationQEPix::gkDefaultQEGreen = 0.192;
188const Float_t MCalibrationQEPix::gkDefaultQEBlue = 0.27;
189const Float_t MCalibrationQEPix::gkDefaultQEUV = 0.285;
190const Float_t MCalibrationQEPix::gkDefaultQECT1 = 0.285;
191const Float_t MCalibrationQEPix::gkDefaultQEGreenErr = 0.05 ;
192const Float_t MCalibrationQEPix::gkDefaultQEBlueErr = 0.07 ;
193const Float_t MCalibrationQEPix::gkDefaultQEUVErr = 0.07 ;
194const Float_t MCalibrationQEPix::gkDefaultQECT1Err = 0.07 ;
195const Float_t MCalibrationQEPix::gkDefaultAverageQE = 0.18 ;
196const Float_t MCalibrationQEPix::gkDefaultAverageQEErr = 0.02 ;
197const Float_t MCalibrationQEPix::gkPMTCollectionEff = 0.90 ;
198const Float_t MCalibrationQEPix::gkPMTCollectionEffErr = 0.01 ;
199const Float_t MCalibrationQEPix::gkLightGuidesEffGreen = 0.94 ;
200const Float_t MCalibrationQEPix::gkLightGuidesEffGreenErr = 0.03 ;
201const Float_t MCalibrationQEPix::gkLightGuidesEffBlue = 0.94 ;
202const Float_t MCalibrationQEPix::gkLightGuidesEffBlueErr = 0.03 ;
203const Float_t MCalibrationQEPix::gkLightGuidesEffUV = 0.94 ;
204const Float_t MCalibrationQEPix::gkLightGuidesEffUVErr = 0.03 ;
205const Float_t MCalibrationQEPix::gkLightGuidesEffCT1 = 0.94 ;
206const Float_t MCalibrationQEPix::gkLightGuidesEffCT1Err = 0.03 ;
207// --------------------------------------------------------------------------
208//
209// Default Constructor:
210//
211// Initializes all TArrays to MCalibrationCam::gkNumPulserColors
212//
213// Calls:
214// - Clear()
215//
216MCalibrationQEPix::MCalibrationQEPix(const char *name, const char *title)
217 : fAverageQE ( gkDefaultAverageQE )
218{
219
220 fName = name ? name : "MCalibrationQEPix";
221 fTitle = title ? title : "Container of the calibrated quantum efficiency ";
222
223 fQEBlindPixel .Set( MCalibrationCam::gkNumPulserColors );
224 fQEBlindPixelVar .Set( MCalibrationCam::gkNumPulserColors );
225 fQECombined .Set( MCalibrationCam::gkNumPulserColors );
226 fQECombinedVar .Set( MCalibrationCam::gkNumPulserColors );
227 fQEFFactor .Set( MCalibrationCam::gkNumPulserColors );
228 fQEFFactorVar .Set( MCalibrationCam::gkNumPulserColors );
229 fQEPINDiode .Set( MCalibrationCam::gkNumPulserColors );
230 fQEPINDiodeVar .Set( MCalibrationCam::gkNumPulserColors );
231 fValidFlags .Set( MCalibrationCam::gkNumPulserColors );
232
233 Clear();
234
235}
236
237// ----------------------------------------------------------------------------------------------
238//
239// Search all available QE's of a certain colour after the blind pixel method,
240// compare them to the default QE of that colour and
241// add up a weighted average (wav) and a sum of weights (sumw)
242//
243// FIXME: This has to be replaced by a decent fit the QE-spectrum!
244//
245void MCalibrationQEPix::AddAverageBlindPixelQEs(const MCalibrationCam::PulserColor_t col, Float_t &wav, Float_t &sumw )
246{
247
248 if (IsBlindPixelMethodValid (col))
249 {
250 const Float_t newavqe = GetQEBlindPixel (col) / GetDefaultQE (col)
251 / GetLightGuidesEff (col) / GetPMTCollectionEff();
252 const Float_t newavqevar = ( GetQEBlindPixelRelVar(col) + GetDefaultQERelVar(col)
253 + GetLightGuidesEffRelVar(col) + GetPMTCollectionEffRelVar() )
254 * newavqe * newavqe;
255 const Float_t weight = 1./newavqevar;
256
257 wav += newavqe * weight;
258 sumw += weight;
259 }
260}
261
262// ----------------------------------------------------------------------------------------------
263//
264// Search all available QE's of a certain colour after the combination of the three methods
265// compare them to the default QE of that colour and
266// add up a weighted average (wav) and a sum of weights (sumw)
267//
268// FIXME: This has to be replaced by a decent fit the QE-spectrum!
269//
270void MCalibrationQEPix::AddAverageCombinedQEs(const MCalibrationCam::PulserColor_t col, Float_t &wav, Float_t &sumw )
271{
272
273 if (IsCombinedMethodValid (col))
274 {
275 const Float_t newavqe = GetQECombined(col) / GetDefaultQE (col)
276 / GetLightGuidesEff (col) / GetPMTCollectionEff();
277 const Float_t newavqevar = ( GetQECombinedRelVar(col) + GetDefaultQERelVar(col)
278 + GetLightGuidesEffRelVar(col) + GetPMTCollectionEffRelVar() )
279 * newavqe * newavqe;
280 const Float_t weight = 1./newavqevar;
281 wav += newavqe * weight;
282 sumw += weight;
283
284 }
285}
286
287// ----------------------------------------------------------------------------------------------
288//
289// Search all available QE's of a certain colour after the F-Factor method,
290// compare them to the default QE of that colour and
291// add up a weighted average (wav) and a sum of weights (sumw)
292//
293// FIXME: This has to be replaced by a decent fit the QE-spectrum!
294//
295void MCalibrationQEPix::AddAverageFFactorQEs(const MCalibrationCam::PulserColor_t col, Float_t &wav, Float_t &sumw )
296{
297
298 if (IsFFactorMethodValid (col))
299 {
300 const Float_t newavqe = GetQEFFactor(col) / GetDefaultQE (col)
301 / GetLightGuidesEff (col) / GetPMTCollectionEff();
302 const Float_t newavqevar = ( GetQEFFactorRelVar(col) + GetDefaultQERelVar(col)
303 + GetLightGuidesEffRelVar(col) + GetPMTCollectionEffRelVar() )
304 * newavqe * newavqe;
305 const Float_t weight = 1./newavqevar;
306
307 wav += newavqe *weight;
308 sumw += weight;
309
310 }
311
312
313}
314
315// ----------------------------------------------------------------------------------------------
316//
317// Search all available QE's of a certain colour after the PIN Diode method,
318// compare them to the default QE of that colour and
319// add up a weighted average (wav) and a sum of weights (sumw)
320//
321// FIXME: This has to be replaced by a decent fit the QE-spectrum!
322//
323void MCalibrationQEPix::AddAveragePINDiodeQEs(const MCalibrationCam::PulserColor_t col, Float_t &wav, Float_t &sumw )
324{
325
326 if (IsPINDiodeMethodValid (col))
327 {
328 const Float_t newavqe = GetQEPINDiode(col) / GetDefaultQE (col)
329 / GetLightGuidesEff (col) / GetPMTCollectionEff();
330 const Float_t newavqevar = ( GetQEPINDiodeRelVar(col) + GetDefaultQERelVar(col)
331 + GetLightGuidesEffRelVar(col) + GetPMTCollectionEffRelVar() )
332 * newavqe * newavqe;
333 const Float_t weight = 1./newavqevar;
334 wav += newavqe *weight;
335 sumw += weight;
336 }
337}
338
339
340
341// ------------------------------------------------------------------------
342//
343// Sets all quantum efficiencies to the gkDefaultQE*
344// Sets all Variances to the square root of gkDefaultQE*Err
345// Sets all flags to kFALSE
346// Sets all fAvNorm-Variables to 1.;
347// Sets all fAvNorm-Variances to 0.;
348//
349// Calls:
350// - MCalibrationPix::Clear()
351//
352void MCalibrationQEPix::Clear(Option_t *o)
353{
354
355 SetAverageQEBlindPixelAvailable ( kFALSE );
356 SetAverageQEFFactorAvailable ( kFALSE );
357 SetAverageQECombinedAvailable ( kFALSE );
358 SetAverageQEPINDiodeAvailable ( kFALSE );
359
360 fQEBlindPixel [ MCalibrationCam::kGREEN ] = gkDefaultQEGreen;
361 fQEBlindPixelVar [ MCalibrationCam::kGREEN ] = gkDefaultQEGreenErr*gkDefaultQEGreenErr;
362 fQEFFactor [ MCalibrationCam::kGREEN ] = gkDefaultQEGreen;
363 fQEFFactorVar [ MCalibrationCam::kGREEN ] = gkDefaultQEGreenErr*gkDefaultQEGreenErr;
364 fQECombined [ MCalibrationCam::kGREEN ] = gkDefaultQEGreen;
365 fQECombinedVar [ MCalibrationCam::kGREEN ] = gkDefaultQEGreenErr*gkDefaultQEGreenErr;
366 fQEPINDiode [ MCalibrationCam::kGREEN ] = gkDefaultQEGreen;
367 fQEPINDiodeVar [ MCalibrationCam::kGREEN ] = gkDefaultQEGreenErr*gkDefaultQEGreenErr;
368
369 SetBlindPixelMethodValid ( kFALSE, MCalibrationCam::kGREEN);
370 SetFFactorMethodValid ( kFALSE, MCalibrationCam::kGREEN);
371 SetCombinedMethodValid ( kFALSE, MCalibrationCam::kGREEN);
372 SetPINDiodeMethodValid ( kFALSE, MCalibrationCam::kGREEN);
373
374 fQEBlindPixel [ MCalibrationCam::kBLUE ] = gkDefaultQEBlue;
375 fQEBlindPixelVar [ MCalibrationCam::kBLUE ] = gkDefaultQEBlueErr*gkDefaultQEBlueErr;
376 fQEFFactor [ MCalibrationCam::kBLUE ] = gkDefaultQEBlue;
377 fQEFFactorVar [ MCalibrationCam::kBLUE ] = gkDefaultQEBlueErr*gkDefaultQEBlueErr;
378 fQECombined [ MCalibrationCam::kBLUE ] = gkDefaultQEBlue;
379 fQECombinedVar [ MCalibrationCam::kBLUE ] = gkDefaultQEBlueErr*gkDefaultQEBlueErr;
380 fQEPINDiode [ MCalibrationCam::kBLUE ] = gkDefaultQEBlue;
381 fQEPINDiodeVar [ MCalibrationCam::kBLUE ] = gkDefaultQEBlueErr*gkDefaultQEBlueErr;
382
383 SetBlindPixelMethodValid ( kFALSE, MCalibrationCam::kBLUE);
384 SetFFactorMethodValid ( kFALSE, MCalibrationCam::kBLUE);
385 SetCombinedMethodValid ( kFALSE, MCalibrationCam::kBLUE);
386 SetPINDiodeMethodValid ( kFALSE, MCalibrationCam::kBLUE);
387
388 fQEBlindPixel [ MCalibrationCam::kUV ] = gkDefaultQEUV;
389 fQEBlindPixelVar [ MCalibrationCam::kUV ] = gkDefaultQEUVErr*gkDefaultQEUVErr;
390 fQEFFactor [ MCalibrationCam::kUV ] = gkDefaultQEUV;
391 fQEFFactorVar [ MCalibrationCam::kUV ] = gkDefaultQEUVErr*gkDefaultQEUVErr;
392 fQECombined [ MCalibrationCam::kUV ] = gkDefaultQEUV;
393 fQECombinedVar [ MCalibrationCam::kUV ] = gkDefaultQEUVErr*gkDefaultQEUVErr;
394 fQEPINDiode [ MCalibrationCam::kUV ] = gkDefaultQEUV;
395 fQEPINDiodeVar [ MCalibrationCam::kUV ] = gkDefaultQEUVErr*gkDefaultQEUVErr;
396
397 SetBlindPixelMethodValid ( kFALSE, MCalibrationCam::kUV);
398 SetFFactorMethodValid ( kFALSE, MCalibrationCam::kUV);
399 SetCombinedMethodValid ( kFALSE, MCalibrationCam::kUV);
400 SetPINDiodeMethodValid ( kFALSE, MCalibrationCam::kUV);
401
402 fQEBlindPixel [ MCalibrationCam::kCT1 ] = gkDefaultQECT1;
403 fQEBlindPixelVar [ MCalibrationCam::kCT1 ] = gkDefaultQECT1Err*gkDefaultQECT1Err;
404 fQEFFactor [ MCalibrationCam::kCT1 ] = gkDefaultQECT1;
405 fQEFFactorVar [ MCalibrationCam::kCT1 ] = gkDefaultQECT1Err*gkDefaultQECT1Err;
406 fQECombined [ MCalibrationCam::kCT1 ] = gkDefaultQECT1;
407 fQECombinedVar [ MCalibrationCam::kCT1 ] = gkDefaultQECT1Err*gkDefaultQECT1Err;
408 fQEPINDiode [ MCalibrationCam::kCT1 ] = gkDefaultQECT1;
409 fQEPINDiodeVar [ MCalibrationCam::kCT1 ] = gkDefaultQECT1Err*gkDefaultQECT1Err;
410
411 SetBlindPixelMethodValid ( kFALSE, MCalibrationCam::kCT1);
412 SetFFactorMethodValid ( kFALSE, MCalibrationCam::kCT1);
413 SetCombinedMethodValid ( kFALSE, MCalibrationCam::kCT1);
414 SetPINDiodeMethodValid ( kFALSE, MCalibrationCam::kCT1);
415
416 fAvNormBlindPixel = 1.;
417 fAvNormBlindPixelVar = 0.;
418 fAvNormCombined = 1.;
419 fAvNormCombinedVar = 0.;
420 fAvNormFFactor = 1.;
421 fAvNormFFactorVar = 0.;
422 fAvNormPINDiode = 1.;
423 fAvNormPINDiodeVar = 0.;
424
425 MCalibrationPix::Clear();
426}
427
428
429// -----------------------------------------------------------------
430//
431// Return the average Default QE (depending on zenith angle)
432// FIXME: The zenith angle dependency is not yet implemented
433//
434const Float_t MCalibrationQEPix::GetAverageQE( const Float_t zenith ) const
435{
436 // return gkDefaultAverageQE ;
437 return fAverageQE;
438}
439
440// -----------------------------------------------------------------
441//
442// Return the relative variance of the average Default QE (depending on zenith angle)
443// FIXME: The zenith angle dependency is not yet implemented
444//
445const Float_t MCalibrationQEPix::GetAverageQERelVar( const Float_t zenith ) const
446{
447 return gkDefaultAverageQEErr * gkDefaultAverageQEErr / (gkDefaultAverageQE * gkDefaultAverageQE );
448}
449
450// -----------------------------------------------------------------
451//
452// Return the relative variance of the average normalization (Blind Pixel Method)
453// FIXME: The zenith angle dependency is not yet implemented
454//
455const Float_t MCalibrationQEPix::GetAvNormBlindPixelRelVar( ) const
456{
457 return fAvNormBlindPixelVar / (fAvNormBlindPixel * fAvNormBlindPixel );
458}
459
460// -----------------------------------------------------------------
461//
462// Return the relative variance of the average normalization (Combined Method)
463// FIXME: The zenith angle dependency is not yet implemented
464//
465const Float_t MCalibrationQEPix::GetAvNormCombinedRelVar( ) const
466{
467 return fAvNormCombinedVar / (fAvNormCombined * fAvNormCombined );
468}
469
470// -----------------------------------------------------------------
471//
472// Return the relative variance of the average normalization (F-Factor Method)
473//
474const Float_t MCalibrationQEPix::GetAvNormFFactorRelVar( ) const
475{
476 return fAvNormFFactorVar / (fAvNormFFactor * fAvNormFFactor );
477}
478
479// -----------------------------------------------------------------
480//
481// Return the relative variance of the average normalization (PIN Diode Method)
482// FIXME: The zenith angle dependency is not yet implemented
483//
484const Float_t MCalibrationQEPix::GetAvNormPINDiodeRelVar( ) const
485{
486 return fAvNormPINDiodeVar / (fAvNormPINDiode * fAvNormPINDiode );
487}
488
489// ------------------------------------------------------------------------------
490//
491// Get the default Quantum efficiency for pulser colour "col"
492//
493Float_t MCalibrationQEPix::GetDefaultQE( const MCalibrationCam::PulserColor_t col ) const
494{
495 switch (col)
496 {
497 case MCalibrationCam::kGREEN:
498 return gkDefaultQEGreen;
499 break;
500 case MCalibrationCam::kBLUE:
501 return gkDefaultQEBlue;
502 break;
503 case MCalibrationCam::kUV:
504 return gkDefaultQEUV;
505 break;
506 case MCalibrationCam::kCT1:
507 return gkDefaultQECT1;
508 break;
509 default:
510 return gkDefaultQECT1;
511 break;
512 }
513 return -1.;
514}
515
516// ------------------------------------------------------------------------------
517//
518// Get the relative variance of the default Quantum efficiency for pulser colour "col"
519//
520Float_t MCalibrationQEPix::GetDefaultQERelVar( const MCalibrationCam::PulserColor_t col ) const
521{
522
523 switch (col)
524 {
525 case MCalibrationCam::kGREEN:
526 return gkDefaultQEGreenErr * gkDefaultQEGreenErr / (gkDefaultQEGreen * gkDefaultQEGreen );
527 break;
528 case MCalibrationCam::kBLUE:
529 return gkDefaultQEBlueErr * gkDefaultQEBlueErr / (gkDefaultQEBlue * gkDefaultQEBlue );
530 break;
531 case MCalibrationCam::kUV:
532 return gkDefaultQEUVErr * gkDefaultQEUVErr / (gkDefaultQEUV * gkDefaultQEUV );
533 break;
534 case MCalibrationCam::kCT1:
535 return gkDefaultQECT1Err * gkDefaultQECT1Err / (gkDefaultQECT1 * gkDefaultQECT1 );
536 break;
537 default:
538 return gkDefaultQECT1Err * gkDefaultQECT1Err / (gkDefaultQECT1 * gkDefaultQECT1 );
539 break;
540 }
541 return -1.;
542}
543
544// ------------------------------------------------------------------------------
545//
546// Get the light guides efficiency depending on the pulser colour "col"
547// FIXME: Lacking detailed measurement, these number are not yet available
548// for the individual colours and therefore, only one same number is
549// returned, namely gkLightGuidesEff
550//
551Float_t MCalibrationQEPix::GetLightGuidesEff( const MCalibrationCam::PulserColor_t col ) const
552{
553 switch (col)
554 {
555 case MCalibrationCam::kGREEN:
556 return gkLightGuidesEffGreen;
557 break;
558 case MCalibrationCam::kBLUE:
559 return gkLightGuidesEffBlue;
560 break;
561 case MCalibrationCam::kUV:
562 return gkLightGuidesEffUV;
563 break;
564 case MCalibrationCam::kCT1:
565 return gkLightGuidesEffCT1;
566 break;
567 default:
568 return gkLightGuidesEffCT1;
569 break;
570 }
571 return -1.;
572}
573
574// ------------------------------------------------------------------------------
575//
576// Get the relative variance of the light guides efficiency depending on the
577// pulser colour "col"
578// FIXME: Lacking detailed measurement, these number are not yet available
579// for the individual colours and therefore, only one same number is
580// returned, namely gkLightGuidesEffErr^2 / gkLightGuidesEff^2
581//
582Float_t MCalibrationQEPix::GetLightGuidesEffRelVar( const MCalibrationCam::PulserColor_t col ) const
583{
584
585 switch (col)
586 {
587 case MCalibrationCam::kGREEN:
588 return gkLightGuidesEffGreenErr * gkLightGuidesEffGreenErr / gkLightGuidesEffGreen / gkLightGuidesEffGreen;
589 break;
590 case MCalibrationCam::kBLUE:
591 return gkLightGuidesEffBlueErr * gkLightGuidesEffBlueErr / gkLightGuidesEffBlue / gkLightGuidesEffBlue;
592 break;
593 case MCalibrationCam::kUV:
594 return gkLightGuidesEffUVErr * gkLightGuidesEffUVErr / gkLightGuidesEffUV / gkLightGuidesEffUV;
595 break;
596 case MCalibrationCam::kCT1:
597 return gkLightGuidesEffCT1Err * gkLightGuidesEffCT1Err / gkLightGuidesEffCT1 / gkLightGuidesEffCT1;
598 break;
599 default:
600 return gkLightGuidesEffCT1Err * gkLightGuidesEffCT1Err / gkLightGuidesEffCT1 / gkLightGuidesEffCT1;
601 break;
602 }
603 return -1.;
604}
605
606// ------------------------------------------------------------------------------
607//
608// Get the light guides efficiency for Cherenkov spectra,
609// depending on the zenith angle of the telescope
610// FIXME: Lacking detailed measurement, these number are not yet available
611// for the individual colours and therefore, only one same number is
612// returned, namely gkLightGuidesEffBlue
613//
614Float_t MCalibrationQEPix::GetLightGuidesEff( const Float_t zenith ) const
615{
616 return gkLightGuidesEffBlue;
617}
618
619
620// ------------------------------------------------------------------------------
621//
622// Get the relative variance of the light guides efficiency for Cherenkov spectra
623// depending on the zenith angle of the telescope
624// FIXME: Lacking detailed measurement, these number are not yet available
625// for the individual colours and therefore, only one same number is
626// returned, namely gkLightGuidesEffBlueErr^2 / gkLightGuidesBlueEff^2
627//
628Float_t MCalibrationQEPix::GetLightGuidesEffRelVar( const Float_t zenith ) const
629{
630 return gkLightGuidesEffBlueErr * gkLightGuidesEffBlueErr / gkLightGuidesEffBlue / gkLightGuidesEffBlue;
631}
632
633
634
635// ------------------------------------------------------------------------------
636//
637// Get the calculated Quantum efficiency with the blind pixel method,
638// obtained with pulser colour "col"
639//
640Float_t MCalibrationQEPix::GetQEBlindPixel( const MCalibrationCam::PulserColor_t col ) const
641{
642 return fQEBlindPixel[col];
643}
644
645// ------------------------------------------------------------------------------
646//
647// Get the error on the calculated Quantum efficiency with the blind pixel 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//
652Float_t MCalibrationQEPix::GetQEBlindPixelErr( const MCalibrationCam::PulserColor_t col ) const
653{
654
655 if (fQEBlindPixelVar[col] < 0.)
656 return -1.;
657
658 return TMath::Sqrt(fQEBlindPixelVar[col]);
659
660}
661
662// ------------------------------------------------------------------------------
663//
664// Get the relative variance of the calculated Quantum efficiency with the blind pixel method,
665// obtained with pulser colour "col"
666// Tests for variances smaller than 0. (e.g. if it has not yet been set)
667// and returns -1. in that case
668// Tests for quantum efficiency equal to 0. and returns -1. in that case
669//
670Float_t MCalibrationQEPix::GetQEBlindPixelRelVar( const MCalibrationCam::PulserColor_t col ) const
671{
672
673 if (fQEBlindPixelVar[col] < 0.)
674 return -1.;
675 if (fQEBlindPixel[col] < 0.)
676 return -1.;
677 return fQEBlindPixelVar[col] / ( fQEBlindPixel[col] * fQEBlindPixel[col] );
678
679}
680
681// ------------------------------------------------------------------------------
682//
683// Get the calculated Quantum efficiency with the combination of the three methods
684// obtained with pulser colour "col"
685//
686Float_t MCalibrationQEPix::GetQECombined( const MCalibrationCam::PulserColor_t col ) const
687{
688 return fQECombined[col];
689}
690
691
692// ------------------------------------------------------------------------------
693//
694// Get the error on the calculated Quantum efficiency with the combination of the three methods
695// obtained with pulser colour "col"
696// Tests for variances smaller than 0. (e.g. if it has not yet been set)
697// and returns -1. in that case
698//
699Float_t MCalibrationQEPix::GetQECombinedErr( const MCalibrationCam::PulserColor_t col ) const
700{
701
702 if (fQECombinedVar[col] < 0.)
703 return -1.;
704
705 return TMath::Sqrt(fQECombinedVar[col]);
706
707}
708
709
710// ----------------------------------------------------------------------------------------
711//
712// Get the relative variance of the calculated Quantum efficiency with the combination of
713// the three methods,
714// obtained with pulser colour "col"
715// Tests for variances smaller than 0. (e.g. if it has not yet been set)
716// and returns -1. in that case
717// Tests for quantum efficiency equal to 0. and returns -1. in that case
718//
719Float_t MCalibrationQEPix::GetQECombinedRelVar( const MCalibrationCam::PulserColor_t col ) const
720{
721
722 if (fQECombinedVar[col] < 0.)
723 return -1.;
724 if (fQECombined[col] < 0.)
725 return -1.;
726 return fQECombinedVar[col] / ( fQECombined[col] * fQECombined[col] );
727
728}
729
730// ------------------------------------------------------------------------------
731//
732// Get the calculated Quantum efficiency with the F-Factor method
733// obtained with pulser colour "col"
734//
735Float_t MCalibrationQEPix::GetQEFFactor( const MCalibrationCam::PulserColor_t col ) const
736{
737 return fQEFFactor[col];
738}
739
740
741// ------------------------------------------------------------------------------
742//
743// Get the error on the calculated Quantum efficiency with the F-Factor method,
744// obtained with pulser colour "col"
745// Tests for variances smaller than 0. (e.g. if it has not yet been set)
746// and returns -1. in that case
747//
748Float_t MCalibrationQEPix::GetQEFFactorErr( const MCalibrationCam::PulserColor_t col ) const
749{
750
751 if (fQEFFactorVar[col] < 0.)
752 return -1.;
753
754 return TMath::Sqrt(fQEFFactorVar[col]);
755
756}
757
758
759// ----------------------------------------------------------------------------------------
760//
761// Get the relative variance of the calculated Quantum efficiency with the F-Factor method,
762// obtained with pulser colour "col"
763// Tests for variances smaller than 0. (e.g. if it has not yet been set)
764// and returns -1. in that case
765// Tests for quantum efficiency equal to 0. and returns -1. in that case
766//
767Float_t MCalibrationQEPix::GetQEFFactorRelVar( const MCalibrationCam::PulserColor_t col ) const
768{
769
770 if (fQEFFactorVar[col] < 0.)
771 return -1.;
772 if (fQEFFactor[col] < 0.)
773 return -1.;
774 return fQEFFactorVar[col] / ( fQEFFactor[col] * fQEFFactor[col] );
775
776}
777
778// ------------------------------------------------------------------------------
779//
780// Get the calculated Quantum efficiency with the PIN-Diode method
781// obtained with pulser colour "col"
782//
783Float_t MCalibrationQEPix::GetQEPINDiode( const MCalibrationCam::PulserColor_t col ) const
784{
785 return fQEPINDiode[col];
786}
787
788
789// ------------------------------------------------------------------------------
790//
791// Get the error on the calculated Quantum efficiency with the PIN Diode method,
792// obtained with pulser colour "col"
793// Tests for variances smaller than 0. (e.g. if it has not yet been set)
794// and returns -1. in that case
795//
796Float_t MCalibrationQEPix::GetQEPINDiodeErr( const MCalibrationCam::PulserColor_t col ) const
797{
798
799 if (fQEPINDiodeVar[col] < 0.)
800 return -1.;
801
802 return TMath::Sqrt(fQEPINDiodeVar[col]);
803
804}
805
806// ----------------------------------------------------------------------------------------
807//
808// Get the relative variance of the calculated Quantum efficiency with the PIN Diode method,
809// obtained with pulser colour "col"
810// Tests for variances smaller than 0. (e.g. if it has not yet been set)
811// and returns -1. in that case
812// Tests for quantum efficiency equal to 0. and returns -1. in that case
813//
814Float_t MCalibrationQEPix::GetQEPINDiodeRelVar( const MCalibrationCam::PulserColor_t col ) const
815{
816
817 if (fQEPINDiodeVar[col] < 0.)
818 return -1.;
819 if (fQEPINDiode[col] < 0.)
820 return -1.;
821 return fQEPINDiodeVar[col] / ( fQEPINDiode[col] * fQEPINDiode[col] );
822
823}
824
825// ------------------------------------------------------------------------------
826//
827// Get the averaged Quantum efficiency folded over the cascade spectrum, obtained
828// with the blind pixel method and averaged over the results from the different colours.
829//
830Float_t MCalibrationQEPix::GetQECascadesBlindPixel( const Float_t zenith ) const
831{
832 return fAvNormBlindPixel * GetAverageQE ( zenith );
833}
834
835// ------------------------------------------------------------------------------
836//
837// Get the variance of the averaged Quantum efficiency folded over the cascade spectrum,
838// obtained with the blind pixel method and averaged over the results from the
839// different colours.
840//
841Float_t MCalibrationQEPix::GetQECascadesBlindPixelVar( const Float_t zenith ) const
842{
843 return ( GetAvNormBlindPixelRelVar() + GetAverageQERelVar(zenith))
844 * GetQECascadesBlindPixel(zenith) * GetQECascadesBlindPixel(zenith);
845}
846
847// ------------------------------------------------------------------------------
848//
849// Get the error on the averaged Quantum efficiency folded over the cascade spectrum,
850// obtained with the blind pixel method and averaged over the results from the
851// different colours.
852//
853Float_t MCalibrationQEPix::GetQECascadesBlindPixelErr( const Float_t zenith ) const
854{
855 const Float_t var = GetQECascadesBlindPixelVar(zenith);
856
857 if (var < 0.)
858 return -1.;
859
860 return TMath::Sqrt(var);
861}
862
863// ------------------------------------------------------------------------------
864//
865// Get the averaged Quantum efficiency folded over the cascade spectrum, obtained
866// with the combination of the three methods and averaged over the results
867// from the different colours.
868//
869Float_t MCalibrationQEPix::GetQECascadesCombined( const Float_t zenith ) const
870{
871 return fAvNormCombined * GetAverageQE ( zenith );
872}
873
874// ------------------------------------------------------------------------------
875//
876// Get the error on the averaged Quantum efficiency folded over the cascade spectrum,
877// obtained with the combined method and averaged over the results from the
878// different colours.
879//
880Float_t MCalibrationQEPix::GetQECascadesCombinedErr( const Float_t zenith ) const
881{
882 const Float_t var = GetQECascadesCombinedVar(zenith);
883
884 if (var < 0.)
885 return -1.;
886
887 return TMath::Sqrt(var);
888}
889
890// ------------------------------------------------------------------------------
891//
892// Get the variance of the averaged Quantum efficiency folded over the cascade spectrum,
893// obtained with the combination of the three methods and averaged over the results from the
894// different colours.
895//
896Float_t MCalibrationQEPix::GetQECascadesCombinedVar( const Float_t zenith ) const
897{
898 return ( GetAvNormCombinedRelVar() + GetAverageQERelVar(zenith))
899 * GetQECascadesCombined(zenith) * GetQECascadesCombined(zenith);
900}
901
902// ------------------------------------------------------------------------------
903//
904// Get the averaged Quantum efficiency folded over the cascade spectrum, obtained
905// with the F-Factor method and averaged over the results from the different colours.
906//
907Float_t MCalibrationQEPix::GetQECascadesFFactor( const Float_t zenith ) const
908{
909 return fAvNormFFactor * GetAverageQE ( zenith );
910}
911
912// ------------------------------------------------------------------------------
913//
914// Get the error on the averaged Quantum efficiency folded over the cascade spectrum,
915// obtained with the F-Factor method and averaged over the results from the
916// different colours.
917//
918Float_t MCalibrationQEPix::GetQECascadesFFactorErr( const Float_t zenith ) const
919{
920 const Float_t var = GetQECascadesFFactorVar(zenith);
921
922 if (var < 0.)
923 return -1.;
924
925 return TMath::Sqrt(var);
926}
927
928// ------------------------------------------------------------------------------
929//
930// Get the variance of the averaged Quantum efficiency folded over the cascade spectrum,
931// obtained with the F-Factor method and averaged over the results from the
932// different colours.
933//
934Float_t MCalibrationQEPix::GetQECascadesFFactorVar( const Float_t zenith ) const
935{
936 return ( GetAvNormFFactorRelVar() + GetAverageQERelVar(zenith))
937 * GetQECascadesFFactor(zenith) * GetQECascadesFFactor(zenith);
938}
939
940// ------------------------------------------------------------------------------
941//
942// Get the averaged Quantum efficiency folded over the cascade spectrum, obtained
943// with the PIN Diode method and averaged over the results from the different colours.
944//
945Float_t MCalibrationQEPix::GetQECascadesPINDiode( const Float_t zenith ) const
946{
947 return fAvNormPINDiode * GetAverageQE ( zenith );
948}
949
950// ------------------------------------------------------------------------------
951//
952// Get the error on the averaged Quantum efficiency folded over the cascade spectrum,
953// obtained with the PIN Diode method and averaged over the results from the
954// different colours.
955//
956Float_t MCalibrationQEPix::GetQECascadesPINDiodeErr( const Float_t zenith ) const
957{
958 const Float_t var = GetQECascadesPINDiodeVar(zenith);
959
960 if (var < 0.)
961 return -1.;
962
963 return TMath::Sqrt(var);
964}
965
966// ------------------------------------------------------------------------------
967//
968// Get the variance of the averaged Quantum efficiency folded over the cascade spectrum,
969// obtained with the PIN Diode method and averaged over the results from the
970// different colours.
971//
972Float_t MCalibrationQEPix::GetQECascadesPINDiodeVar( const Float_t zenith ) const
973{
974 return ( GetAvNormPINDiodeRelVar() + GetAverageQERelVar(zenith))
975 * GetQECascadesPINDiode(zenith) * GetQECascadesPINDiode(zenith);
976}
977
978// -----------------------------------------------------------------
979//
980// Return the overall collection efficiency of the PMT
981//
982Float_t MCalibrationQEPix::GetPMTCollectionEff() const
983{
984 return gkPMTCollectionEff;
985}
986
987// -----------------------------------------------------------------
988//
989// Return the relative variance of the collection efficiency of the PMT
990//
991Float_t MCalibrationQEPix::GetPMTCollectionEffRelVar() const
992{
993 return gkPMTCollectionEffErr * gkPMTCollectionEffErr / gkPMTCollectionEff / gkPMTCollectionEff;
994}
995
996// ------------------------------------------------------------------------------
997//
998// Test if the average QE can be obtained from the blind pixel method
999//
1000Bool_t MCalibrationQEPix::IsAverageQEBlindPixelAvailable() const
1001{
1002 return TESTBIT(fAvailableFlags,kAverageQEBlindPixelAvailable);
1003}
1004
1005// ------------------------------------------------------------------------------
1006//
1007// Test if the average QE can be obtained from the combination of the three methods
1008//
1009Bool_t MCalibrationQEPix::IsAverageQECombinedAvailable() const
1010{
1011 return TESTBIT(fAvailableFlags,kAverageQECombinedAvailable);
1012}
1013
1014// ------------------------------------------------------------------------------
1015//
1016// Test if the average QE can be obtained from the F-Factor method
1017//
1018Bool_t MCalibrationQEPix::IsAverageQEFFactorAvailable() const
1019{
1020 return TESTBIT(fAvailableFlags,kAverageQEFFactorAvailable);
1021}
1022
1023// ------------------------------------------------------------------------------
1024//
1025// Test if the average QE can be obtained from the PIN Diode method
1026//
1027Bool_t MCalibrationQEPix::IsAverageQEPINDiodeAvailable() const
1028{
1029 return TESTBIT(fAvailableFlags,kAverageQEPINDiodeAvailable);
1030}
1031
1032// ------------------------------------------------------------------------------
1033//
1034// Test if any of the three colours has already been calibrated with the blind pixel method
1035//
1036Bool_t MCalibrationQEPix::IsBlindPixelMethodValid () const
1037{
1038
1039 if (IsBlindPixelMethodValid (MCalibrationCam::kGREEN))
1040 return kTRUE;
1041 if (IsBlindPixelMethodValid (MCalibrationCam::kBLUE ))
1042 return kTRUE;
1043 if (IsBlindPixelMethodValid (MCalibrationCam::kUV ))
1044 return kTRUE;
1045 if (IsBlindPixelMethodValid (MCalibrationCam::kCT1 ))
1046 return kTRUE;
1047
1048 return kFALSE;
1049}
1050
1051// ------------------------------------------------------------------------------
1052//
1053// Test if any of the three colours has already been calibrated with the combination
1054// of the three methods
1055//
1056Bool_t MCalibrationQEPix::IsCombinedMethodValid () const
1057{
1058 if (IsCombinedMethodValid (MCalibrationCam::kGREEN))
1059 return kTRUE;
1060 if (IsCombinedMethodValid (MCalibrationCam::kBLUE ))
1061 return kTRUE;
1062 if (IsCombinedMethodValid (MCalibrationCam::kUV ))
1063 return kTRUE;
1064 if (IsCombinedMethodValid (MCalibrationCam::kCT1 ))
1065 return kTRUE;
1066
1067 return kFALSE;
1068}
1069
1070// ------------------------------------------------------------------------------
1071//
1072// Test if any of the three colours has already been calibrated with the F-Factor method
1073//
1074Bool_t MCalibrationQEPix::IsFFactorMethodValid () const
1075{
1076 if (IsFFactorMethodValid (MCalibrationCam::kGREEN))
1077 return kTRUE;
1078 if (IsFFactorMethodValid (MCalibrationCam::kBLUE ))
1079 return kTRUE;
1080 if (IsFFactorMethodValid (MCalibrationCam::kUV ))
1081 return kTRUE;
1082 if (IsFFactorMethodValid (MCalibrationCam::kCT1 ))
1083 return kTRUE;
1084
1085 return kFALSE;
1086}
1087
1088
1089// ------------------------------------------------------------------------------
1090//
1091// Test if any of the three colours has already been calibrated with the PIN Diode method
1092//
1093Bool_t MCalibrationQEPix::IsPINDiodeMethodValid () const
1094{
1095 if (IsPINDiodeMethodValid (MCalibrationCam::kGREEN))
1096 return kTRUE;
1097 if (IsPINDiodeMethodValid (MCalibrationCam::kBLUE ))
1098 return kTRUE;
1099 if (IsPINDiodeMethodValid (MCalibrationCam::kUV ))
1100 return kTRUE;
1101 if (IsPINDiodeMethodValid (MCalibrationCam::kCT1 ))
1102 return kTRUE;
1103
1104 return kFALSE;
1105}
1106
1107// ------------------------------------------------------------------------------
1108//
1109// Test if the colour "col" has already been calibrated with the Blind Pixel method
1110//
1111Bool_t MCalibrationQEPix::IsBlindPixelMethodValid (MCalibrationCam::PulserColor_t col) const
1112{
1113 return TESTBIT(fValidFlags[ col ],kBlindPixelMethodValid);
1114}
1115
1116// ------------------------------------------------------------------------------
1117//
1118// Test if the colour "col" has already been calibrated with the combination of
1119// the three methods
1120//
1121Bool_t MCalibrationQEPix::IsCombinedMethodValid (MCalibrationCam::PulserColor_t col) const
1122{
1123 return TESTBIT(fValidFlags[ col ],kCombinedMethodValid);
1124}
1125
1126// ------------------------------------------------------------------------------
1127//
1128// Test if the colour "col" has already been calibrated with the F-Factor method
1129//
1130Bool_t MCalibrationQEPix::IsFFactorMethodValid (MCalibrationCam::PulserColor_t col) const
1131{
1132 return TESTBIT(fValidFlags[ col ],kFFactorMethodValid);
1133}
1134
1135// ------------------------------------------------------------------------------
1136//
1137// Test if the colour "col" has already been calibrated with the PIN Diode method
1138//
1139Bool_t MCalibrationQEPix::IsPINDiodeMethodValid (MCalibrationCam::PulserColor_t col) const
1140{
1141 return TESTBIT(fValidFlags[ col ],kPINDiodeMethodValid);
1142}
1143
1144// ------------------------------------------------------------------------------
1145//
1146// Set the bit Average QE Blind Pixel method available from outside (only for MC!)
1147//
1148void MCalibrationQEPix::SetAverageQEBlindPixelAvailable ( Bool_t b )
1149{
1150 if (b)
1151 SETBIT(fAvailableFlags,kAverageQEBlindPixelAvailable);
1152 else
1153 CLRBIT(fAvailableFlags,kAverageQEBlindPixelAvailable);
1154}
1155
1156// ------------------------------------------------------------------------------
1157//
1158// Set the bit Average QE combination of three methods available from outside (only for MC!)
1159//
1160void MCalibrationQEPix::SetAverageQECombinedAvailable ( Bool_t b )
1161{
1162 if (b)
1163 SETBIT(fAvailableFlags,kAverageQECombinedAvailable);
1164 else
1165 CLRBIT(fAvailableFlags,kAverageQECombinedAvailable);
1166}
1167
1168// ------------------------------------------------------------------------------
1169//
1170// Set the bit Average QE F-Factor method available from outside (only for MC!)
1171//
1172void MCalibrationQEPix::SetAverageQEFFactorAvailable ( Bool_t b )
1173{
1174 if (b)
1175 SETBIT(fAvailableFlags,kAverageQEFFactorAvailable);
1176 else
1177 CLRBIT(fAvailableFlags,kAverageQEFFactorAvailable);
1178}
1179
1180// ------------------------------------------------------------------------------
1181//
1182// Set the bit Average QE PIN Diode method available from outside (only for MC!)
1183//
1184void MCalibrationQEPix::SetAverageQEPINDiodeAvailable ( Bool_t b )
1185{
1186 if (b)
1187 SETBIT(fAvailableFlags,kAverageQEPINDiodeAvailable);
1188 else
1189 CLRBIT(fAvailableFlags,kAverageQEPINDiodeAvailable);
1190}
1191
1192// ------------------------------------------------------------------------------
1193//
1194// Set the bit QE Blind Pixel method available from colour "col"
1195//
1196void MCalibrationQEPix::SetBlindPixelMethodValid ( Bool_t b, MCalibrationCam::PulserColor_t col )
1197{
1198 if (b)
1199 SETBIT(fValidFlags[ col ],kBlindPixelMethodValid);
1200 else
1201 CLRBIT(fValidFlags[ col ],kBlindPixelMethodValid);
1202}
1203
1204// ------------------------------------------------------------------------------
1205//
1206// Set the bit QE Combination of three methods available from colour "col"
1207//
1208void MCalibrationQEPix::SetCombinedMethodValid ( Bool_t b, MCalibrationCam::PulserColor_t col )
1209{
1210 if (b)
1211 SETBIT(fValidFlags[ col ],kCombinedMethodValid);
1212 else
1213 CLRBIT(fValidFlags[ col ],kCombinedMethodValid);
1214}
1215
1216// ------------------------------------------------------------------------------
1217//
1218// Set the bit QE F-Factor method available from colour "col"
1219//
1220void MCalibrationQEPix::SetFFactorMethodValid ( Bool_t b, MCalibrationCam::PulserColor_t col )
1221{
1222 if (b)
1223 SETBIT(fValidFlags[ col ],kFFactorMethodValid);
1224 else
1225 CLRBIT(fValidFlags[ col ],kFFactorMethodValid);
1226}
1227
1228// ------------------------------------------------------------------------------
1229//
1230// Set the bit QE PIN Diode method available from colour "col"
1231//
1232void MCalibrationQEPix::SetPINDiodeMethodValid ( Bool_t b, MCalibrationCam::PulserColor_t col )
1233{
1234 if (b)
1235 SETBIT(fValidFlags[ col ],kPINDiodeMethodValid);
1236 else
1237 CLRBIT(fValidFlags[ col ],kPINDiodeMethodValid);
1238}
1239
1240// ------------------------------------------------------------------------------
1241//
1242// Update the Blind Pixel Method: Calculate new average QE's
1243//
1244Bool_t MCalibrationQEPix::UpdateBlindPixelMethod()
1245{
1246
1247 Float_t weightedav = 0.;
1248 Float_t sumweights = 0.;
1249
1250 AddAverageBlindPixelQEs(MCalibrationCam::kGREEN, weightedav, sumweights);
1251 AddAverageBlindPixelQEs(MCalibrationCam::kBLUE , weightedav, sumweights);
1252 AddAverageBlindPixelQEs(MCalibrationCam::kUV , weightedav, sumweights);
1253 AddAverageBlindPixelQEs(MCalibrationCam::kCT1 , weightedav, sumweights);
1254
1255 if (weightedav == 0. || sumweights == 0.)
1256 return kFALSE;
1257
1258 fAvNormBlindPixel = weightedav / sumweights;
1259 fAvNormBlindPixelVar = 1./ sumweights ;
1260
1261 SetAverageQEBlindPixelAvailable();
1262
1263 return kTRUE;
1264}
1265
1266// ------------------------------------------------------------------------------
1267//
1268// Update the Combination of the three Methods: Calculate new average QE's
1269//
1270Bool_t MCalibrationQEPix::UpdateCombinedMethod()
1271{
1272
1273 Float_t weightedav = 0.;
1274 Float_t sumweights = 0.;
1275
1276 AddAverageCombinedQEs(MCalibrationCam::kGREEN, weightedav, sumweights);
1277 AddAverageCombinedQEs(MCalibrationCam::kBLUE , weightedav, sumweights);
1278 AddAverageCombinedQEs(MCalibrationCam::kUV , weightedav, sumweights);
1279 AddAverageCombinedQEs(MCalibrationCam::kCT1 , weightedav, sumweights);
1280
1281 if (weightedav == 0. || sumweights == 0.)
1282 return kFALSE;
1283
1284 fAvNormCombined = weightedav / sumweights;
1285 fAvNormCombinedVar = 1./ sumweights ;
1286
1287 SetAverageQECombinedAvailable();
1288
1289 return kTRUE;
1290
1291}
1292
1293// ------------------------------------------------------------------------------
1294//
1295// Update the F-Factor Method: Calculate new average QE's
1296//
1297Bool_t MCalibrationQEPix::UpdateFFactorMethod()
1298{
1299
1300 Float_t weightedav = 0.;
1301 Float_t sumweights = 0.;
1302
1303 AddAverageFFactorQEs(MCalibrationCam::kGREEN, weightedav, sumweights);
1304 AddAverageFFactorQEs(MCalibrationCam::kBLUE , weightedav, sumweights);
1305 AddAverageFFactorQEs(MCalibrationCam::kUV , weightedav, sumweights);
1306 AddAverageFFactorQEs(MCalibrationCam::kCT1 , weightedav, sumweights);
1307
1308 if (weightedav == 0. || sumweights == 0.)
1309 return kFALSE;
1310
1311 fAvNormFFactor = weightedav / sumweights;
1312 fAvNormFFactorVar = 1./ sumweights ;
1313
1314 SetAverageQEFFactorAvailable();
1315
1316 return kTRUE;
1317
1318
1319}
1320
1321// ------------------------------------------------------------------------------
1322//
1323// Update the PIN Diode Method: Calculate new average QE's
1324//
1325Bool_t MCalibrationQEPix::UpdatePINDiodeMethod()
1326{
1327
1328 Float_t weightedav = 0.;
1329 Float_t sumweights = 0.;
1330
1331 AddAveragePINDiodeQEs(MCalibrationCam::kGREEN, weightedav, sumweights);
1332 AddAveragePINDiodeQEs(MCalibrationCam::kBLUE , weightedav, sumweights);
1333 AddAveragePINDiodeQEs(MCalibrationCam::kUV , weightedav, sumweights);
1334 AddAveragePINDiodeQEs(MCalibrationCam::kCT1 , weightedav, sumweights);
1335
1336 if (weightedav == 0. || sumweights == 0.)
1337 return kFALSE;
1338
1339 fAvNormPINDiode = weightedav / sumweights;
1340 fAvNormPINDiodeVar = 1./ sumweights ;
1341
1342 SetAverageQEPINDiodeAvailable();
1343
1344 return kTRUE;
1345
1346
1347}
1348
Note: See TracBrowser for help on using the repository browser.