Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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::JGridPolint0Function1D_t JTOOLS::JGridPolintFunction1D_t< 0 > 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::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 result_type getValue (typename JClass< result_type >::argument_type y, const argument_type *pX)
 Termination of recursive function value evaluation. More...
 

Protected Attributes

JSupervisor supervisor
 

Private Attributes

double z
 offset of the normalisation dependence More...
 
double u
 slope of the normalisation dependence More...
 
JTOOLS::JGridPolint0Function1D_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 37 of file JGeant.hh.

Member Typedef Documentation

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 863 of file JPolint.hh.

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 865 of file JPolint.hh.

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 866 of file JPolint.hh.

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 867 of file JPolint.hh.

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 868 of file JPolint.hh.

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 870 of file JPolint.hh.

Definition at line 871 of file JPolint.hh.

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

Definition at line 872 of file JPolint.hh.

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 873 of file JPolint.hh.

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 875 of file JPolint.hh.

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 877 of file JPolint.hh.

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 878 of file JPolint.hh.

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 879 of file JPolint.hh.

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.

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

Definition at line 88 of file JFunctional.hh.

Member Enumeration Documentation

anonymous enum
inherited

Constructor & Destructor Documentation

JPHYSICS::JGeant::JGeant ( )
inline

Default constructor.

Definition at line 44 of file JGeant.hh.

45  {}
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 54 of file JGeant.hh.

56  {
57  using JTOOLS::PI;
58 
59  const double n0 = geanx.n - 0.02;
60  const double n1 = geanx.n + 0.02;
61 
62  const JGeanx g0(geanx.a, geanx.b, n0);
63  const JGeanx g1(geanx.a, geanx.b, n1);
64 
65  const double y0 = g0.evaluate(-1.0, +1.0);
66  const double y1 = g1.evaluate(-1.0, +1.0);
67 
68  const double c = 1.0 / (y0 * 2*PI);
69 
70  // following range corresponds to n = 1 to n = infty
71 
72  for (double x = -2.0; x < 1.0; x += dx) {
73  (*this)[x] = c * g0.evaluate(x + 1.0/n0);
74  }
75 
76  compile();
77 
78  // linear approximation of dependence normalisation constant on index of refraction
79 
80  u = (y1 - y0) / y0 / (n1 - n0);
81  z = 1.0 + u*n0;
82  }
double u
slope of the normalisation dependence
Definition: JGeant.hh:180
static const double PI
Constants.
Definition: JConstants.hh:20
const double b
slope
Definition: JGeanx.hh:137
double z
offset of the normalisation dependence
Definition: JGeant.hh:179
const double n
index of refraction
Definition: JGeanx.hh:138
virtual void compile()
Function compilation.
Definition: JGeant.hh:88
Probability density function of photon emission from EM-shower as a function of cosine of the emissio...
Definition: JGeanx.hh:35
const double a
power
Definition: JGeanx.hh:136
Double_t g1(const Double_t x)
Function.
Definition: JQuantiles.cc:25

Member Function Documentation

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

Function compilation.

Definition at line 88 of file JGeant.hh.

89  {
90  JTOOLS::JGridPolint0Function1D_t::compile();
91 
92  buffer.clear();
93 
94  JTOOLS::integrate(*this, buffer);
95 
96  buffer.compile();
97  }
JTOOLS::JGridPolint0Function1D_t buffer
Definition: JGeant.hh:181
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
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 108 of file JGeant.hh.

110  {
111  const double y = JTOOLS::JGridPolint0Function1D_t::operator()(ct - 1.0/n);
112 
113  return y * (z - u*n);
114  }
double u
slope of the normalisation dependence
Definition: JGeant.hh:180
result_type operator()(const argument_type x) const
Function value evaluation.
Definition: JFunctional.hh:333
double z
offset of the normalisation dependence
Definition: JGeant.hh:179
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 126 of file JGeant.hh.

129  {
130  const double x_max = std::min(xmax - 1.0/n, buffer.rbegin()->getX());
131  const double x_min = std::max(xmin - 1.0/n, buffer. begin()->getX());
132 
133  double y = 0.0;
134 
135  y += buffer(x_max);
136  y -= buffer(x_min);
137 
138  return y * (z - u*n);
139  }
double u
slope of the normalisation dependence
Definition: JGeant.hh:180
JTOOLS::JGridPolint0Function1D_t buffer
Definition: JGeant.hh:181
double z
offset of the normalisation dependence
Definition: JGeant.hh:179
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  }
virtual result_type evaluate(const argument_type *pX) const =0
Recursive function value evaluation.
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
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 106 of file JFunctional.hh.

108  {
109  return function.evaluate(pX);
110  }
static result_type JTOOLS::JFunctional< JElement2D< double, double >::abscissa_type , double >::getValue ( typename JClass< result_type >::argument_type  y,
const argument_type pX 
)
inlinestaticinherited

Termination of recursive function value evaluation.

Parameters
yresult
pXpointer to abscissa values

Definition at line 119 of file JFunctional.hh.

121  {
122  return y;
123  }
JSupervisor JTOOLS::JFunctional< JElement2D< double, double >::abscissa_type , double >::getSupervisor ( ) const
inlineinherited

Get supervisor.

Returns
supervisor

Definition at line 264 of file JFunctional.hh.

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

Get exception handler.

Returns
exception handler

Definition at line 275 of file JFunctional.hh.

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 286 of file JFunctional.hh.

Friends And Related Function Documentation

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

Read geant from input.

Parameters
inreader
geantgeant
Returns
reader

Definition at line 149 of file JGeant.hh.

150  {
151  in >> geant.z;
152  in >> geant.u;
153  in >> static_cast<JTOOLS::JGridPolint0Function1D_t&>(geant);
154 
155  geant.compile();
156 
157  return in;
158  }
Type definition of a zero degree polynomial interpolation based on a JGridCollection with result type...
double u
slope of the normalisation dependence
Definition: JGeant.hh:180
static const JGeant geant(geanx, 0.0001)
Function object for the number of photons from EM-shower as a function of emission angle...
double z
offset of the normalisation dependence
Definition: JGeant.hh:179
virtual void compile()
Function compilation.
Definition: JGeant.hh:88
JWriter& operator<< ( JWriter out,
const JGeant geant 
)
friend

Write geant to output.

Parameters
outwriter
geantgeant
Returns
writer

Definition at line 168 of file JGeant.hh.

169  {
170  out << geant.z;
171  out << geant.u;
172  out << static_cast<const JTOOLS::JGridPolint0Function1D_t&>(geant);
173 
174  return out;
175  }
double u
slope of the normalisation dependence
Definition: JGeant.hh:180
static const JGeant geant(geanx, 0.0001)
Function object for the number of photons from EM-shower as a function of emission angle...
double z
offset of the normalisation dependence
Definition: JGeant.hh:179

Member Data Documentation

double JPHYSICS::JGeant::z
private

offset of the normalisation dependence

Definition at line 179 of file JGeant.hh.

double JPHYSICS::JGeant::u
private

slope of the normalisation dependence

Definition at line 180 of file JGeant.hh.

JTOOLS::JGridPolint0Function1D_t JPHYSICS::JGeant::buffer
private

Definition at line 181 of file JGeant.hh.

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

Definition at line 293 of file JFunctional.hh.


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