Jpp
JPDFToolkit.hh
Go to the documentation of this file.
1 #ifndef __JPHYSICS__JPDFTOOLKIT__
2 #define __JPHYSICS__JPDFTOOLKIT__
3 
4 #include <vector>
5 #include <cmath>
6 
7 #include "JLang/JCC.hh"
8 #include "JTools/JConstants.hh"
10 #include "JPhysics/JGeane.hh"
11 #include "JPhysics/JGeanx.hh"
12 #include "JPhysics/JGeant.hh"
13 #include "JPhysics/JGeanz.hh"
14 #include "JIO/JSerialisable.hh"
15 
16 /**
17  * \file
18  * Auxiliary methods for PDF calculations.
19  * \author mdejong
20  */
21 
22 namespace JPHYSICS {}
23 namespace JPP { using namespace JPHYSICS; }
24 
25 namespace JPHYSICS {
26 
27  using JIO::JReader;
28  using JIO::JWriter;
31 
32 
33  /**
34  * Get minimal wavelength for PDF evaluations.
35  *
36  * \return wavelength of light [nm]
37  */
38  inline double getMinimalWavelength()
39  {
40  return 300.0;
41  }
42 
43 
44  /**
45  * Get maximal wavelength for PDF evaluations.
46  *
47  * \return wavelength of light [nm]
48  */
49  inline double getMaximalWavelength()
50  {
51  return 700.0;
52  }
53 
54 
55  /**
56  * Number of Cherenkov photons per unit track length and per unit wavelength.
57  *
58  * \param lambda wavelength of light [nm]
59  * \param n index of refraction
60  * \return number of photons per unit track length and per unit wavelength [m^-1 nm^-1]
61  */
62  inline double cherenkov(const double lambda,
63  const double n)
64  {
65  using namespace JTOOLS;
66 
67  const double x = n*lambda;
68 
69  return 1.0e9 * 2 * PI * ALPHA_ELECTRO_MAGNETIC * (n*n - 1.0) / (x*x);
70  }
71 
72 
73  /**
74  * Equivalent EM-shower energy due to delta-rays per unit muon track length.
75  *
76  * Internal parameters are obtained with application [script] JDeltaRays[.sh].
77  *
78  * \param E muon energy [GeV]
79  * \return equivalent energy loss [GeV/m]
80  */
81  inline double getDeltaRaysFromMuon(const double E)
82  {
83  static const double a = 3.186e-01;
84  static const double b = 3.384e-01;
85  static const double c = -2.759e-02;
86  static const double d = 1.630e-03;
87  static const double Emin = 0.13078; // [GeV]
88 
89  if (E > Emin) {
90 
91  const double x = log10(E); //
92  const double y = a + x*(b + x*(c + x*(d))); // [MeV g^-1 cm^2]
93 
94  return y * JTOOLS::DENSITY_SEA_WATER * 1.0e-1; // [GeV/m]
95  }
96 
97  return 0.0;
98  }
99 
100 
101  /**
102  * Equivalent EM-shower energy due to delta-rays per unit tau track length.
103  *
104  * Internal parameters are obtained with application [script] JDeltaRays[.sh].
105  *
106  * \param E tau energy [GeV]
107  * \return equivalent energy loss [GeV/m]
108  */
109  inline double getDeltaRaysFromTau(const double E)
110  {
111  static const double a = -2.374e-01;
112  static const double b = 5.143e-01;
113  static const double c = -4.213e-02;
114  static const double d = 1.804e-03;
115  static const double Emin = 2.19500; // [GeV]
116 
117  if (E > Emin) {
118 
119  const double x = log10(E); //
120  const double y = a + x*(b + x*(c + x*(d))); // [MeV g^-1 cm^2]
121 
122  return y * JTOOLS::DENSITY_SEA_WATER * 1.0e-1; // [GeV/m]
123  }
124 
125  return 0.0;
126  }
127 
128 
129  /**
130  * Rayleigh cross section.
131  *
132  * \param n index of refraction
133  * \param lambda wavelength of light [nm]
134  * \return cross section [cm^2]
135  */
136  inline const double getRayleighCrossSection(const double n,
137  const double lambda)
138  {
139  using JTOOLS::PI;
140 
141  static const double d = 0.36; // size of H2O molecule [nm]
142  static const double U = PI*PI*PI*PI*PI*2.0/3.0;
143  static const double V = d*d*d*d*d*d;
144 
145  const double W = (n*n - 1.0) / (n*n + 2.0);
146  const double sigma = 1.0e-14 * U*V*W*W / (lambda*lambda*lambda*lambda); // [cm^2]
147 
148  return sigma;
149  }
150 
151 
152  /**
153  * Rayleigh scattering length.
154  *
155  * \param n index of refraction
156  * \param lambda wavelength of light [nm]
157  * \return scattering length [m]
158  */
159  inline const double getRayleighScatteringLength(const double n,
160  const double lambda)
161  {
162  using namespace JTOOLS;
163 
164  static const double amu = 18.01528; // H20 mass in Atomic mass units
165 
166  const double sigma = getRayleighCrossSection(n, lambda);
167  const double ls = 1.0e-2 / (DENSITY_SEA_WATER * AVOGADRO * sigma / amu); // [m]
168 
169  return ls;
170  }
171 
172 
173  /**
174  * Absorption length of pure water.
175  *
176  * CITATION:
177  * Jonasz M. 2007. Absorption coefficient of water: Data sources (www.tpdsci.com/Tpc/AbsCfOfWaterDat.php).
178  * In: Top. Part. Disp. Sci. (www.tpdsci.com).
179  *
180  * DATA FROM:
181  * Wozniak B., Wozniak S. B., Tyszka K., Ostrowska M., Majchrowski R., Ficek D., Dera J. 2005.
182  * Modelling the light absorption properties of particulate matter forming organic particles suspended in seawater. Part 2.
183  * Modelling results. Oceanologia 47, 621-662.
184  * see also
185  * Wozniak B., Dera J. 2007.
186  * Light absorption in sea water. Springer, Berlin, 456 pp. (see p. 62)
187  *
188  * NOTES:
189  * As stated by the data authors, the data are based on measurement results obtained by various authors
190  * (interpolated by a linear approximation where applicable):
191  * Wavelength Reference
192  * - 200-335 nm Smith R.C., Baker K.S. 1981. Optical properties of the clearest natural waters (200-800 nm). Appl. Opt. 20, 177-184.
193  * - 340-370 nm Sogandares F.M., Fry, E.S. 1997. Absorption spectrum (340 -640 nm) of pure water. I. Photothermal measurements Appl. Opt. 36, 8699-8709.
194  * - 380-700 nm Pope R.M., Fry E.S. 1997. Absorption spectrum (380 -700 nm) of pure water. II. Integrating cavity measurements. Appl. Opt. 36, 8710-8723
195  */
198  {
199  public:
201  {
202  // wave- absorption
203  // length coefficient
204  // [um] [1/m]
205  (*this)[0.200e3] = 3.07;
206  (*this)[0.205e3] = 2.53;
207  (*this)[0.210e3] = 1.99;
208  (*this)[0.215e3] = 1.65;
209  (*this)[0.220e3] = 1.31;
210  (*this)[0.225e3] = 1.1185;
211  (*this)[0.230e3] = 0.927;
212  (*this)[0.235e3] = 0.8235;
213  (*this)[0.240e3] = 0.72;
214  (*this)[0.245e3] = 0.6395;
215  (*this)[0.250e3] = 0.559;
216  (*this)[0.255e3] = 0.508;
217  (*this)[0.260e3] = 0.457;
218  (*this)[0.265e3] = 0.415;
219  (*this)[0.270e3] = 0.373;
220  (*this)[0.275e3] = 0.3305;
221  (*this)[0.280e3] = 0.288;
222  (*this)[0.285e3] = 0.2515;
223  (*this)[0.290e3] = 0.215;
224  (*this)[0.295e3] = 0.178;
225  (*this)[0.300e3] = 0.141;
226  (*this)[0.305e3] = 0.123;
227  (*this)[0.310e3] = 0.105;
228  (*this)[0.315e3] = 0.0947;
229  (*this)[0.320e3] = 0.0844;
230  (*this)[0.325e3] = 0.0761;
231  (*this)[0.330e3] = 0.0678;
232  (*this)[0.335e3] = 0.06195;
233  (*this)[0.340e3] = 0.0325;
234  (*this)[0.345e3] = 0.02645;
235  (*this)[0.350e3] = 0.0204;
236  (*this)[0.355e3] = 0.018;
237  (*this)[0.360e3] = 0.0156;
238  (*this)[0.365e3] = 0.0135;
239  (*this)[0.370e3] = 0.0114;
240  (*this)[0.375e3] = 0.011385;
241  (*this)[0.380e3] = 0.01137;
242  (*this)[0.385e3] = 0.00941;
243  (*this)[0.390e3] = 0.00851;
244  (*this)[0.395e3] = 0.00813;
245  (*this)[0.400e3] = 0.00663;
246  (*this)[0.405e3] = 0.0053;
247  (*this)[0.410e3] = 0.00473;
248  (*this)[0.415e3] = 0.00444;
249  (*this)[0.420e3] = 0.00454;
250  (*this)[0.425e3] = 0.00478;
251  (*this)[0.430e3] = 0.00495;
252  (*this)[0.435e3] = 0.0053;
253  (*this)[0.440e3] = 0.00635;
254  (*this)[0.445e3] = 0.00751;
255  (*this)[0.450e3] = 0.00922;
256  (*this)[0.455e3] = 0.00962;
257  (*this)[0.460e3] = 0.00979;
258  (*this)[0.465e3] = 0.01011;
259  (*this)[0.470e3] = 0.0106;
260  (*this)[0.475e3] = 0.0114;
261  (*this)[0.480e3] = 0.0127;
262  (*this)[0.485e3] = 0.0136;
263  (*this)[0.490e3] = 0.015;
264  (*this)[0.495e3] = 0.0173;
265  (*this)[0.500e3] = 0.0204;
266  (*this)[0.505e3] = 0.0256;
267  (*this)[0.510e3] = 0.0325;
268  (*this)[0.515e3] = 0.0396;
269  (*this)[0.520e3] = 0.0409;
270  (*this)[0.525e3] = 0.0417;
271  (*this)[0.530e3] = 0.0434;
272  (*this)[0.535e3] = 0.0452;
273  (*this)[0.540e3] = 0.0474;
274  (*this)[0.545e3] = 0.0511;
275  (*this)[0.550e3] = 0.0565;
276  (*this)[0.555e3] = 0.0596;
277  (*this)[0.560e3] = 0.0619;
278  (*this)[0.565e3] = 0.0642;
279  (*this)[0.570e3] = 0.0695;
280  (*this)[0.575e3] = 0.0772;
281  (*this)[0.580e3] = 0.0896;
282  (*this)[0.585e3] = 0.11;
283  (*this)[0.590e3] = 0.1351;
284  (*this)[0.595e3] = 0.1672;
285  (*this)[0.600e3] = 0.2224;
286  (*this)[0.605e3] = 0.2577;
287  (*this)[0.610e3] = 0.2644;
288  (*this)[0.615e3] = 0.2678;
289  (*this)[0.620e3] = 0.2755;
290  (*this)[0.625e3] = 0.2834;
291  (*this)[0.630e3] = 0.2916;
292  (*this)[0.635e3] = 0.3012;
293  (*this)[0.640e3] = 0.3108;
294  (*this)[0.645e3] = 0.325;
295  (*this)[0.650e3] = 0.34;
296  (*this)[0.655e3] = 0.371;
297  (*this)[0.660e3] = 0.41;
298  (*this)[0.665e3] = 0.429;
299  (*this)[0.670e3] = 0.439;
300  (*this)[0.675e3] = 0.448;
301  (*this)[0.680e3] = 0.465;
302  (*this)[0.685e3] = 0.486;
303  (*this)[0.690e3] = 0.516;
304  (*this)[0.695e3] = 0.559;
305  (*this)[0.700e3] = 0.624;
306 
307  compile();
308  }
309 
310 
311  /**
312  * Absorption length of pure water.
313  *
314  * \param lambda wavelength of light [nm]
315  * \return absorption length [m]
316  */
317  double operator()(const double lambda) const
318  {
319  const double y = JGridSplineFunction1D_t::operator()(lambda);
320 
321  return 1.0 / y;
322  }
323  };
324 
325 
326  /**
327  * Function object for absorption length of pure water.
328  */
330 }
331 
332 #endif
JIO::JReader
Interface for binary input.
Definition: JSerialisable.hh:62
JGeane.hh
JPHYSICS::getRayleighCrossSection
const double getRayleighCrossSection(const double n, const double lambda)
Rayleigh cross section.
Definition: JPDFToolkit.hh:136
JTOOLS::DENSITY_SEA_WATER
static const double DENSITY_SEA_WATER
Fixed environment values.
Definition: JConstants.hh:34
JTOOLS::ALPHA_ELECTRO_MAGNETIC
static const double ALPHA_ELECTRO_MAGNETIC
Electro-Magnetic coupling constant.
Definition: JConstants.hh:28
JPHYSICS::JAbsorptionLengthOfPureWater
Absorption length of pure water.
Definition: JPDFToolkit.hh:196
JPHYSICS::getAbsorptionLengthOfPureWater
static const JAbsorptionLengthOfPureWater getAbsorptionLengthOfPureWater
Function object for absorption length of pure water.
Definition: JPDFToolkit.hh:329
JTOOLS::n
const int n
Definition: JPolint.hh:628
JPHYSICS
Auxiliary classes and methods for calculation of PDF and muon energy loss.
Definition: JAbstractMedium.hh:9
JTOOLS::JGridPolint0Function1D_t
Type definition of a zero degree polynomial interpolation based on a JGridCollection with result type...
Definition: JFunction1D_t.hh:284
JTOOLS::JGridSplineFunction1D_t
Type definition of a spline interpolation based on a JGridCollection with result type double.
Definition: JFunction1D_t.hh:59
JTOOLS::AVOGADRO
static const double AVOGADRO
Avogadro's number [gr^-1].
Definition: JConstants.hh:24
JPHYSICS::getDeltaRaysFromMuon
double getDeltaRaysFromMuon(const double E)
Equivalent EM-shower energy due to delta-rays per unit muon track length.
Definition: JPDFToolkit.hh:81
JPHYSICS::JAbsorptionLengthOfPureWater::JAbsorptionLengthOfPureWater
JAbsorptionLengthOfPureWater()
Definition: JPDFToolkit.hh:200
JGeanx.hh
JPP
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition: JAAnetToolkit.hh:37
JFunction1D_t.hh
JSerialisable.hh
JConstants.hh
JPHYSICS::getMinimalWavelength
double getMinimalWavelength()
Get minimal wavelength for PDF evaluations.
Definition: JPDFToolkit.hh:38
JIO::JWriter
Interface for binary output.
Definition: JSerialisable.hh:130
JPHYSICS::getDeltaRaysFromTau
double getDeltaRaysFromTau(const double E)
Equivalent EM-shower energy due to delta-rays per unit tau track length.
Definition: JPDFToolkit.hh:109
JPHYSICS::JAbsorptionLengthOfPureWater::operator()
double operator()(const double lambda) const
Absorption length of pure water.
Definition: JPDFToolkit.hh:317
JGeanz.hh
JTOOLS::JFunction1D< JSplineElement2D< double, double > ::abscissa_type, double >::operator()
result_type operator()(const argument_type x) const
Function value evaluation.
Definition: JFunctional.hh:333
JGeant.hh
JTOOLS::PI
static const double PI
Constants.
Definition: JConstants.hh:20
JPHYSICS::getRayleighScatteringLength
const double getRayleighScatteringLength(const double n, const double lambda)
Rayleigh scattering length.
Definition: JPDFToolkit.hh:159
JPHYSICS::cherenkov
double cherenkov(const double lambda, const double n)
Number of Cherenkov photons per unit track length and per unit wavelength.
Definition: JPDFToolkit.hh:62
JTOOLS
Auxiliary classes and methods for multi-dimensional interpolations and histograms.
Definition: JAbstractCollection.hh:9
JPHYSICS::getMaximalWavelength
double getMaximalWavelength()
Get maximal wavelength for PDF evaluations.
Definition: JPDFToolkit.hh:49
JCC.hh