Jpp 20.0.0-rc.2
the software that should make you happy
Loading...
Searching...
No Matches
JPHYSICS::JGeanz Class Reference

Function object for longitudinal profile of EM-shower. More...

#include <JGeanz.hh>

Public Member Functions

 JGeanz (const double __a0, const double __a1, const double __b)
 Constructor.
 
double getProbability (const double E, const double z) const
 Probability Density Function.
 
double operator() (const double E, const double z) const
 Probability Density Function.
 
double getIntegral (const double E, const double z) const
 Integral of PDF (starting from 0).
 
double getDerivative (const double E, const double z) const
 Derivative of PDF.
 
double getLength (const double E, const double P, const double eps=1.0e-5) const
 Get shower length for a given integrated probability.
 
double getMaximum (const double E) const
 Get depth of shower maximum.
 

Static Public Member Functions

static double getMinimalShowerSize ()
 Get minimal shower size.
 

Protected Attributes

double a0
 
double a1
 
double b
 
double Emin
 

Friends

std::istream & operator>> (std::istream &in, JGeanz &object)
 Read longitudinal profile from input.
 
std::ostream & operator<< (std::ostream &out, const JGeanz &object)
 Write longitidunal profile to output.
 

Detailed Description

Function object for longitudinal profile of EM-shower.

    \f[P(z)  \propto  z^{a-1} \times e^{-z/b}\f]

where:

\[a = a_{0} + a_{1} \times \ln(E)\]

The parametrisation is taken from reference: C. Kopper, "Performance Studies for the KM3NeT Neutrino Telescope.", PhD thesis, University of Erlangen.

Definition at line 33 of file JGeanz.hh.

Constructor & Destructor Documentation

◆ JGeanz()

JPHYSICS::JGeanz::JGeanz ( const double __a0,
const double __a1,
const double __b )
inline

Constructor.

Parameters
__a0power term (constant)
__a1power term (E dependence)
__bexpontial slope

Definition at line 42 of file JGeanz.hh.

44 :
45 a0(__a0),
46 a1(__a1),
47 b (__b),
48 Emin(exp(-a0/a1))
49 {}

Member Function Documentation

◆ getProbability()

double JPHYSICS::JGeanz::getProbability ( const double E,
const double z ) const
inline

Probability Density Function.

Parameters
EEM-shower energy [GeV]
zz position of light emission point relative to vertex location (z >= 0) [m]
Returns
dP/dz

Definition at line 59 of file JGeanz.hh.

61 {
62 if (E > Emin) {
63
64 const double a = a0 + a1 * log(E);
65 const double y = pow(z,a-1.0) * exp(-z/b) / (pow(b,a) * std::tgamma(a));
66
67 return y;
68 }
69
70 if (z <= getMinimalShowerSize())
71 return 1.0 / getMinimalShowerSize();
72 else
73 return 0.0;
74 }
static double getMinimalShowerSize()
Get minimal shower size.
Definition JGeanz.hh:200
T pow(const T &x, const double y)
Power .
Definition JMath.hh:97

◆ operator()()

double JPHYSICS::JGeanz::operator() ( const double E,
const double z ) const
inline

Probability Density Function.

Parameters
EEM-shower energy [GeV]
zz position of light emission point relative to vertex location (z >= 0) [m]
Returns
dP/dz

Definition at line 84 of file JGeanz.hh.

86 {
87 return getProbability(E, z);
88 }
double getProbability(const double E, const double z) const
Probability Density Function.
Definition JGeanz.hh:59

◆ getIntegral()

double JPHYSICS::JGeanz::getIntegral ( const double E,
const double z ) const
inline

Integral of PDF (starting from 0).

Parameters
EEM-shower energy [GeV]
zz position [m] (>= 0)
Returns
dP

Definition at line 98 of file JGeanz.hh.

