Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JGeant.hh
Go to the documentation of this file.
1 #ifndef __JPHYSICS__JGEANT__
2 #define __JPHYSICS__JGEANT__
3 
4 #include <cmath>
5 #include <algorithm>
6 
7 #include "JTools/JConstants.hh"
8 #include "JIO/JSerialisable.hh"
9 #include "JPhysics/JGeant_t.hh"
10 #include "JPhysics/JGeanx.hh"
11 
12 /**
13  * \file
14  * Photon emission profile EM-shower.
15  * \author mdejong
16  */
17 
18 namespace JPHYSICS {}
19 namespace JPP { using namespace JPHYSICS; }
20 
21 namespace JPHYSICS {
22 
23  using JIO::JReader;
24  using JIO::JWriter;
26 
27  /**
28  * Function object for the probability density function of photon emission from EM-shower
29  * as a function of the index of refraction and the cosine of the emission angle.
30  */
31  class JGeant :
32  public JGeant_t
33  {
34  public:
35  /**
36  * Default constructor.
37  */
38  JGeant()
39  {}
40 
41 
42  /**
43  * Constructor.
44  *
45  * \param geanx PDF of EM-shower
46  * \param dx step size for interpolation of function values
47  */
49  const double dx = 0.0001)
50  {
51  using JTOOLS::PI;
52 
53  const double n0 = geanx.n - 0.02;
54  const double n1 = geanx.n + 0.02;
55 
56  const JGeanx g0(geanx.a, geanx.b, n0);
57  const JGeanx g1(geanx.a, geanx.b, n1);
58 
59  const double y0 = g0.evaluate(-1.0, +1.0);
60  const double y1 = g1.evaluate(-1.0, +1.0);
61 
62  const double c = 1.0 / (y0 * 2*PI);
63 
64  // following range corresponds to n = 1 to n = infinity
65 
66  for (double x = -2.0; x < 1.0; x += dx) {
67  (*this)[x] = c * g0.evaluate(x + 1.0/n0);
68  }
69 
70  this->compile();
71 
72  // linear approximation of dependence normalisation constant on index of refraction
73 
74  this->a1 = (y1 - y0) / y0 / (n1 - n0);
75  this->a0 = 1.0 + a1*n0;
76  }
77  };
78 
79 
80  /**
81  * Function object for the number of photons from EM-shower as a function of emission angle.
82  */
83  static const JGeant geant(geanx, 0.0001);
84 }
85 
86 #endif
virtual void compile()
Function compilation.
Definition: JGeant_t.hh:46
Interface for binary output.
Base class for photon emission profile EM-shower.
double getIndexOfRefraction()
Get average index of refraction of water.
Definition: JConstants.hh:111
double a1
slope of the normalisation dependence
Definition: JGeant_t.hh:135
static const double PI
Constants.
Definition: JConstants.hh:20
const double b
slope
Definition: JGeanx.hh:137
static const JGeant geant(geanx, 0.0001)
Function object for the number of photons from EM-shower as a function of emission angle...
JGeant(const JGeanx &geanx, const double dx=0.0001)
Constructor.
Definition: JGeant.hh:48
Constants.
double a0
offset of the normalisation dependence
Definition: JGeant_t.hh:134
const double n
index of refraction
Definition: JGeanx.hh:138
Interface for binary input.
JGeant()
Default constructor.
Definition: JGeant.hh:38
Base class for the probability density function of photon emission from EM-shower as a function of th...
Definition: JGeant_t.hh:32
Photon emission profile EM-shower.
Probability density function of photon emission from EM-shower as a function of cosine of the emissio...
Definition: JGeanx.hh:35
static const JGeanx geanx(0.35,-5.40)
Function object for the number of photons from EM-shower as a function of emission angle...
Function object for the probability density function of photon emission from EM-shower as a function ...
Definition: JGeant.hh:31
const double a
power
Definition: JGeanx.hh:136
double evaluate(const double ct) const
Functional dependence.
Definition: JGeanx.hh:95
Double_t g1(const Double_t x)
Function.
Definition: JQuantiles.cc:25