Jpp  15.0.0-rc.2
the software that should make you happy
 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 "JPhysics/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;
25 
26  /**
27  * Function object for the probability density function of photon emission from EM-shower
28  * as a function of the index of refraction and the cosine of the emission angle.
29  */
30  class JGeant :
31  public JGeant_t
32  {
33  public:
34  /**
35  * Default constructor.
36  */
37  JGeant()
38  {}
39 
40 
41  /**
42  * Constructor.
43  *
44  * \param geanx PDF of EM-shower
45  * \param dx step size for interpolation of function values
46  */
48  const double dx = 0.0001)
49  {
50  using JTOOLS::PI;
51 
52  const double n0 = geanx.n - 0.02;
53  const double n1 = geanx.n + 0.02;
54 
55  const JGeanx g0(geanx.a, geanx.b, n0);
56  const JGeanx g1(geanx.a, geanx.b, n1);
57 
58  const double y0 = g0.evaluate(-1.0, +1.0);
59  const double y1 = g1.evaluate(-1.0, +1.0);
60 
61  const double c = 1.0 / (y0 * 2*PI);
62 
63  // following range corresponds to n = 1 to n = infinity
64 
65  for (double x = -2.0; x < 1.0; x += dx) {
66  (*this)[x] = c * g0.evaluate(x + 1.0/n0);
67  }
68 
69  this->compile();
70 
71  // linear approximation of dependence normalisation constant on index of refraction
72 
73  this->a1 = (y1 - y0) / y0 / (n1 - n0);
74  this->a0 = 1.0 + a1*n0;
75  }
76  };
77 
78 
79  /**
80  * Function object for the number of photons from EM-shower as a function of emission angle.
81  */
82  static const JGeant geant(geanx, 0.0001);
83 }
84 
85 #endif
Interface for binary output.
Base class for photon emission profile EM-shower.
double a1
slope of the normalisation dependence
Definition: JGeant_t.hh:135
const double b
slope
Definition: JGeanx.hh:134
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:47
double a0
offset of the normalisation dependence
Definition: JGeant_t.hh:134
Physics constants.
const double n
index of refraction
Definition: JGeanx.hh:135
static const double PI
Mathematical constants.
Interface for binary input.
JGeant()
Default constructor.
Definition: JGeant.hh:37
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:31
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:30
const double a
power
Definition: JGeanx.hh:133
double evaluate(const double ct) const
Functional dependence.
Definition: JGeanx.hh:89
Double_t g1(const Double_t x)
Function.
Definition: JQuantiles.cc:25