Jpp
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | Private Attributes | Friends | List of all members
JPHYSICS::JGeant Class Referenceabstract

Function object for the probability density function of photon emission from EM-shower as a function of cosine of the emission angle. More...

#include <JGeant.hh>

Inheritance diagram for JPHYSICS::JGeant:
JTOOLS::JGridPolint1Function1D_t JTOOLS::JGridPolintFunction1D_t< 1 > JTOOLS::JPolintFunction1D< N, JElement2D< double, double >, JGridCollection, double > JTOOLS::JPolintFunction< N, JElement2D< double, double >, JGridCollection, double, JDistance< typename JElement2D< double, double > ::abscissa_type > > JTOOLS::JFunction1D< JElement2D< double, double > ::abscissa_type, double > JTOOLS::JFunction< JElement2D< double, double > ::abscissa_type, double > JTOOLS::JFunctional< JElement2D< double, double > ::abscissa_type, double >

Public Types

typedef JGridCollection< JElement2D< double, double >, JDistance< typename JElement2D< double, double > ::abscissa_type > > collection_type
 
typedef collection_type::abscissa_type abscissa_type
 
typedef collection_type::ordinate_type ordinate_type
 
typedef collection_type::value_type value_type
 
typedef collection_type::distance_type distance_type
 
typedef collection_type::const_iterator const_iterator
 
typedef collection_type::const_reverse_iterator const_reverse_iterator
 
typedef collection_type::iterator iterator
 
typedef collection_type::reverse_iterator reverse_iterator
 
typedef JFunction1D< abscissa_type, double > function_type
 
typedef function_type::argument_type argument_type
 
typedef function_type::result_type result_type
 
typedef function_type::JExceptionHandler exceptionhandler_type
 
enum  
 
typedef JFunctional< JElement2D< double, double > ::abscissa_type, double > functional_type
 
typedef JSupervisor supervisor_type
 

Public Member Functions

 JGeant ()
 Default constructor. More...
 
 JGeant (const JGeanx &geanx, const double dx=0.0001)
 Constructor. More...
 
virtual void compile ()
 Function compilation. More...
 
double operator() (const double n, const double ct) const
 Number of photons from EM-shower as a function of emission angle. More...
 
double operator() (const double n, const double xmin, const double xmax) const
 Integral number of photons from EM-shower between two emission angles. More...
 
result_type operator() (const argument_type x) const
 Function value evaluation. More...
 
virtual result_type evaluate (const argument_type *pX) const=0
 Recursive function value evaluation. More...
 
JSupervisor getSupervisor () const
 Get supervisor. More...
 
const JExceptionHandler & getExceptionHandler () const
 Get exception handler. More...
 
void setExceptionHandler (const JSupervisor &supervisor)
 Set the supervisor for handling of exceptions. More...
 

Static Public Member Functions

static result_type getValue (const JFunctional &function, const argument_type *pX)
 Recursive function value evaluation. More...
 
static JClass< result_type >::argument_type getValue (typename JClass< result_type >::argument_type value, const argument_type *pX)
 Termination of recursive function value evaluation. More...
 

Protected Attributes

JSupervisor supervisor
 

Private Attributes

double a0
 offset of the normalisation dependence More...
 
double a1
 slope of the normalisation dependence More...
 
JGeantFunction1D_t buffer
 

Friends

JReaderoperator>> (JReader &in, JGeant &geant)
 Read geant from input. More...
 
JWriteroperator<< (JWriter &out, const JGeant &geant)
 Write geant to output. More...
 

Detailed Description

Function object for the probability density function of photon emission from EM-shower as a function of cosine of the emission angle.

The implementation of this function is based on a linear interpolation of tabulated values. In this, a linear approximation of the dependence of the normalisation constant on the index of refraction is assumed. This assumption is valid to within 10^-3.

Definition at line 39 of file JGeant.hh.

Member Typedef Documentation

◆ collection_type

typedef JGridCollection <JElement2D< double, double > , JDistance<typename JElement2D< double, double > ::abscissa_type> > JTOOLS::JPolintFunction1D< N, JElement2D< double, double > , JGridCollection , double , JDistance<typename JElement2D< double, double > ::abscissa_type> >::collection_type
inherited

Definition at line 939 of file JPolint.hh.

◆ abscissa_type

typedef collection_type::abscissa_type JTOOLS::JPolintFunction1D< N, JElement2D< double, double > , JGridCollection , double , JDistance<typename JElement2D< double, double > ::abscissa_type> >::abscissa_type
inherited

