Jpp
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Private Attributes | List of all members
JPHYSICS::JPDFTransformer< 2, JArgument_t > Class Template Referenceabstract

Template specialisation of transformer of the 2D Probability Density Functions of the time response of a PMT. More...

#include <JPDFTransformer.hh>

Inheritance diagram for JPHYSICS::JPDFTransformer< 2, JArgument_t >:
JTOOLS::JMultiMapTransformer< 2, JArgument_t > JLANG::JClonable< JClonable_t, JDerived_t > JIO::JSerialisable

Public Types

typedef JTOOLS::JMultiMapTransformer< 2, JArgument_t > JMultiMapTransformer_t
 
typedef JMultiMapTransformer_t::clone_type clone_type
 
typedef JMultiMapTransformer_t::argument_type argument_type
 
typedef JMultiMapTransformer_t::const_array_type const_array_type
 
typedef JMultiMapTransformer< N, JArgument_t > multimaptransformer_type
 
typedef JArray< N, argument_type > array_type
 

Public Member Functions

 JPDFTransformer ()
 Default constructor. More...
 
 JPDFTransformer (const double ln, const int alpha, const double kmin, const double kmax, const JGeant &geant, const double bmin)
 Constructor. More...
 
virtual clone_type clone () const
 Clone object. More...
 
virtual argument_type putXn (const_array_type &buffer, const argument_type xn) const
 Evaluate dt value as a function of {D, cd}. More...
 
virtual argument_type getXn (const_array_type &buffer, const argument_type xn) const
 Evaluate dt value as a function of {D, cd}. More...
 
virtual double getWeight (const_array_type &buffer) const
 Weight function. More...
 
virtual JReader & read (JReader &in)
 Read PDF transformer from input. More...
 
virtual JWriter & write (JWriter &out) const
 Write PDF transformer to output. More...
 
std::ostream & print (std::ostream &out) const
 Print PDF transformer to output stream. More...
 
virtual argument_type putXn (const_array_type &buffer, const argument_type xn) const=0
 Evaluate xn value as a function of {x0, ..., xn-1}. More...
 
virtual argument_type getXn (const_array_type &buffer, const argument_type xn) const=0
 Evaluate xn value as a function of {x0, ..., xn-1}. More...
 
virtual double getWeight (const_array_type &buffer) const=0
 Weight function. More...
 
double getWeight (const argument_type x,...) const
 Weight function. More...
 

Static Public Member Functions

static double getDmin ()
 
static const JMultiMapTransformer & getDefaultTransformer ()
 Get default transformer. More...
 
static JMultiMapTransformer * getClone ()
 Get clone of default transformer. More...
 

Public Attributes

double __ln
 Effective attenuation length [m]. More...
 
int __alpha
 Distance dependence (power term) More...
 
double __kmin
 minimal kappa More...
 
double __kmax
 maximal kappa More...
 
JGeant getShowerProbability
 

Private Attributes

va_list ap
 
JArray< N, argument_type > buffer
 

Detailed Description

template<class JArgument_t>
class JPHYSICS::JPDFTransformer< 2, JArgument_t >

Template specialisation of transformer of the 2D Probability Density Functions of the time response of a PMT.

PDFs are evaluated by interpolation for:

  1. distance between EM shower and PMT [m]
  2. cosine angle EM shower direction and EM shower - PMT position
  3. arrival time [ns]

The evaluation of the weights is based on:

  1. effective attenuation length
  2. emission profile of the photons

Definition at line 255 of file JPDFTransformer.hh.

Member Typedef Documentation

◆ JMultiMapTransformer_t

template<class JArgument_t >
typedef JTOOLS::JMultiMapTransformer<2, JArgument_t> JPHYSICS::JPDFTransformer< 2, JArgument_t >::JMultiMapTransformer_t

Definition at line 260 of file JPDFTransformer.hh.

◆ clone_type

template<class JArgument_t >
typedef JMultiMapTransformer_t::clone_type JPHYSICS::JPDFTransformer< 2, JArgument_t >::clone_type

Definition at line 262 of file JPDFTransformer.hh.

◆ argument_type

template<class JArgument_t >
typedef JMultiMapTransformer_t::argument_type JPHYSICS::JPDFTransformer< 2, JArgument_t >::argument_type

Definition at line 263 of file JPDFTransformer.hh.

◆ const_array_type

template<class JArgument_t >
typedef JMultiMapTransformer_t::const_array_type JPHYSICS::JPDFTransformer< 2, JArgument_t >::const_array_type

Definition at line 264 of file JPDFTransformer.hh.

◆ multimaptransformer_type

typedef JMultiMapTransformer<N, JArgument_t> JTOOLS::JMultiMapTransformer< N, JArgument_t >::multimaptransformer_type
inherited

Definition at line 41 of file JMultiMapTransformer.hh.

◆ array_type

typedef JArray<N, argument_type> JTOOLS::JMultiMapTransformer< N, JArgument_t >::array_type
inherited

Definition at line 45 of file JMultiMapTransformer.hh.

Constructor & Destructor Documentation

◆ JPDFTransformer() [1/2]

template<class JArgument_t >
JPHYSICS::JPDFTransformer< 2, JArgument_t >::JPDFTransformer ( )
inline

Default constructor.

Definition at line 274 of file JPDFTransformer.hh.

274  :
275  __ln (0.0),
276  __alpha(0),
277  __kmin (0.0),
278  __kmax (0.0),
280  {}

◆ JPDFTransformer() [2/2]

template<class JArgument_t >
JPHYSICS::JPDFTransformer< 2, JArgument_t >::JPDFTransformer ( const double  ln,
const int  alpha,
const double  kmin,
const double  kmax,
const JGeant &  geant,
const double  bmin 
)
inline

Constructor.

Parameters
lnEffective attenuation length [m]
alphaDistance dependence (power term)
kminMinimal kappa
kmaxMaximal kappa
geantFunction photon emission from EM-shower
bminBaseline photon emission from EM-shower

Definition at line 293 of file JPDFTransformer.hh.

298  :
299  __ln (ln),
300  __alpha(alpha),
301  __kmin (kmin),
302  __kmax (kmax),
304  {
305  getShowerProbability.add(bmin);
307  }

Member Function Documentation

◆ getDmin()

template<class JArgument_t >
static double JPHYSICS::JPDFTransformer< 2, JArgument_t >::getDmin ( )
inlinestatic

Definition at line 268 of file JPDFTransformer.hh.

268 { return 0.01; } // shortest distance [m]

◆ clone()

template<class JArgument_t >
virtual clone_type JPHYSICS::JPDFTransformer< 2, JArgument_t >::clone ( ) const
inlinevirtual

Clone object.

Returns
pointer to newly created JPDFTransformer

Reimplemented from JLANG::JClonable< JClonable_t, JDerived_t >.

Definition at line 315 of file JPDFTransformer.hh.

316  {
317  return new JPDFTransformer(*this);
318  }

◆ putXn() [1/2]

template<class JArgument_t >
virtual argument_type JPHYSICS::JPDFTransformer< 2, JArgument_t >::putXn ( const_array_type &  buffer,
const argument_type  xn 
) const
inlinevirtual

Evaluate dt value as a function of {D, cd}.

Parameters
buffer{D, cd}
xnold dt value
Returns
new dt value

Definition at line 328 of file JPDFTransformer.hh.

329  {
330  using namespace JTOOLS;
331 
332  const double D = buffer[0];
333  //const double cd = buffer[1];
334 
335  double x = xn;
336 
337  const double t0 = D * getIndexOfRefraction() * getInverseSpeedOfLight();
338  const double t1 = D * __kmin * getInverseSpeedOfLight();
339 
340  x -= t1 - t0;
341 
342  if (__kmax > __kmin) {
343  x /= D * (__kmax - __kmin) * getInverseSpeedOfLight();
344  }
345 
346  return x;
347  }

◆ getXn() [1/2]

template<class JArgument_t >
virtual argument_type JPHYSICS::JPDFTransformer< 2, JArgument_t >::getXn ( const_array_type &  buffer,
const argument_type  xn 
) const
inlinevirtual

Evaluate dt value as a function of {D, cd}.

Parameters
buffer{D, cd}
xnold dt value
Returns
new dt value

Definition at line 357 of file JPDFTransformer.hh.

358  {
359  using namespace JTOOLS;
360 
361  const double D = buffer[0];
362  //const double cd = buffer[1];
363 
364  double x = xn;
365 
366  if (__kmax > __kmin) {
367  x *= D * (__kmax - __kmin) * getInverseSpeedOfLight();
368  }
369 
370  const double t0 = D * getIndexOfRefraction() * getInverseSpeedOfLight();
371  const double t1 = D * __kmin * getInverseSpeedOfLight();
372 
373  x += t1 - t0;
374 
375  return x;
376  }

