Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JGeanx.hh
Go to the documentation of this file.
1 #ifndef __JPHYSICS__JGEANX__
2 #define __JPHYSICS__JGEANX__
3 
4 #include <cmath>
5 
6 #include "TMath.h"
7 
8 #include "JTools/JConstants.hh"
9 
10 /**
11  * \file
12  * Photon emission profile EM-shower.
13  * \author mdejong
14  */
15 
16 namespace JPHYSICS {}
17 namespace JPP { using namespace JPHYSICS; }
18 
19 namespace JPHYSICS {
20 
22 
23 
24  /**
25  * Probability density function of photon emission from EM-shower as a function of cosine of the emission angle.
26  *
27  * \f[P(\cos(\theta)) = c \times e^{b \times |\cos(\theta) - 1/n|^a}\f]
28  *
29  * where \f$c\f$ is a normalisation constant such that the integral of \f$P\f$ over the full solid angle is one.
30  *
31  * The parametrisation is taken from reference:
32  * R. Mirani, "Parametrisation of EM-showers in the ANTARES detector volume.",
33  * Doctoral thesis in computational physics, University of Amsterdam.
34  */
35  class JGeanx
36  {
37  public:
38  /**
39  * Constructor.
40  *
41  * \param __a power
42  * \param __b exponential slope
43  * \param __n index of refraction
44  */
45  JGeanx(const double __a,
46  const double __b,
47  const double __n = getIndexOfRefractionPhase()) :
48  a(__a),
49  b(__b),
50  n(__n)
51  {
52  using JTOOLS::PI;
53 
54  const double y = evaluate(-1.0, +1.0);
55 
56  c = 1.0 / (y * 2*PI);
57  }
58 
59 
60  /**
61  * Number of photons from EM-shower as a function of emission angle.
62  * The integral over full solid angle is normalised to one.
63  *
64  * \param ct cosine angle of emmision
65  * \return d^2P/dcos()dphi
66  */
67  double operator()(const double ct) const
68  {
69  return c * evaluate(ct);
70  }
71 
72 
73  /**
74  * Integral number of photons from EM-shower between two emission angles.
75  * The integral over full solid angle is normalised to one.
76  *
77  * \param xmin minimal cosine angle of emmision
78  * \param xmax maximal cosine angle of emmision
79  * \return dnpe/dphi
80  */
81  double operator()(const double xmin,
82  const double xmax) const
83  {
84  return c * evaluate(xmin, xmax);
85  }
86 
87 
88  /**
89  * Functional dependence.
90  * In this, the normalisation constant c = 1.
91  *
92  * \param ct cosine angle of emmision
93  * \return f()
94  */
95  double evaluate(const double ct) const
96  {
97  const double x = fabs(ct - 1.0/n);
98 
99  return exp(b * pow(x,a));
100  }
101 
102 
103  /**
104  * Integral.
105  * In this, the normalisation constant <tt>c = 1</tt>.
106  *
107  * \param xmin minimal cosine angle of emmision
108  * \param xmax maximal cosine angle of emmision
109  * \return integral f() x dcos()
110  */
111  double evaluate(const double xmin,
112  const double xmax) const
113  {
114  const double x = 1.0 / n;
115 
116  const double ai = 1.0 / a;
117  const double bi = 1.0 / b;
118 
119  const double xl = pow(fabs(x - xmin), a) * -b;
120  const double xr = pow(fabs(x - xmax), a) * -b;
121 
122  const double gp = TMath::Gamma(ai);
123 
124  double yl = TMath::Gamma(ai, xl) * gp;
125  double yr = TMath::Gamma(ai, xr) * gp;
126 
127  if (xmin > x)
128  yl = -yl;
129  if (xmax < x)
130  yr = -yr;
131 
132  return ai * pow(-bi,ai) * (yl + yr);
133  }
134 
135 
136  const double a; //!< power
137  const double b; //!< slope
138  const double n; //!< index of refraction
139 
140  private:
141  double c; //!< normalisation constant
142  };
143 
144 
145  /**
146  * Function object for the number of photons from EM-shower as a function of emission angle.
147  */
148  static const JGeanx geanx(0.35, -5.40);
149 }
150 
151 #endif
double getIndexOfRefractionPhase()
Get average index of refraction of water.
Definition: JConstants.hh:122
static const double PI
Constants.
Definition: JConstants.hh:20
const double b
slope
Definition: JGeanx.hh:137
double Gamma(const double a, const double x)
Incomplete gamma function.
Constants.
double evaluate(const double xmin, const double xmax) const
Integral.
Definition: JGeanx.hh:111
const double n
index of refraction
Definition: JGeanx.hh:138
double c
normalisation constant
Definition: JGeanx.hh:141
Probability density function of photon emission from EM-shower as a function of cosine of the emissio...
Definition: JGeanx.hh:35
double operator()(const double ct) const
Number of photons from EM-shower as a function of emission angle.
Definition: JGeanx.hh:67
static const JGeanx geanx(0.35,-5.40)
Function object for the number of photons from EM-shower as a function of emission angle...
const double a
power
Definition: JGeanx.hh:136
double operator()(const double xmin, const double xmax) const
Integral number of photons from EM-shower between two emission angles.
Definition: JGeanx.hh:81
double evaluate(const double ct) const
Functional dependence.
Definition: JGeanx.hh:95
JGeanx(const double __a, const double __b, const double __n=getIndexOfRefractionPhase())
Constructor.
Definition: JGeanx.hh:45
then set_variable FORMULA *[0] exp(-0.5 *(x-[1])*(x-[1])/([2]*[2]))" set_variable OUTPUT_FILE histogram.root JHistogram1D -o $WORKDIR/$OUTPUT_FILE -F "$FORMULA" -