Definition at line 941 of file JPolint.hh.

◆ ordinate_type

typedef collection_type::ordinate_type JTOOLS::JPolintFunction1D< N, JElement2D< double, double > , JGridCollection , double , JDistance<typename JElement2D< double, double > ::abscissa_type> >::ordinate_type
inherited

Definition at line 942 of file JPolint.hh.

◆ value_type

typedef collection_type::value_type JTOOLS::JPolintFunction1D< N, JElement2D< double, double > , JGridCollection , double , JDistance<typename JElement2D< double, double > ::abscissa_type> >::value_type
inherited

Definition at line 943 of file JPolint.hh.

◆ distance_type

typedef collection_type::distance_type JTOOLS::JPolintFunction1D< N, JElement2D< double, double > , JGridCollection , double , JDistance<typename JElement2D< double, double > ::abscissa_type> >::distance_type
inherited

Definition at line 944 of file JPolint.hh.

◆ const_iterator

typedef collection_type::const_iterator JTOOLS::JPolintFunction1D< N, JElement2D< double, double > , JGridCollection , double , JDistance<typename JElement2D< double, double > ::abscissa_type> >::const_iterator
inherited

Definition at line 946 of file JPolint.hh.

◆ const_reverse_iterator

Definition at line 947 of file JPolint.hh.

◆ iterator

typedef collection_type::iterator JTOOLS::JPolintFunction1D< N, JElement2D< double, double > , JGridCollection , double , JDistance<typename JElement2D< double, double > ::abscissa_type> >::iterator
inherited

Definition at line 948 of file JPolint.hh.

◆ reverse_iterator

typedef collection_type::reverse_iterator JTOOLS::JPolintFunction1D< N, JElement2D< double, double > , JGridCollection , double , JDistance<typename JElement2D< double, double > ::abscissa_type> >::reverse_iterator
inherited

Definition at line 949 of file JPolint.hh.

◆ function_type

typedef JFunction1D<abscissa_type, double > JTOOLS::JPolintFunction1D< N, JElement2D< double, double > , JGridCollection , double , JDistance<typename JElement2D< double, double > ::abscissa_type> >::function_type
inherited

Definition at line 951 of file JPolint.hh.

◆ argument_type

typedef function_type::argument_type JTOOLS::JPolintFunction1D< N, JElement2D< double, double > , JGridCollection , double , JDistance<typename JElement2D< double, double > ::abscissa_type> >::argument_type
inherited

Definition at line 953 of file JPolint.hh.

◆ result_type

typedef function_type::result_type JTOOLS::JPolintFunction1D< N, JElement2D< double, double > , JGridCollection , double , JDistance<typename JElement2D< double, double > ::abscissa_type> >::result_type
inherited

Definition at line 954 of file JPolint.hh.

◆ exceptionhandler_type

typedef function_type::JExceptionHandler JTOOLS::JPolintFunction1D< N, JElement2D< double, double > , JGridCollection , double , JDistance<typename JElement2D< double, double > ::abscissa_type> >::exceptionhandler_type
inherited

Definition at line 955 of file JPolint.hh.

◆ functional_type

typedef JFunctional<JElement2D< double, double > ::abscissa_type , double > JTOOLS::JFunction1D< JElement2D< double, double > ::abscissa_type , double >::functional_type
inherited

Definition at line 322 of file JFunctional.hh.

◆ supervisor_type

typedef JSupervisor JTOOLS::JFunctional< JElement2D< double, double > ::abscissa_type , double >::supervisor_type
inherited

Definition at line 89 of file JFunctional.hh.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
inherited

Definition at line 320 of file JFunctional.hh.

320 { NUMBER_OF_DIMENSIONS = 1 };

Constructor & Destructor Documentation

◆ JGeant() [1/2]

JPHYSICS::JGeant::JGeant ( )
inline

Default constructor.

Definition at line 46 of file JGeant.hh.

47  {}

◆ JGeant() [2/2]

JPHYSICS::JGeant::JGeant ( const JGeanx geanx,
const double  dx = 0.0001 
)
inline

Constructor.

Parameters
geanxPDF of EM-shower
dxstep size for interpolation of function values

Definition at line 56 of file JGeant.hh.

58  {
59  using JTOOLS::PI;
60 
61  const double n0 = geanx.n - 0.02;
62  const double n1 = geanx.n + 0.02;
63 
64  const JGeanx g0(geanx.a, geanx.b, n0);
65  const JGeanx g1(geanx.a, geanx.b, n1);
66 
67  const double y0 = g0.evaluate(-1.0, +1.0);
68  const double y1 = g1.evaluate(-1.0, +1.0);
69 
70  const double c = 1.0 / (y0 * 2*PI);
71 
72  // following range corresponds to n = 1 to n = infinity
73 
74  for (double x = -2.0; x < 1.0; x += dx) {
75  (*this)[x] = c * g0.evaluate(x + 1.0/n0);
76  }
77 
78  compile();
79 
80  // linear approximation of dependence normalisation constant on index of refraction
81 
82  a1 = (y1 - y0) / y0 / (n1 - n0);
83  a0 = 1.0 + a1*n0;
84  }

Member Function Documentation

◆ compile()

virtual void JPHYSICS::JGeant::compile ( )
inlinevirtual

Function compilation.

Definition at line 90 of file JGeant.hh.

91  {
92  JGeantFunction1D_t::compile();
93 
94  buffer.clear();
95 
96  JTOOLS::integrate(*this, buffer);
97 
98  buffer.compile();
99  }

◆ operator()() [1/3]

double JPHYSICS::JGeant::operator() ( const double  n,
const double  ct 
) const
inline

Number of photons from EM-shower as a function of emission angle.

The integral over full solid angle is normalised to one.

Parameters
nindex of refraction
ctcosine angle of emmision
Returns
d^2P/dcos()dphi

Definition at line 110 of file JGeant.hh.

112  {
113  const double y = JGeantFunction1D_t::operator()(ct - 1.0/n);
114 
115  return y * (a0 - a1*n);
116  }

◆ operator()() [2/3]

double JPHYSICS::JGeant::operator() ( const double  n,
const double  xmin,
const double  xmax 
) const
inline

Integral number of photons from EM-shower between two emission angles.

The integral over full solid angle is normalised to one.

Parameters
nindex of refraction
xminminimal cosine angle of emmision
xmaxmaximal cosine angle of emmision
Returns
dnpe/dphi

Definition at line 128 of file JGeant.hh.

131  {
132  const double x_min = std::max(xmin - 1.0/n, buffer. begin()->getX());
133  const double x_max = std::min(xmax - 1.0/n, buffer.rbegin()->getX());
134 
135  const double y = buffer(x_max) - buffer(x_min);
136 
137  return y * (a0 - a1*n);
138  }

◆ operator()() [3/3]

result_type JTOOLS::JFunction1D< JElement2D< double, double > ::abscissa_type , double >::operator() ( const argument_type  x) const
inlineinherited

Function value evaluation.

Parameters
xargument value
Returns
function value

Definition at line 333 of file JFunctional.hh.

334  {
335  return this->evaluate(&x);
336  }

◆ evaluate()

virtual result_type JTOOLS::JFunctional< JElement2D< double, double > ::abscissa_type , double >::evaluate ( const argument_type pX) const
pure virtualinherited

Recursive function value evaluation.

Parameters
pXpointer to abscissa values
Returns
function value

◆ getValue() [1/2]

static result_type JTOOLS::JFunctional< JElement2D< double, double > ::abscissa_type , double >::getValue ( const JFunctional< JElement2D< double, double > ::abscissa_type, double > &  function,
const argument_type pX 
)
inlinestaticinherited

Recursive function value evaluation.

Parameters
functionfunction
pXpointer to abscissa values

Definition at line 107 of file JFunctional.hh.

109  {
110  return function.evaluate(pX);
111  }

◆ getValue() [2/2]

static JClass<result_type>::argument_type JTOOLS::JFunctional< JElement2D< double, double > ::abscissa_type , double >::getValue ( typename JClass< result_type >::argument_type  value,
const argument_type pX 
)
inlinestaticinherited

Termination of recursive function value evaluation.

Parameters
valueresult
pXpointer to abscissa values

Definition at line 121 of file JFunctional.hh.

123  {
124  return value;
125  }

◆ getSupervisor()

JSupervisor JTOOLS::JFunctional< JElement2D< double, double > ::abscissa_type , double >::getSupervisor ( ) const
inlineinherited

Get supervisor.

Returns
supervisor

Definition at line 266 of file JFunctional.hh.

267  {
268  return supervisor;
269  }

◆ getExceptionHandler()

const JExceptionHandler& JTOOLS::JFunctional< JElement2D< double, double > ::abscissa_type , double >::getExceptionHandler ( ) const
inlineinherited

Get exception handler.

Returns
exception handler

