Jpp  pmt_effective_area_update_2
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Toulon.hh
Go to the documentation of this file.
1 
2 #ifndef __JPHYSICS__TOULON__
3 #define __JPHYSICS__TOULON__
4 
5 #include <map>
6 #include <cmath>
7 
8 #include "JPhysics/JConstants.hh"
10 
11 
12 /**
13  * \author mdejong
14  */
15 
16 namespace TOULON {
17 
18  using JPHYSICS::PI;
23 
24 
25  /**
26  * Photo-cathode area 10 inch PMT.
27  *
28  * \return photo-cathode area [m^2]
29  */
30  inline const double getPhotocathodeArea()
31  {
32  return 440e-4; // photo-cathode area [m^2]
33  }
34 
35 
36  /**
37  * Absoption length
38  *
39  * \param lambda wavelength of light [nm]
40  * \return absorption length [m]
41  */
42  inline double getAbsorptionLength(const double lambda)
43  {
44  typedef std::map<double, double> map_t;
45 
46  static map_t zmap;
47 
48  if (zmap.empty()) {
49 
50  zmap[290.0] = 0.0;
51  zmap[300.0] = 7.194;
52  zmap[310.0] = 9.174;
53  zmap[320.0] = 10.571;
54  zmap[330.0] = 12.626;
55  zmap[340.0] = 14.085;
56  zmap[350.0] = 15.898;
57  zmap[360.0] = 18.939;
58  zmap[370.0] = 21.142;
59  zmap[380.0] = 24.096;
60  zmap[390.0] = 27.548;
61  zmap[400.0] = 30.769;
62  zmap[410.0] = 34.364;
63  zmap[420.0] = 39.216;
64  zmap[430.0] = 42.194;
65  zmap[440.0] = 45.872;
66  zmap[450.0] = 50.000;
67  zmap[460.0] = 52.356;
68  zmap[470.0] = 54.945;
69  zmap[480.0] = 54.945;
70  zmap[490.0] = 51.020;
71  zmap[500.0] = 38.910;
72  zmap[510.0] = 28.011;
73  zmap[520.0] = 20.964;
74  zmap[530.0] = 19.724;
75  zmap[540.0] = 17.921;
76  zmap[550.0] = 15.674;
77  zmap[560.0] = 14.124;
78  zmap[570.0] = 12.516;
79  zmap[580.0] = 9.259;
80  zmap[590.0] = 6.369;
81  zmap[600.0] = 4.098;
82  zmap[610.0] = 3.460;
83  zmap[620.0] = 0.0;
84  }
85 
86  const double x = lambda;
87 
88  if (x > zmap.begin()->first && x < zmap.rbegin()->first) {
89 
90  map_t::const_iterator i = zmap.lower_bound(x);
91  map_t::const_iterator j = i;
92 
93  --j;
94 
95  if (i == zmap.begin()) {
96  ++i;
97  ++j;
98  }
99 
100  const double x1 = i->first;
101  const double x2 = j->first;
102 
103  const double y1 = i->second;
104  const double y2 = j->second;
105 
106  return y1 + (y2 - y1) * (x - x1) / (x2 - x1);
107 
108  } else
109 
110  return 0.0;
111  }
112 
113 
114  /**
115  * Mie scattering length
116  *
117  * \param lambda wavelength of light [nm]
118  * \return scattering length [m]
119  */
120  inline double getMieScatteringLength(const double lambda)
121  {
122  typedef std::map<double, double> map_t;
123 
124  static map_t zmap;
125 
126  if (zmap.empty()) {
127 
128  zmap[300.0] = 32.290;
129  zmap[310.0] = 34.000;
130  zmap[320.0] = 35.730;
131  zmap[330.0] = 37.480;
132  zmap[340.0] = 39.260;
133  zmap[350.0] = 41.070;
134  zmap[360.0] = 42.890;
135  zmap[370.0] = 44.740;
136  zmap[380.0] = 46.600;
137  zmap[390.0] = 48.490;
138  zmap[400.0] = 50.390;
139  zmap[410.0] = 52.310;
140  zmap[420.0] = 54.250;
141  zmap[430.0] = 56.210;
142  zmap[440.0] = 58.180;
143  zmap[450.0] = 60.160;
144  zmap[460.0] = 62.160;
145  zmap[470.0] = 64.180;
146  zmap[480.0] = 66.210;
147  zmap[490.0] = 68.240;
148  zmap[500.0] = 70.300;
149  zmap[510.0] = 72.360;
150  zmap[520.0] = 74.430;
151  zmap[530.0] = 76.510;
152  zmap[540.0] = 78.610;
153  zmap[550.0] = 80.710;
154  zmap[560.0] = 82.820;
155  zmap[570.0] = 84.940;
156  zmap[580.0] = 87.070;
157  zmap[590.0] = 89.200;
158  zmap[600.0] = 91.340;
159  zmap[610.0] = 93.490;
160  zmap[620.0] = 95.000;
161  }
162 
163  const double x = lambda;
164 
165  if (x > zmap.begin()->first && x < zmap.rbegin()->first) {
166 
167  map_t::const_iterator i = zmap.lower_bound(x);
168  map_t::const_iterator j = i;
169 
170  --j;
171 
172  if (i == zmap.begin()) {
173  ++i;
174  ++j;
175  }
176 
177  const double x1 = i->first;
178  const double x2 = j->first;
179 
180  const double y1 = i->second;
181  const double y2 = j->second;
182 
183  return y1 + (y2 - y1) * (x - x1) / (x2 - x1);
184 
185  } else
186 
187  return 0.0;
188  }
189 
190 
191  /**
192  * Rayleigh scattering length
193  *
194  * \param lambda wavelength of light [nm]
195  * \return scattering length [m]
196  */
197  inline double getRayleighScatteringLength(const double lambda)
198  {
199  typedef std::map<double, double> map_t;
200 
201  static map_t zmap;
202 
203  if (zmap.empty()) {
204 
205  zmap[300.0] = 43.410;
206  zmap[310.0] = 49.990;
207  zmap[320.0] = 57.300;
208  zmap[330.0] = 65.400;
209  zmap[340.0] = 74.360;
210  zmap[350.0] = 84.230;
211  zmap[360.0] = 95.080;
212  zmap[370.0] = 106.970;
213  zmap[380.0] = 119.970;
214  zmap[390.0] = 134.140;
215  zmap[400.0] = 149.570;
216  zmap[410.0] = 166.330;
217  zmap[420.0] = 184.490;
218  zmap[430.0] = 204.130;
219  zmap[440.0] = 225.340;
220  zmap[450.0] = 248.200;
221  zmap[460.0] = 272.800;
222  zmap[470.0] = 299.230;
223  zmap[480.0] = 327.590;
224  zmap[490.0] = 357.960;
225  zmap[500.0] = 390.450;
226  zmap[510.0] = 425.150;
227  zmap[520.0] = 462.170;
228  zmap[530.0] = 501.620;
229  zmap[540.0] = 543.610;
230  zmap[550.0] = 588.240;
231  zmap[560.0] = 635.620;
232  zmap[570.0] = 685.890;
233  zmap[580.0] = 739.150;
234  zmap[590.0] = 795.530;
235  zmap[600.0] = 855.150;
236  zmap[610.0] = 918.140;
237  zmap[620.0] = 979.000;
238  }
239 
240  const double x = lambda;
241 
242  if (x > zmap.begin()->first && x < zmap.rbegin()->first) {
243 
244  map_t::const_iterator i = zmap.lower_bound(x);
245  map_t::const_iterator j = i;
246 
247  --j;
248 
249  if (i == zmap.begin()) {
250  ++i;
251  ++j;
252  }
253 
254  const double x1 = i->first;
255  const double x2 = j->first;
256 
257  const double y1 = i->second;
258  const double y2 = j->second;
259 
260  return y1 + (y2 - y1) * (x - x1) / (x2 - x1);
261 
262  } else
263 
264  return 0.0;
265  }
266 
267 
268  /**
269  * Auxiliary method to describe light scattering in water (Rayleigh)
270  *
271  * \param a angular dependence parameter
272  * \param x cosine scattering angle
273  * \return probability
274  */
275  inline double rayleigh(const double a,
276  const double x)
277 
278  {
279  const double a0 = 1.0 / (1.0 + a/3.0) / (4*PI);
280 
281  return a0 * (1.0 + a*x*x);
282  }
283 
284 
285  /**
286  * Auxiliary method to describe light scattering in water (Rayleigh)
287  *
288  * \param x cosine scattering angle
289  * \return probability
290  */
291  inline double rayleigh(const double x)
292  {
293  return rayleigh(0.853, x);
294  }
295 
296 
297  /**
298  * Function to describe light scattering in water.
299  *
300  * \param ct cosine scattering angle
301  * \return probability
302  */
303  inline double getPetzholdScatteringProbability(const double ct)
304  {
305  static JPolint2Function1D_t f1;
306 
307  if (f1.empty()) {
308 
309  f1[+0.0017] = +19.377;
310  f1[+0.0022] = +17.907;
311  f1[+0.0028] = +16.464;
312  f1[+0.0035] = +15.333;
313  f1[+0.0044] = +14.148;
314  f1[+0.0055] = +13.043;
315  f1[+0.0069] = +12.059;
316  f1[+0.0087] = +12.021;
317  f1[+0.0110] = +9.992;
318  f1[+0.0139] = +8.898;
319  f1[+0.0175] = +7.853;
320  f1[+0.0220] = +6.845;
321  f1[+0.0277] = +5.900;
322  f1[+0.0348] = +4.989;
323  f1[+0.0438] = +4.175;
324  f1[+0.0552] = +3.473;
325  f1[+0.0695] = +2.870;
326  f1[+0.0875] = +2.358;
327  f1[+0.1101] = +1.938;
328  f1[+0.1386] = +1.579;
329  f1[+0.1745] = +1.258;
330  f1[+0.2618] = +0.796;
331  f1[+0.3491] = +0.525;
332  f1[+0.4363] = +0.391;
333  f1[+0.5236] = +0.270;
334  f1[+0.6109] = +0.214;
335  f1[+0.6981] = +0.170;
336  f1[+0.7854] = +0.136;
337  f1[+0.8727] = +0.110;
338  f1[+0.9599] = +0.087;
339  f1[+1.0472] = +0.071;
340  f1[+1.1345] = +0.060;
341  f1[+1.2217] = +0.050;
342  f1[+1.3090] = +0.042;
343  f1[+1.3963] = +0.036;
344  f1[+1.4835] = +0.031;
345  f1[+1.5708] = +0.027;
346  f1[+1.6581] = +0.024;
347  f1[+1.7453] = +0.021;
348  f1[+1.8326] = +0.019;
349  f1[+1.9199] = +0.017;
350  f1[+2.0071] = +0.016;
351  f1[+2.0944] = +0.015;
352  f1[+2.1817] = +0.013;
353  f1[+2.2689] = +0.012;
354  f1[+2.3562] = +0.011;
355  f1[+2.4435] = +0.009;
356  f1[+2.5307] = +0.008;
357  f1[+2.6180] = +0.007;
358  f1[+2.7053] = +0.007;
359  f1[+2.7925] = +0.006;
360  f1[+2.8798] = +0.005;
361  f1[+2.9671] = +0.003;
362  f1[+3.0543] = +0.002;
363  f1[+3.1416] = -0.000;
364 
365  for (JPolint1Function1D_t::iterator i = f1.begin(); i != f1.end(); ++i) {
366 
367  const double x = i->getX();
368  const double y = i->getY();
369 
370  i->setValue(x*y);
371  }
372 
373  f1.compile();
374 
375  f1.setExceptionHandler(new JPolint2Function1D_t::JDefaultResult(0.0));
376  }
377 
378  const double x = acos(ct);
379 
380  return f1(x) / x;
381  }
382 
383 
384  /**
385  * Angular acceptence of Antares PMT
386  *
387  * \param x cosine of angle of incidence
388  * \return probability
389  */
390  inline double getAngularAcceptance(const double x)
391  {
392  static JGridPolint1Function1D_t f1;
393 
394  if (f1.empty()) {
395 
396  f1[-1.000] = +0.997;
397  f1[-0.995] = +0.992;
398  f1[-0.990] = +0.986;
399  f1[-0.985] = +0.984;
400  f1[-0.980] = +0.983;
401  f1[-0.975] = +0.981;
402  f1[-0.970] = +0.976;
403  f1[-0.965] = +0.976;
404  f1[-0.960] = +0.974;
405  f1[-0.955] = +0.971;
406  f1[-0.950] = +0.970;
407  f1[-0.945] = +0.967;
408  f1[-0.940] = +0.964;
409  f1[-0.935] = +0.960;
410  f1[-0.930] = +0.956;
411  f1[-0.925] = +0.953;
412  f1[-0.920] = +0.949;
413  f1[-0.915] = +0.944;
414  f1[-0.910] = +0.940;
415  f1[-0.905] = +0.936;
416  f1[-0.900] = +0.934;
417  f1[-0.895] = +0.930;
418  f1[-0.890] = +0.926;
419  f1[-0.885] = +0.923;
420  f1[-0.880] = +0.918;
421  f1[-0.875] = +0.911;
422  f1[-0.870] = +0.905;
423  f1[-0.865] = +0.900;
424  f1[-0.860] = +0.895;
425  f1[-0.855] = +0.891;
426  f1[-0.850] = +0.886;
427  f1[-0.845] = +0.881;
428  f1[-0.840] = +0.876;
429  f1[-0.835] = +0.871;
430  f1[-0.830] = +0.866;
431  f1[-0.825] = +0.862;
432  f1[-0.820] = +0.859;
433  f1[-0.815] = +0.855;
434  f1[-0.810] = +0.850;
435  f1[-0.805] = +0.844;
436  f1[-0.800] = +0.838;
437  f1[-0.795] = +0.834;
438  f1[-0.790] = +0.831;
439  f1[-0.785] = +0.828;
440  f1[-0.780] = +0.823;
441  f1[-0.775] = +0.819;
442  f1[-0.770] = +0.815;
443  f1[-0.765] = +0.811;
444  f1[-0.760] = +0.808;
445  f1[-0.755] = +0.803;
446  f1[-0.750] = +0.798;
447  f1[-0.745] = +0.793;
448  f1[-0.740] = +0.789;
449  f1[-0.735] = +0.785;
450  f1[-0.730] = +0.782;
451  f1[-0.725] = +0.779;
452  f1[-0.720] = +0.776;
453  f1[-0.715] = +0.771;
454  f1[-0.710] = +0.767;
455  f1[-0.705] = +0.764;
456  f1[-0.700] = +0.763;
457  f1[-0.695] = +0.763;
458  f1[-0.690] = +0.761;
459  f1[-0.685] = +0.759;
460  f1[-0.680] = +0.755;
461  f1[-0.675] = +0.749;
462  f1[-0.670] = +0.743;
463  f1[-0.665] = +0.739;
464  f1[-0.660] = +0.736;
465  f1[-0.655] = +0.734;
466  f1[-0.650] = +0.733;
467  f1[-0.645] = +0.731;
468  f1[-0.640] = +0.728;
469  f1[-0.635] = +0.723;
470  f1[-0.630] = +0.719;
471  f1[-0.625] = +0.716;
472  f1[-0.620] = +0.714;
473  f1[-0.615] = +0.712;
474  f1[-0.610] = +0.710;
475  f1[-0.605] = +0.706;
476  f1[-0.600] = +0.703;
477  f1[-0.595] = +0.699;
478  f1[-0.590] = +0.696;
479  f1[-0.585] = +0.693;
480  f1[-0.580] = +0.690;
481  f1[-0.575] = +0.688;
482  f1[-0.570] = +0.685;
483  f1[-0.565] = +0.683;
484  f1[-0.560] = +0.681;
485  f1[-0.555] = +0.679;
486  f1[-0.550] = +0.677;
487  f1[-0.545] = +0.675;
488  f1[-0.540] = +0.672;
489  f1[-0.535] = +0.668;
490  f1[-0.530] = +0.665;
491  f1[-0.525] = +0.661;
492  f1[-0.520] = +0.658;
493  f1[-0.515] = +0.654;
494  f1[-0.510] = +0.651;
495  f1[-0.505] = +0.647;
496  f1[-0.500] = +0.643;
497  f1[-0.495] = +0.640;
498  f1[-0.490] = +0.637;
499  f1[-0.485] = +0.633;
500  f1[-0.480] = +0.629;
501  f1[-0.475] = +0.626;
502  f1[-0.470] = +0.622;
503  f1[-0.465] = +0.618;
504  f1[-0.460] = +0.615;
505  f1[-0.455] = +0.612;
506  f1[-0.450] = +0.608;
507  f1[-0.445] = +0.604;
508  f1[-0.440] = +0.600;
509  f1[-0.435] = +0.596;
510  f1[-0.430] = +0.592;
511  f1[-0.425] = +0.588;
512  f1[-0.420] = +0.584;
513  f1[-0.415] = +0.579;
514  f1[-0.410] = +0.574;
515  f1[-0.405] = +0.569;
516  f1[-0.400] = +0.564;
517  f1[-0.395] = +0.560;
518  f1[-0.390] = +0.557;
519  f1[-0.385] = +0.555;
520  f1[-0.380] = +0.553;
521  f1[-0.375] = +0.550;
522  f1[-0.370] = +0.546;
523  f1[-0.365] = +0.540;
524  f1[-0.360] = +0.534;
525  f1[-0.355] = +0.530;
526  f1[-0.350] = +0.527;
527  f1[-0.345] = +0.524;
528  f1[-0.340] = +0.521;
529  f1[-0.335] = +0.518;
530  f1[-0.330] = +0.514;
531  f1[-0.325] = +0.510;
532  f1[-0.320] = +0.506;
533  f1[-0.315] = +0.502;
534  f1[-0.310] = +0.498;
535  f1[-0.305] = +0.495;
536  f1[-0.300] = +0.491;
537  f1[-0.295] = +0.488;
538  f1[-0.290] = +0.485;
539  f1[-0.285] = +0.481;
540  f1[-0.280] = +0.478;
541  f1[-0.275] = +0.474;
542  f1[-0.270] = +0.471;
543  f1[-0.265] = +0.468;
544  f1[-0.260] = +0.465;
545  f1[-0.255] = +0.461;
546  f1[-0.250] = +0.458;
547  f1[-0.245] = +0.454;
548  f1[-0.240] = +0.451;
549  f1[-0.235] = +0.447;
550  f1[-0.230] = +0.445;
551  f1[-0.225] = +0.442;
552  f1[-0.220] = +0.439;
553  f1[-0.215] = +0.436;
554  f1[-0.210] = +0.433;
555  f1[-0.205] = +0.429;
556  f1[-0.200] = +0.425;
557  f1[-0.195] = +0.421;
558  f1[-0.190] = +0.418;
559  f1[-0.185] = +0.414;
560  f1[-0.180] = +0.411;
561  f1[-0.175] = +0.408;
562  f1[-0.170] = +0.405;
563  f1[-0.165] = +0.402;
564  f1[-0.160] = +0.399;
565  f1[-0.155] = +0.396;
566  f1[-0.150] = +0.393;
567  f1[-0.145] = +0.389;
568  f1[-0.140] = +0.386;
569  f1[-0.135] = +0.382;
570  f1[-0.130] = +0.379;
571  f1[-0.125] = +0.375;
572  f1[-0.120] = +0.372;
573  f1[-0.115] = +0.369;
574  f1[-0.110] = +0.366;
575  f1[-0.105] = +0.363;
576  f1[-0.100] = +0.359;
577  f1[-0.095] = +0.356;
578  f1[-0.090] = +0.353;
579  f1[-0.085] = +0.350;
580  f1[-0.080] = +0.347;
581  f1[-0.075] = +0.345;
582  f1[-0.070] = +0.342;
583  f1[-0.065] = +0.339;
584  f1[-0.060] = +0.336;
585  f1[-0.055] = +0.333;
586  f1[-0.050] = +0.330;
587  f1[-0.045] = +0.327;
588  f1[-0.040] = +0.325;
589  f1[-0.035] = +0.322;
590  f1[-0.030] = +0.319;
591  f1[-0.025] = +0.316;
592  f1[-0.020] = +0.313;
593  f1[-0.015] = +0.310;
594  f1[-0.010] = +0.308;
595  f1[-0.005] = +0.305;
596  f1[+0.000] = +0.302;
597  f1[+0.005] = +0.299;
598  f1[+0.010] = +0.296;
599  f1[+0.015] = +0.293;
600  f1[+0.020] = +0.289;
601  f1[+0.025] = +0.286;
602  f1[+0.030] = +0.283;
603  f1[+0.035] = +0.280;
604  f1[+0.040] = +0.277;
605  f1[+0.045] = +0.275;
606  f1[+0.050] = +0.272;
607  f1[+0.055] = +0.270;
608  f1[+0.060] = +0.268;
609  f1[+0.065] = +0.265;
610  f1[+0.070] = +0.262;
611  f1[+0.075] = +0.259;
612  f1[+0.080] = +0.256;
613  f1[+0.085] = +0.252;
614  f1[+0.090] = +0.249;
615  f1[+0.095] = +0.246;
616  f1[+0.100] = +0.244;
617  f1[+0.105] = +0.241;
618  f1[+0.110] = +0.239;
619  f1[+0.115] = +0.237;
620  f1[+0.120] = +0.234;
621  f1[+0.125] = +0.231;
622  f1[+0.130] = +0.229;
623  f1[+0.135] = +0.226;
624  f1[+0.140] = +0.224;
625  f1[+0.145] = +0.221;
626  f1[+0.150] = +0.218;
627  f1[+0.155] = +0.215;
628  f1[+0.160] = +0.212;
629  f1[+0.165] = +0.209;
630  f1[+0.170] = +0.206;
631  f1[+0.175] = +0.204;
632  f1[+0.180] = +0.202;
633  f1[+0.185] = +0.200;
634  f1[+0.190] = +0.199;
635  f1[+0.195] = +0.196;
636  f1[+0.200] = +0.194;
637  f1[+0.205] = +0.190;
638  f1[+0.210] = +0.187;
639  f1[+0.215] = +0.185;
640  f1[+0.220] = +0.182;
641  f1[+0.225] = +0.180;
642  f1[+0.230] = +0.177;
643  f1[+0.235] = +0.175;
644  f1[+0.240] = +0.173;
645  f1[+0.245] = +0.171;
646  f1[+0.250] = +0.169;
647  f1[+0.255] = +0.166;
648  f1[+0.260] = +0.164;
649  f1[+0.265] = +0.161;
650  f1[+0.270] = +0.159;
651  f1[+0.275] = +0.156;
652  f1[+0.280] = +0.154;
653  f1[+0.285] = +0.152;
654  f1[+0.290] = +0.150;
655  f1[+0.295] = +0.147;
656  f1[+0.300] = +0.145;
657  f1[+0.305] = +0.143;
658  f1[+0.310] = +0.141;
659  f1[+0.315] = +0.138;
660  f1[+0.320] = +0.136;
661  f1[+0.325] = +0.133;
662  f1[+0.330] = +0.131;
663  f1[+0.335] = +0.128;
664  f1[+0.340] = +0.126;
665  f1[+0.345] = +0.123;
666  f1[+0.350] = +0.121;
667  f1[+0.355] = +0.118;
668  f1[+0.360] = +0.115;
669  f1[+0.365] = +0.113;
670  f1[+0.370] = +0.110;
671  f1[+0.375] = +0.107;
672  f1[+0.380] = +0.103;
673  f1[+0.385] = +0.100;
674  f1[+0.390] = +0.097;
675  f1[+0.395] = +0.095;
676  f1[+0.400] = +0.092;
677  f1[+0.405] = +0.089;
678  f1[+0.410] = +0.086;
679  f1[+0.415] = +0.082;
680  f1[+0.420] = +0.079;
681  f1[+0.425] = +0.076;
682  f1[+0.430] = +0.074;
683  f1[+0.435] = +0.072;
684  f1[+0.440] = +0.069;
685  f1[+0.445] = +0.066;
686  f1[+0.450] = +0.063;
687  f1[+0.455] = +0.060;
688  f1[+0.460] = +0.057;
689  f1[+0.465] = +0.054;
690  f1[+0.470] = +0.051;
691  f1[+0.475] = +0.048;
692  f1[+0.480] = +0.046;
693  f1[+0.485] = +0.043;
694  f1[+0.490] = +0.040;
695  f1[+0.495] = +0.038;
696  f1[+0.500] = +0.035;
697  f1[+0.505] = +0.032;
698  f1[+0.510] = +0.029;
699  f1[+0.515] = +0.027;
700  f1[+0.520] = +0.024;
701  f1[+0.525] = +0.022;
702  f1[+0.530] = +0.019;
703  f1[+0.535] = +0.017;
704  f1[+0.540] = +0.015;
705  f1[+0.545] = +0.013;
706  f1[+0.550] = +0.011;
707  f1[+0.555] = +0.009;
708  f1[+0.560] = +0.008;
709  f1[+0.565] = +0.006;
710  f1[+0.570] = +0.005;
711  f1[+0.575] = +0.003;
712  f1[+0.580] = +0.002;
713  f1[+0.585] = +0.002;
714  f1[+0.590] = +0.001;
715  f1[+0.595] = +0.001;
716  f1[+0.600] = +0.001;
717  f1[+0.605] = +0.001;
718  f1[+0.610] = +0.001;
719  f1[+0.615] = +0.001;
720  f1[+0.620] = +0.001;
721  f1[+0.625] = +0.001;
722  f1[+0.630] = +0.001;
723  f1[+0.635] = +0.000;
724  f1[+0.640] = +0.000;
725  f1[+0.645] = +0.000;
726  f1[+0.650] = +0.000;
727  f1[+0.655] = +0.000;
728  f1[+0.660] = +0.000;
729  f1[+0.665] = +0.000;
730  f1[+0.670] = +0.000;
731  f1[+0.675] = +0.000;
732  f1[+0.680] = +0.000;
733  f1[+0.685] = +0.000;
734  f1[+0.690] = +0.000;
735  f1[+0.695] = +0.000;
736  f1[+0.700] = +0.000;
737  f1[+0.705] = +0.000;
738  f1[+0.710] = +0.000;
739  f1[+0.715] = +0.000;
740  f1[+0.720] = +0.000;
741  f1[+0.725] = +0.000;
742  f1[+0.730] = +0.000;
743  f1[+0.735] = +0.000;
744  f1[+0.740] = +0.000;
745  f1[+0.745] = +0.000;
746  f1[+0.750] = +0.000;
747  f1[+0.755] = +0.000;
748  f1[+0.760] = +0.000;
749  f1[+0.765] = +0.000;
750  f1[+0.770] = +0.000;
751  f1[+0.775] = +0.000;
752  f1[+0.780] = +0.000;
753  f1[+0.785] = +0.000;
754  f1[+0.790] = +0.000;
755  f1[+0.795] = +0.000;
756  f1[+0.800] = +0.000;
757  f1[+0.805] = +0.000;
758  f1[+0.810] = +0.000;
759  f1[+0.815] = +0.000;
760  f1[+0.820] = +0.000;
761  f1[+0.825] = +0.000;
762  f1[+0.830] = +0.000;
763  f1[+0.835] = +0.000;
764  f1[+0.840] = +0.000;
765  f1[+0.845] = +0.000;
766  f1[+0.850] = +0.000;
767  f1[+0.855] = +0.000;
768  f1[+0.860] = +0.000;
769  f1[+0.865] = +0.000;
770  f1[+0.870] = +0.000;
771  f1[+0.875] = +0.000;
772  f1[+0.880] = +0.000;
773  f1[+0.885] = +0.000;
774  f1[+0.890] = +0.000;
775  f1[+0.895] = +0.000;
776  f1[+0.900] = +0.000;
777  f1[+0.905] = +0.000;
778  f1[+0.910] = +0.000;
779  f1[+0.915] = +0.000;
780  f1[+0.920] = +0.000;
781  f1[+0.925] = +0.000;
782  f1[+0.930] = +0.000;
783  f1[+0.935] = +0.000;
784  f1[+0.940] = +0.000;
785  f1[+0.945] = +0.000;
786  f1[+0.950] = +0.000;
787  f1[+0.955] = +0.000;
788  f1[+0.960] = +0.000;
789  f1[+0.965] = +0.000;
790  f1[+0.970] = +0.000;
791  f1[+0.975] = +0.000;
792  f1[+0.980] = +0.000;
793  f1[+0.985] = +0.000;
794  f1[+0.990] = +0.000;
795  f1[+0.995] = +0.000;
796  f1[+1.000] = -0.000;
797 
798  f1.compile();
799 
800  f1.setExceptionHandler(new JGridPolint1Function1D_t::JDefaultResult(0.0));
801  }
802 
803 
804  return f1(x);
805  }
806 
807 
808  /**
809  * Quantum efficiency of 10-inch Hamamatsu PMT
810  *
811  * \param lambda wavelength of photon [nm]
812  * \param option include absorption in glass and gel (if true, otherwise not)
813  * \return quantum efficiency
814  */
815  inline double getQE(const double lambda, const bool option)
816  {
817  class tuple {
818  public:
819  tuple(const double __QE,
820  const double __l_gel,
821  const double __l_glass) :
822  QE (__QE),
823  l_gel (__l_gel),
824  l_glass(__l_glass)
825  {}
826 
827  double QE; // Quantum efficiiency
828  double l_gel; // gel absorption length [cm]
829  double l_glass; // glass absorption length [cm]
830  };
831 
832  static const tuple ntuple[] = {
833  tuple(0.000e-2, 0.00, 0.00),
834  tuple(1.988e-2, 100.81, 148.37),
835  tuple(2.714e-2, 99.94, 142.87),
836  tuple(3.496e-2, 99.89, 135.64),
837  tuple(4.347e-2, 96.90, 134.58),
838  tuple(5.166e-2, 96.42, 138.27),
839  tuple(6.004e-2, 94.36, 142.40),
840  tuple(6.885e-2, 89.09, 147.16),
841  tuple(8.105e-2, 90.10, 151.80),
842  tuple(10.13e-2, 86.95, 150.88),
843  tuple(13.03e-2, 85.88, 145.68),
844  tuple(15.29e-2, 84.49, 139.70),
845  tuple(16.37e-2, 81.08, 126.55),
846  tuple(17.11e-2, 78.18, 118.86),
847  tuple(17.86e-2, 76.48, 113.90),
848  tuple(18.95e-2, 74.55, 116.08),
849  tuple(20.22e-2, 72.31, 109.23),
850  tuple(21.26e-2, 68.05, 81.63),
851  tuple(22.10e-2, 66.91, 65.66),
852  tuple(22.65e-2, 64.48, 77.30),
853  tuple(23.07e-2, 62.53, 73.02),
854  tuple(23.14e-2, 59.38, 81.25),
855  tuple(23.34e-2, 56.64, 128.04),
856  tuple(22.95e-2, 53.29, 61.84),
857  tuple(22.95e-2, 48.96, 19.23),
858  tuple(22.74e-2, 45.71, 27.21),
859  tuple(23.48e-2, 41.88, 18.09),
860  tuple(22.59e-2, 37.14, 8.41),
861  tuple(20.61e-2, 30.49, 3.92),
862  tuple(17.68e-2, 23.08, 1.82),
863  tuple(13.18e-2, 15.60, 0.84),
864  tuple(7.443e-2, 8.00, 0.39),
865  tuple(2.526e-2, 0.00, 0.17),
866  tuple(0.000e-2, 0.00, 0.00)
867  };
868 
869  static const double cola = 0.9; // collection efficiency
870  static const double x_glass = 1.5; // glass thickness [cm]
871  static const double x_gel = 1.0; // gel thickness [cm]
872 
873  // ntuple
874  static const int N = sizeof(ntuple) / sizeof(ntuple[0]) - 1;
875 
876  static const double xmax = 620.0; // maximal wavelength [nm] (tuple[ 0 ])
877  static const double xmin = 290.0; // minimal wavelength [nm] (tuple[N-1])
878 
879  const double x = lambda;
880 
881  double y = 0.0;
882 
883  if (x > xmin && x < xmax) {
884 
885  const int i = (int) (N * (x - xmax) / (xmin - xmax));
886  const int j = (i == N ? i - 1 : i + 1);
887 
888  const double x1 = xmax + i * (xmin - xmax) / N;
889  const double x2 = xmax + j * (xmin - xmax) / N;
890 
891  const double dx = (x - x1) / (x1 - x2);
892 
893  const double QE = ntuple[i].QE + (ntuple[i].QE - ntuple[j].QE ) * dx;
894  const double l_gel = ntuple[i].l_gel + (ntuple[i].l_gel - ntuple[j].l_gel ) * dx;
895  const double l_glass = ntuple[i].l_glass + (ntuple[i].l_glass - ntuple[j].l_glass) * dx;
896 
897  y = cola * QE;
898 
899  if (option) {
900 
901  if (l_glass > 0.0 && l_gel > 0.0)
902  y *= exp(-x_glass/l_glass) * exp(-x_gel/l_gel);
903  else
904  y = 0.0;
905  }
906  }
907 
908  return y;
909  }
910 
911 
912  /**
913  * Quantum efficiency of 10-inch Hamamatsu PMT
914  *
915  * \param lambda wavelength of photon [nm]
916  * \return quantum efficiency
917  */
918  inline double getQE(const double lambda)
919  {
920  return getQE(lambda, true);
921  }
922 }
923 
924 
925 #endif
Type definition of a 2nd degree polynomial interpolation with result type double. ...
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable STRING $argv[2] set_array QUANTILES set_variable FORMULA *[0] exp(-0.5 *(x-[1])*(x-[1])/([2]*[2]))" set_variable MODULE `getModule -a $DETECTOR -L "$STRING 0"` typeset -Z 4 STRING JOpera1D -f hydrophone.root
Type definition of a 3rd degree polynomial interpolation with result type double. ...
Type definition of a 1st degree polynomial interpolation based on a JGridCollection with result type ...
Physics constants.
static const double PI
Mathematical constants.
double getQE(const double lambda, const bool option)
Quantum efficiency of 10-inch Hamamatsu PMT.
Definition: Toulon.hh:815
const double getPhotocathodeArea()
Photo-cathode area 10 inch PMT.
Definition: Toulon.hh:30
double getAngularAcceptance(const double x)
Angular acceptence of Antares PMT.
Definition: Toulon.hh:390
void setExceptionHandler(const JSupervisor &supervisor)
Set the supervisor for handling of exceptions.
Definition: JFunctional.hh:288
Type definition of a 1st degree polynomial interpolation with result type double. ...
double getRayleighScatteringLength(const double lambda)
Rayleigh scattering length.
Definition: Toulon.hh:197
then JCalibrateToT a
Definition: JTuneHV.sh:116
double rayleigh(const double a, const double x)
Auxiliary method to describe light scattering in water (Rayleigh)
Definition: Toulon.hh:275
int j
Definition: JPolint.hh:666
double getMieScatteringLength(const double lambda)
Mie scattering length.
Definition: Toulon.hh:120
then usage $script[input file[working directory[option]]] nWhere option can be N
Definition: JMuonPostfit.sh:36
double getAbsorptionLength(const double lambda)
Absoption length.
Definition: Toulon.hh:42
double getPetzholdScatteringProbability(const double ct)
Function to describe light scattering in water.
Definition: Toulon.hh:303