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 | // MCalibrationChargePix //
|
---|
28 | // //
|
---|
29 | // Storage container of the calibrated Quantrum Efficiency of one pixel
|
---|
30 | // For the moment, only a fixed average QE is stored:
|
---|
31 | //
|
---|
32 | // - Average QE: (email David Paneque, 14.2.04):
|
---|
33 | //
|
---|
34 | // The conversion factor that comes purely from QE folded to a Cherenkov
|
---|
35 | // spectrum has to be multiplied by:
|
---|
36 | // * Plexiglass window -->> 0.96 X 0.96
|
---|
37 | // * PMT photoelectron collection efficiency -->> 0.9
|
---|
38 | // * Light guides efficiency -->> 0.94
|
---|
39 | //
|
---|
40 | // Concerning the light guides effiency estimation... Daniel Ferenc
|
---|
41 | // is preparing some work (simulations) to estimate it. Yet so far, he has
|
---|
42 | // been busy with other stuff, and this work is still UNfinished.
|
---|
43 | //
|
---|
44 | // The estimation I did comes from:
|
---|
45 | // 1) Reflectivity of light guide walls is 85 % (aluminum)
|
---|
46 | // 2) At ZERO degree light incidence, 37% of the light hits such walls
|
---|
47 | // (0.15X37%= 5.6% of light lost)
|
---|
48 | // 3) When increasing the light incidence angle, more and more light hits
|
---|
49 | // the walls.
|
---|
50 | //
|
---|
51 | // However, the loses due to larger amount of photons hitting the walls is more
|
---|
52 | // or less counteracted by the fact that more and more photon trajectories cross
|
---|
53 | // the PMT photocathode twice, increasing the effective sensitivity of the PMT.
|
---|
54 | //
|
---|
55 | // Jurgen Gebauer did some quick measurements about this issue. I attach a
|
---|
56 | // plot. You can see that the angular dependence is (more or less) in agreement
|
---|
57 | // with a CosTheta function (below 20-25 degrees),
|
---|
58 | // which is the variation of teh entrance window cross section. So, in
|
---|
59 | // first approximation, no loses when increasing light incidence angle;
|
---|
60 | // and therefore, the factor 0.94.
|
---|
61 | //
|
---|
62 | // So, summarizing... I would propose the following conversion factors
|
---|
63 | // (while working with CT1 cal box) in order to get the final number of photons
|
---|
64 | // from the detected measured size in ADC counts.
|
---|
65 | //
|
---|
66 | // Nph = ADC * FmethodConversionFactor / ConvPhe-PhFactor
|
---|
67 | //
|
---|
68 | // FmethodConversionFactor ; measured for individual pmts
|
---|
69 | //
|
---|
70 | // ConvPhe-PhFactor = 0.98 * 0.23 * 0.90 * 0.94 * 0.96 * 0.96 = 0.18
|
---|
71 | //
|
---|
72 | // I would not apply any smearing of this factor (which we have in nature),
|
---|
73 | // since we might be applying it to PMTs in the totally wrong direction.
|
---|
74 | //
|
---|
75 | //
|
---|
76 | /////////////////////////////////////////////////////////////////////////////
|
---|
77 | #include "MCalibrationQEPix.h"
|
---|
78 |
|
---|
79 | #include "MLog.h"
|
---|
80 | #include "MLogManip.h"
|
---|
81 |
|
---|
82 | ClassImp(MCalibrationQEPix);
|
---|
83 |
|
---|
84 | using namespace std;
|
---|
85 |
|
---|
86 | // --------------------------------------------------------------------------
|
---|
87 | //
|
---|
88 | // Default Constructor:
|
---|
89 | //
|
---|
90 | MCalibrationQEPix::MCalibrationQEPix(const char *name, const char *title)
|
---|
91 | : fPixId(-1)
|
---|
92 | {
|
---|
93 |
|
---|
94 | fName = name ? name : "MCalibrationQEPix";
|
---|
95 | fTitle = title ? title : "Container of the calibrated quantum efficiency ";
|
---|
96 |
|
---|
97 | Clear();
|
---|
98 |
|
---|
99 | }
|
---|
100 |
|
---|
101 | // ------------------------------------------------------------------------
|
---|
102 | //
|
---|
103 | // Invalidate values
|
---|
104 | //
|
---|
105 | void MCalibrationQEPix::Clear(Option_t *o)
|
---|
106 | {
|
---|
107 |
|
---|
108 | SetExcluded ( kFALSE );
|
---|
109 | SetQEValid ( kFALSE );
|
---|
110 |
|
---|
111 | fQEGreen = -1.;
|
---|
112 | fQEBlue = -1.;
|
---|
113 | fQEUV = -1.;
|
---|
114 | fQECT1 = -1.;
|
---|
115 |
|
---|
116 | fQEGreenErr = -1.;
|
---|
117 | fQEBlueErr = -1.;
|
---|
118 | fQEUVErr = -1.;
|
---|
119 | fQECT1Err = -1.;
|
---|
120 |
|
---|
121 | }
|
---|
122 |
|
---|
123 |
|
---|
124 | void MCalibrationQEPix::SetQE( const Float_t qe, const PulserColor_t col )
|
---|
125 | {
|
---|
126 |
|
---|
127 | switch (col)
|
---|
128 | {
|
---|
129 | case kGREEN:
|
---|
130 | fQEGreen = qe;
|
---|
131 | break;
|
---|
132 | case kBLUE:
|
---|
133 | fQEBlue = qe;
|
---|
134 | break;
|
---|
135 | case kUV:
|
---|
136 | fQEUV = qe;
|
---|
137 | break;
|
---|
138 | case kCT1:
|
---|
139 | fQECT1 = qe;
|
---|
140 | break;
|
---|
141 | default:
|
---|
142 | fQECT1 = qe;
|
---|
143 | break;
|
---|
144 | }
|
---|
145 | }
|
---|
146 |
|
---|
147 | void MCalibrationQEPix::SetQEErr( const Float_t qeerr, const PulserColor_t col )
|
---|
148 | {
|
---|
149 |
|
---|
150 | switch (col)
|
---|
151 | {
|
---|
152 | case kGREEN:
|
---|
153 | fQEGreenErr = qeerr;
|
---|
154 | break;
|
---|
155 | case kBLUE:
|
---|
156 | fQEBlueErr = qeerr;
|
---|
157 | break;
|
---|
158 | case kUV:
|
---|
159 | fQEUVErr = qeerr;
|
---|
160 | break;
|
---|
161 | case kCT1:
|
---|
162 | fQECT1Err = qeerr;
|
---|
163 | break;
|
---|
164 | default:
|
---|
165 | fQECT1Err = qeerr;
|
---|
166 | break;
|
---|
167 | }
|
---|
168 | }
|
---|
169 |
|
---|
170 |
|
---|
171 |
|
---|
172 | // --------------------------------------------------------------------------
|
---|
173 | //
|
---|
174 | // Set the Excluded Bit from outside
|
---|
175 | //
|
---|
176 | void MCalibrationQEPix::SetExcluded(Bool_t b )
|
---|
177 | {
|
---|
178 | b ? SETBIT(fFlags, kExcluded) : CLRBIT(fFlags, kExcluded);
|
---|
179 | }
|
---|
180 |
|
---|
181 | // --------------------------------------------------------------------------
|
---|
182 | //
|
---|
183 | // Set the Excluded Bit from outside
|
---|
184 | //
|
---|
185 | void MCalibrationQEPix::SetQEValid(Bool_t b )
|
---|
186 | {
|
---|
187 | b ? SETBIT(fFlags, kQEValid) : CLRBIT(fFlags, kQEValid);
|
---|
188 | }
|
---|
189 |
|
---|
190 |
|
---|
191 | Int_t MCalibrationQEPix::GetPixId() const
|
---|
192 | {
|
---|
193 | return fPixId;
|
---|
194 | }
|
---|
195 |
|
---|
196 | Float_t MCalibrationQEPix::GetQE(const PulserColor_t col ) const
|
---|
197 | {
|
---|
198 |
|
---|
199 | switch (col)
|
---|
200 | {
|
---|
201 | case kGREEN:
|
---|
202 | return fQEGreen;
|
---|
203 | break;
|
---|
204 | case kBLUE:
|
---|
205 | return fQEBlue;
|
---|
206 | break;
|
---|
207 | case kUV:
|
---|
208 | return fQEUV;
|
---|
209 | break;
|
---|
210 | case kCT1:
|
---|
211 | return fQECT1;
|
---|
212 | break;
|
---|
213 | default:
|
---|
214 | return fQECT1;
|
---|
215 | break;
|
---|
216 | }
|
---|
217 | }
|
---|
218 |
|
---|
219 | Float_t MCalibrationQEPix::GetQEErr(const PulserColor_t col ) const
|
---|
220 | {
|
---|
221 |
|
---|
222 | switch (col)
|
---|
223 | {
|
---|
224 | case kGREEN:
|
---|
225 | return fQEGreenErr;
|
---|
226 | break;
|
---|
227 | case kBLUE:
|
---|
228 | return fQEBlueErr;
|
---|
229 | break;
|
---|
230 | case kUV:
|
---|
231 | return fQEUVErr;
|
---|
232 | break;
|
---|
233 | case kCT1:
|
---|
234 | return fQECT1Err;
|
---|
235 | break;
|
---|
236 | default:
|
---|
237 | return fQECT1Err;
|
---|
238 | break;
|
---|
239 | }
|
---|
240 | }
|
---|
241 |
|
---|
242 |
|
---|
243 | Bool_t MCalibrationQEPix::IsExcluded() const
|
---|
244 | {
|
---|
245 | return TESTBIT(fFlags,kExcluded);
|
---|
246 | }
|
---|
247 |
|
---|
248 |
|
---|
249 | Bool_t MCalibrationQEPix::IsQEValid() const
|
---|
250 | {
|
---|
251 | return TESTBIT(fFlags, kQEValid);
|
---|
252 | }
|
---|
253 |
|
---|
254 |
|
---|
255 | //
|
---|
256 | // The check return kTRUE if:
|
---|
257 | //
|
---|
258 | // 1) Pixel has a fitted charge greater than fQELimit*PedRMS
|
---|
259 | // 2) Pixel has a fit error greater than fQEErrLimit
|
---|
260 | // 3) Pixel has a fitted charge greater its fQERelErrLimit times its charge error
|
---|
261 | // 4) Pixel has a charge sigma bigger than its Pedestal RMS
|
---|
262 | //
|
---|
263 | Bool_t MCalibrationQEPix::CheckQEValidity()
|
---|
264 | {
|
---|
265 |
|
---|
266 | SetQEValid();
|
---|
267 | return kTRUE;
|
---|
268 | }
|
---|