◆ getWeight() [1/3]

template<class JArgument_t >
virtual double JPHYSICS::JPDFTransformer< 2, JArgument_t >::getWeight ( const_array_type &  buffer) const
inlinevirtual

Weight function.

Parameters
buffer{D, cd}
Returns
weight

Definition at line 385 of file JPDFTransformer.hh.

386  {
387  using namespace JTOOLS;
388 
389  const double D = buffer[0];
390  const double cd = buffer[1];
391 
392  const double d = sqrt(getDmin()*getDmin() + D*D);
393 
394  return getShowerProbability(getIndexOfRefractionPhase(), cd) * exp(-d/__ln) / pow(d,__alpha);
395  }

◆ read()

template<class JArgument_t >
virtual JReader& JPHYSICS::JPDFTransformer< 2, JArgument_t >::read ( JReader &  in)
inlinevirtual

Read PDF transformer from input.

Parameters
inreader
Returns
reader

Implements JIO::JSerialisable.

Definition at line 404 of file JPDFTransformer.hh.

405  {
406  in >> __ln;
407  in >> __alpha;
408  in >> __kmin;
409  in >> __kmax;
410  in >> getShowerProbability;
411 
412  return in;
413  }

◆ write()

template<class JArgument_t >
virtual JWriter& JPHYSICS::JPDFTransformer< 2, JArgument_t >::write ( JWriter &  out) const
inlinevirtual

Write PDF transformer to output.

Parameters
outwriter
Returns
writer

Implements JIO::JSerialisable.

Definition at line 422 of file JPDFTransformer.hh.

423  {
424  out << __ln;
425  out << __alpha;
426  out << __kmin;
427  out << __kmax;
428  out << getShowerProbability;
429 
430  return out;
431  }

◆ print()

template<class JArgument_t >
std::ostream& JPHYSICS::JPDFTransformer< 2, JArgument_t >::print ( std::ostream &  out) const
inline

Print PDF transformer to output stream.

Parameters
outoutput stream
Returns
output stream

Definition at line 440 of file JPDFTransformer.hh.

441  {
442  using std::endl;
443 
444  out << "Effective attenuation length [m] " << __ln << endl;
445  out << "Distance dependence (power term) " << __alpha << endl;
446  out << "Minimal kappa " << __kmin << endl;
447  out << "Maximal kappa " << __kmax << endl;
448 
449  return out;
450  }

◆ putXn() [2/2]

virtual argument_type JTOOLS::JMultiMapTransformer< N, JArgument_t >::putXn ( const_array_type &  buffer,
const argument_type  xn 
) const
pure virtualinherited

Evaluate xn value as a function of {x0, ..., xn-1}.

Parameters
bufferx0 - xn-1 values
xnxn value
Returns
xn value

◆ getXn() [2/2]

virtual argument_type JTOOLS::JMultiMapTransformer< N, JArgument_t >::getXn ( const_array_type &  buffer,
const argument_type  xn 
) const
pure virtualinherited

Evaluate xn value as a function of {x0, ..., xn-1}.

Parameters
bufferx0 - xn-1 values
xnxn value
Returns
xn value

◆ getWeight() [2/3]

virtual double JTOOLS::JMultiMapTransformer< N, JArgument_t >::getWeight ( const_array_type &  buffer) const
pure virtualinherited

Weight function.

Parameters
bufferx0 - xn-1 values
Returns
weight

◆ getWeight() [3/3]

double JTOOLS::JMultiMapTransformer< N, JArgument_t >::getWeight ( const argument_type  x,
  ... 
) const
inlineinherited

Weight function.

Parameters
xcomma seperated list of abscissa values
Returns
weight

Definition at line 84 of file JMultiMapTransformer.hh.

85  {
86  va_start(ap, x);
87 
88  buffer[0] = x;
89 
90  for (int i = 1; i != N; ++i) {
91  buffer[i] = va_arg(ap, argument_type);
92  }
93 
94  va_end(ap);
95 
96  return getWeight(buffer);
97  }

◆ getDefaultTransformer()

static const JMultiMapTransformer& JTOOLS::JMultiMapTransformer< N, JArgument_t >::getDefaultTransformer ( )
inlinestaticinherited

Get default transformer.

Returns
default transformer

Definition at line 111 of file JMultiMapTransformer.hh.

112  {
113  static const JMultiMapDefaultTransformer transformer;
114 
115  return transformer;
116  }