100 {
101 if (E > Emin) {
102
103 const double a = a0 + a1 * log(E);
104 const double x = z / b;
105 const double y = JMATH::Gamma(a,x);
106
107 return y;
108 }
109
110 if (z <= getMinimalShowerSize())
111 return z / getMinimalShowerSize();
112 else
113 return 1.0;
114 }
double Gamma(const double a, const double x)
Incomplete gamma function.

◆ getDerivative()

double JPHYSICS::JGeanz::getDerivative ( const double E,
const double z ) const
inline

Derivative of PDF.

Parameters
EEM-shower energy [GeV]
zz position [m] (> 0)
Returns
dP/dz

Definition at line 124 of file JGeanz.hh.

126 {
127 if (E > Emin) {
128
129 const double a = a0 + a1 * log(E);
130
131 return ((a - 1.0)/z - 1.0/b) * getProbability(E, z);
132 }
133
134 return 0.0;
135 }

◆ getLength()

double JPHYSICS::JGeanz::getLength ( const double E,
const double P,
const double eps = 1.0e-5 ) const
inline

Get shower length for a given integrated probability.

Parameters
EEM-shower energy [GeV]
Pintegrated probability [0,1]
epsrelative precision
Returns
shower length [m]

Definition at line 146 of file JGeanz.hh.

149 {
150 if (E > Emin) {
151
152 double z0 = 0.0;
153 double z1 = getMaximum(E);
154
155 for (int i = 1000; i != 0; --i) {
156
157 const double p = getIntegral(E, z1);
158
159 if (fabs(p-P) < P*eps) {
160 return z1;
161 }
162
163 if (p > P) {
164 z1 = 0.5 * (z0 + z1);
165 } else {
166 z0 = z1;
167 z1 *= 1.5;
168 }
169 }
170
171 return z1;
172
173 } else {
174
175 return 0.0;
176 }
177 }
double getIntegral(const double E, const double z) const
Integral of PDF (starting from 0).
Definition JGeanz.hh:98
double getMaximum(const double E) const
Get depth of shower maximum.
Definition JGeanz.hh:187

◆ getMaximum()

double JPHYSICS::JGeanz::getMaximum ( const double E) const
inline

Get depth of shower maximum.

Parameters
EEM-shower energy[GeV]
Returns
depth of maximum [m]

Definition at line 187 of file JGeanz.hh.

188 {
189 const double a = a0 + a1 * log(E);
190
191 return (a-1)*b;
192 }

◆ getMinimalShowerSize()

static double JPHYSICS::JGeanz::getMinimalShowerSize ( )
inlinestatic

Get minimal shower size.

Returns
size [m]

Definition at line 200 of file JGeanz.hh.

201 {
202 return 1e-6;
203 }

Friends And Related Symbol Documentation

◆ operator>>

std::istream & operator>> ( std::istream & in,
JGeanz & object )
friend

Read longitudinal profile from input.

Parameters
ininput stream
objectlongitudinal profile
Returns
input stream

Definition at line 213 of file JGeanz.hh.

214 {
215 in >> object.a0 >> object.a1 >> object.b;
216
217 object.Emin = exp(-object.a0/object.a1);
218
219 return in;
220 }

◆ operator<<

std::ostream & operator<< ( std::ostream & out,
const JGeanz & object )
friend

Write longitidunal profile to output.

Parameters
outoutput stream
objectlongitudinal profile
Returns
output stream

Definition at line 230 of file JGeanz.hh.

231 {
232 return out << object.a0 << ' ' << object.a1 << ' ' << object.b;
233 }

Member Data Documentation

◆ a0

double JPHYSICS::JGeanz::a0
protected

Definition at line 236 of file JGeanz.hh.

◆ a1

double JPHYSICS::JGeanz::a1
protected

Definition at line 237 of file JGeanz.hh.

◆ b

double JPHYSICS::JGeanz::b
protected

Definition at line 238 of file JGeanz.hh.

◆ Emin

double JPHYSICS::JGeanz::Emin
protected

Definition at line 239 of file JGeanz.hh.


The documentation for this class was generated from the following file: