Jpp 19.3.0-rc.2
the software that should make you happy
Loading...
Searching...
No Matches
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
10#include "JPhysics/JGeanx.hh"
11
12/**
13 * \file
14 * Photon emission profile EM-shower.
15 * \author mdejong
16 */
17
18namespace JPHYSICS {}
19namespace JPP { using namespace JPHYSICS; }
20
21namespace 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 */
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
Base class for photon emission profile EM-shower.
Photon emission profile EM-shower.
Physics constants.
Double_t g1(const Double_t x)
Function.
Definition JQuantiles.cc:25
Interface for binary input.
Interface for binary output.
Base class for the probability density function of photon emission from EM-shower as a function of th...
Definition JGeant_t.hh:34
double a0
offset of the normalisation dependence
Definition JGeant_t.hh:134
double a1
slope of the normalisation dependence
Definition JGeant_t.hh:135
Function object for the probability density function of photon emission from EM-shower as a function ...
Definition JGeant.hh:32
JGeant()
Default constructor.
Definition JGeant.hh:37
JGeant(const JGeanx &geanx, const double dx=0.0001)
Constructor.
Definition JGeant.hh:47
Probability density function of photon emission from EM-shower as a function of cosine of the emissio...
Definition JGeanx.hh:32
double evaluate(const double ct) const
Functional dependence.
Definition JGeanx.hh:89
const double a
power
Definition JGeanx.hh:133
const double b
slope
Definition JGeanx.hh:134
const double n
index of refraction
Definition JGeanx.hh:135
Auxiliary methods for light properties of deep-sea water.
static const JGeanx geanx(0.35, -5.40)
Function object for the number of photons from EM-shower as a function of emission angle.
static const JGeant geant(geanx, 0.0001)
Function object for the number of photons from EM-shower as a function of emission angle.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).