◆ getClone()

static JMultiMapTransformer* JTOOLS::JMultiMapTransformer< N, JArgument_t >::getClone ( )
inlinestaticinherited

Get clone of default transformer.

Returns
pointer to newly created transformer

Definition at line 124 of file JMultiMapTransformer.hh.

125  {
126  return new JMultiMapDefaultTransformer();
127  }

Member Data Documentation

◆ __ln

template<class JArgument_t >
double JPHYSICS::JPDFTransformer< 2, JArgument_t >::__ln

Effective attenuation length [m].

Definition at line 453 of file JPDFTransformer.hh.

◆ __alpha

template<class JArgument_t >
int JPHYSICS::JPDFTransformer< 2, JArgument_t >::__alpha

Distance dependence (power term)

Definition at line 454 of file JPDFTransformer.hh.

◆ __kmin

template<class JArgument_t >
double JPHYSICS::JPDFTransformer< 2, JArgument_t >::__kmin

minimal kappa

Definition at line 455 of file JPDFTransformer.hh.

◆ __kmax

template<class JArgument_t >
double JPHYSICS::JPDFTransformer< 2, JArgument_t >::__kmax

maximal kappa

Definition at line 456 of file JPDFTransformer.hh.

◆ getShowerProbability

template<class JArgument_t >
JGeant JPHYSICS::JPDFTransformer< 2, JArgument_t >::getShowerProbability

Definition at line 457 of file JPDFTransformer.hh.

◆ ap

va_list JTOOLS::JMultiMapTransformer< N, JArgument_t >::ap
mutableprivateinherited

Definition at line 131 of file JMultiMapTransformer.hh.

◆ buffer

JArray<N, argument_type> JTOOLS::JMultiMapTransformer< N, JArgument_t >::buffer
mutableprivateinherited

Definition at line 132 of file JMultiMapTransformer.hh.


The documentation for this class was generated from the following file:
JTOOLS::JMultiMapTransformer< 2, JArgument_t >::ap
va_list ap
Definition: JMultiMapTransformer.hh:131
JPHYSICS::JPDFTransformer< 2, JArgument_t >::JPDFTransformer
JPDFTransformer()
Default constructor.
Definition: JPDFTransformer.hh:274
JTOOLS::JMultiMapTransformer< 2, JArgument_t >::buffer
JArray< N, argument_type > buffer
Definition: JMultiMapTransformer.hh:132
JTOOLS::getInverseSpeedOfLight
const double getInverseSpeedOfLight()
Get inverse speed of light.
Definition: JConstants.hh:100
JPHYSICS::JGeant::compile
virtual void compile()
Function compilation.
Definition: JGeant.hh:90
JPHYSICS::JPDFTransformer< 2, JArgument_t >::getDmin
static double getDmin()
Definition: JPDFTransformer.hh:268
JTOOLS::getIndexOfRefraction
double getIndexOfRefraction()
Get average index of refraction of water.
Definition: JConstants.hh:111
JPHYSICS::JPDFTransformer< 2, JArgument_t >::__kmin
double __kmin
minimal kappa
Definition: JPDFTransformer.hh:455
JPHYSICS::JPDFTransformer< 2, JArgument_t >::__alpha
int __alpha
Distance dependence (power term)
Definition: JPDFTransformer.hh:454
JTOOLS::JMultiMapTransformer< 2, JArgument_t >::getWeight
virtual double getWeight(const_array_type &buffer) const=0
Weight function.
JPHYSICS::JPDFTransformer< 2, JArgument_t >::__kmax
double __kmax
maximal kappa
Definition: JPDFTransformer.hh:456
JTOOLS::getIndexOfRefractionPhase
double getIndexOfRefractionPhase()
Get average index of refraction of water.
Definition: JConstants.hh:122
JTOOLS::JMultiMapTransformer< 2, JArgument_t >::argument_type
JArgument_t argument_type
Definition: JMultiMapTransformer.hh:44
JPHYSICS::JPDFTransformer< 2, JArgument_t >::getShowerProbability
JGeant getShowerProbability
Definition: JPDFTransformer.hh:457
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.
JTOOLS
Auxiliary classes and methods for multi-dimensional interpolations and histograms.
Definition: JAbstractCollection.hh:9
JPHYSICS::JPDFTransformer< 2, JArgument_t >::__ln
double __ln
Effective attenuation length [m].
Definition: JPDFTransformer.hh:453