Definition at line 277 of file JFunctional.hh.

278  {
279  return *supervisor;
280  }

◆ setExceptionHandler()

void JTOOLS::JFunctional< JElement2D< double, double > ::abscissa_type , double >::setExceptionHandler ( const JSupervisor &  supervisor)
inlineinherited

Set the supervisor for handling of exceptions.

Parameters
supervisorsupervisor

Definition at line 288 of file JFunctional.hh.

289  {
290  this->supervisor = supervisor;
291  }

Friends And Related Function Documentation

◆ operator>>

JReader& operator>> ( JReader in,
JGeant geant 
)
friend

Read geant from input.

Parameters
inreader
geantgeant
Returns
reader

Definition at line 148 of file JGeant.hh.

149  {
150  in >> geant.a0;
151  in >> geant.a1;
152  in >> static_cast<JGeantFunction1D_t&>(geant);
153 
154  geant.compile();
155 
156  return in;
157  }

◆ operator<<

JWriter& operator<< ( JWriter out,
const JGeant geant 
)
friend

Write geant to output.

Parameters
outwriter
geantgeant
Returns
writer

Definition at line 167 of file JGeant.hh.

168  {
169  out << geant.a0;
170  out << geant.a1;
171  out << static_cast<const JGeantFunction1D_t&>(geant);
172 
173  return out;
174  }

Member Data Documentation

◆ a0

double JPHYSICS::JGeant::a0
private

offset of the normalisation dependence

Definition at line 178 of file JGeant.hh.

◆ a1

double JPHYSICS::JGeant::a1
private

slope of the normalisation dependence

Definition at line 179 of file JGeant.hh.

◆ buffer

JGeantFunction1D_t JPHYSICS::JGeant::buffer
private

Definition at line 180 of file JGeant.hh.

◆ supervisor

JSupervisor JTOOLS::JFunctional< JElement2D< double, double > ::abscissa_type , double >::supervisor
protectedinherited

Definition at line 295 of file JFunctional.hh.


The documentation for this class was generated from the following file:
JTOOLS::JFunctional< JElement2D< double, double > ::abscissa_type, double >::supervisor
JSupervisor supervisor
Definition: JFunctional.hh:295
JTOOLS::pX
pX
Definition: JPolint.hh:625
JPHYSICS::JGeant::a1
double a1
slope of the normalisation dependence
Definition: JGeant.hh:179
JPHYSICS::geanx
static const JGeanx geanx(0.35, -5.40)
Function object for the number of photons from EM-shower as a function of emission angle.
g1
Double_t g1(const Double_t x)
Function.
Definition: JQuantiles.cc:25
JTOOLS::JFunction1D< JElement2D< double, double > ::abscissa_type, double >::NUMBER_OF_DIMENSIONS
Definition: JFunctional.hh:320
JTOOLS::n
const int n
Definition: JPolint.hh:628
JPHYSICS::JGeant::a0
double a0
offset of the normalisation dependence
Definition: JGeant.hh:178
JTOOLS::JFunctional< JElement2D< double, double > ::abscissa_type, double >::evaluate
virtual result_type evaluate(const argument_type *pX) const=0
Recursive function value evaluation.
JPHYSICS::JGeanx::a
const double a
power
Definition: JGeanx.hh:136
JPHYSICS::JGeant::compile
virtual void compile()
Function compilation.
Definition: JGeant.hh:90
JTOOLS::JFunction1D< JElement2D< double, double > ::abscissa_type, double >::operator()
result_type operator()(const argument_type x) const
Function value evaluation.
Definition: JFunctional.hh:333
JPHYSICS::JGeanx::b
const double b
slope
Definition: JGeanx.hh:137
JPHYSICS::JGeanx::n
const double n
index of refraction
Definition: JGeanx.hh:138
JTOOLS::PI
static const double PI
Constants.
Definition: JConstants.hh:20
JPHYSICS::geant
static const JGeant geant(geanx, 0.0001)
Function object for the number of photons from EM-shower as a function of emission angle.
JPHYSICS::JGeanx
Probability density function of photon emission from EM-shower as a function of cosine of the emissio...
Definition: JGeanx.hh:35
JTOOLS::integrate
JElement_t::ordinate_type integrate(const JCollection< JElement_t, JDistance_t > &input, typename JMappable< JElement_t >::map_type &output)
Conversion of data points to integral values.
Definition: JCollection.hh:793
JPHYSICS::JGeant::buffer
JGeantFunction1D_t buffer
Definition: JGeant.hh:180