Jpp 21.0.0-rc.3
the software that should make you happy
Loading...
Searching...
No Matches
JPHYSICS::JPD0Transformer_t< JArgument_t > Class Template Reference

Transformer for the 1D probability density function (PDF) of the time response of a PMT due to a point source. More...

#include <JPDFTransformer.hh>

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

Public Types

typedef JMultiMapTransformer< 1, 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

 JPD0Transformer_t ()
 Default constructor.
 
 JPD0Transformer_t (const double ln, const int alpha, const double kmin, const double kmax)
 Constructor.
 
virtual clone_type clone () const override
 Clone object.
 
virtual argument_type putXn (const_array_type &buffer, const argument_type xn) const override
 Evaluate arrival time.
 
virtual argument_type getXn (const_array_type &buffer, const argument_type xn) const override
 Evaluate arrival time.
 
virtual double getWeight (const_array_type &buffer) const override
 Weight function.
 
virtual JReader & read (JReader &in) override
 Read PDF transformer from input.
 
virtual JWriter & write (JWriter &out) const override
 Write PDF transformer to output.
 
std::ostream & print (std::ostream &out) const
 Print PDF transformer to output stream.
 
template<class ... Args>
double getWeight (const argument_type x, const Args &...args) const
 Weight function.
 

Static Public Member Functions

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

Public Attributes

double ln
 Effective attenuation length [m].
 
int alpha
 Distance dependence (power term)
 
double kmin
 minimal kappa
 
double kmax
 maximal kappa
 

Detailed Description

template<class JArgument_t>
class JPHYSICS::JPD0Transformer_t< JArgument_t >

Transformer for the 1D probability density function (PDF) of the time response of a PMT due to a point source.

PDFs are evaluated by interpolation for:

  1. distance between point source and PMT [m]
  2. arrival time [ns]

The evaluation of the weights is based on:

  1. effective attenuation length

Definition at line 254 of file JPDFTransformer.hh.

Member Typedef Documentation

◆ JMultiMapTransformer_t

template<class JArgument_t >
JMultiMapTransformer<1, JArgument_t> JPHYSICS::JPD0Transformer_t< JArgument_t >::JMultiMapTransformer_t

Definition at line 259 of file JPDFTransformer.hh.

◆ clone_type

template<class JArgument_t >
JMultiMapTransformer_t::clone_type JPHYSICS::JPD0Transformer_t< JArgument_t >::clone_type

Definition at line 261 of file JPDFTransformer.hh.

◆ argument_type

template<class JArgument_t >
JMultiMapTransformer_t::argument_type JPHYSICS::JPD0Transformer_t< JArgument_t >::argument_type

Definition at line 262 of file JPDFTransformer.hh.

◆ const_array_type

template<class JArgument_t >
JMultiMapTransformer_t::const_array_type JPHYSICS::JPD0Transformer_t< JArgument_t >::const_array_type

Definition at line 263 of file JPDFTransformer.hh.

◆ multimaptransformer_type

template<unsigned int N, class JArgument_t >
JMultiMapTransformer<N, JArgument_t> JTOOLS::JMultiMapTransformer< N, JArgument_t >::multimaptransformer_type
inherited

Definition at line 39 of file JMultiMapTransformer.hh.

◆ array_type

template<unsigned int N, class JArgument_t >
JArray<N, argument_type> JTOOLS::JMultiMapTransformer< N, JArgument_t >::array_type
inherited

Definition at line 43 of file JMultiMapTransformer.hh.

Constructor & Destructor Documentation

◆ JPD0Transformer_t() [1/2]

template<class JArgument_t >
JPHYSICS::JPD0Transformer_t< JArgument_t >::JPD0Transformer_t ( )
inline

Default constructor.

Definition at line 281 of file JPDFTransformer.hh.

281 :
282 ln (0.0),
283 alpha(0),
284 kmin (0.0),
285 kmax (0.0)
286 {}
int alpha
Distance dependence (power term)
double ln
Effective attenuation length [m].

◆ JPD0Transformer_t() [2/2]

template<class JArgument_t >
JPHYSICS::JPD0Transformer_t< JArgument_t >::JPD0Transformer_t ( const double ln,
const int alpha,
const double kmin,
const double kmax )
inline

Constructor.

Parameters
lnEffective attenuation length [m]
alphaDistance dependence (power term)
kminMinimal kappa
kmaxMaximal kappa

Definition at line 297 of file JPDFTransformer.hh.

300 :
301 ln (ln),
302 alpha(alpha),
303 kmin (kmin),
304 kmax (kmax)
305 {}

Member Function Documentation

◆ getDmin()

template<class JArgument_t >
static double JPHYSICS::JPD0Transformer_t< JArgument_t >::getDmin ( )
inlinestatic

Get shortest distance.

Returns
distance [m]

Definition at line 272 of file JPDFTransformer.hh.

273 {
274 return 0.01;
275 }

◆ clone()

template<class JArgument_t >
virtual clone_type JPHYSICS::JPD0Transformer_t< JArgument_t >::clone ( ) const
inlineoverridevirtual

Clone object.

Returns
pointer to newly created transformer

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

Definition at line 313 of file JPDFTransformer.hh.

314 {
315 return new JPD0Transformer_t(*this);
316 }
JPD0Transformer_t()
Default constructor.

◆ putXn()

template<class JArgument_t >
virtual argument_type JPHYSICS::JPD0Transformer_t< JArgument_t >::putXn ( const_array_type & buffer,
const argument_type xn ) const
inlineoverridevirtual

Evaluate arrival time.

Parameters
buffer{D_m}
xnold t_ns
Returns
new t_ns

Implements JTOOLS::JMultiMapTransformer< N, JArgument_t >.

Definition at line 326 of file JPDFTransformer.hh.

327 {
328 using namespace JTOOLS;
329
330 const double D = buffer[0];
331
332 double x = xn;
333
334 const double t0 = D * getIndexOfRefraction() * getInverseSpeedOfLight();
335 const double t1 = D * kmin * getInverseSpeedOfLight();
336
337 x -= t1 - t0;
338
339 if (kmax > kmin) {
340 x /= D * (kmax - kmin) * getInverseSpeedOfLight();
341 }
342
343 return x;
344 }
double getIndexOfRefraction()
Get average index of refraction of water corresponding to group velocity.
const double getInverseSpeedOfLight()
Get inverse speed of light.
Auxiliary classes and methods for multi-dimensional interpolations and histograms.

◆ getXn()

template<class JArgument_t >
virtual argument_type JPHYSICS::JPD0Transformer_t< JArgument_t >::getXn ( const_array_type & buffer,
const argument_type xn ) const
inlineoverridevirtual

Evaluate arrival time.

Parameters
buffer{D_m}
xnold t_ns
Returns
new t_ns

Implements JTOOLS::JMultiMapTransformer< N, JArgument_t >.

Definition at line 354 of file JPDFTransformer.hh.

355 {
356 using namespace JTOOLS;
357
358 const double D = buffer[0];
359
360 double x = xn;
361
362 if (kmax > kmin) {
363 x *= D * (kmax - kmin) * getInverseSpeedOfLight();
364 }
365
366 const double t0 = D * getIndexOfRefraction() * getInverseSpeedOfLight();
367 const double t1 = D * kmin * getInverseSpeedOfLight();
368
369 x += t1 - t0;
370
371 return x;
372 }

◆ getWeight() [1/2]

template<class JArgument_t >
virtual double JPHYSICS::JPD0Transformer_t< JArgument_t >::getWeight ( const_array_type & buffer) const
inlineoverridevirtual

Weight function.

Parameters
buffer{D_m}
Returns
weight

Implements JTOOLS::JMultiMapTransformer< N, JArgument_t >.

Definition at line 381 of file JPDFTransformer.hh.

382 {
383 using namespace JTOOLS;
384
385 const double D = buffer[0];
386
387 const double d = sqrt(getDmin()*getDmin() + D*D);
388
389 return exp(-d/ln) / pow(d,alpha);
390 }
static double getDmin()
Get shortest distance.
T pow(const T &x, const double y)
Power .
Definition JMath.hh:97

◆ read()

template<class JArgument_t >
virtual JReader & JPHYSICS::JPD0Transformer_t< JArgument_t >::read ( JReader & in)
inlineoverridevirtual

Read PDF transformer from input.

Parameters
inreader
Returns
reader

Implements JIO::JSerialisable.

Definition at line 399 of file JPDFTransformer.hh.

400 {
401 in >> ln;
402 in >> alpha;
403 in >> kmin;
404 in >> kmax;
405
406 return in;
407 }

◆ write()

template<class JArgument_t >
virtual JWriter & JPHYSICS::JPD0Transformer_t< JArgument_t >::write ( JWriter & out) const
inlineoverridevirtual

Write PDF transformer to output.

Parameters
outwriter
Returns
writer

Implements JIO::JSerialisable.

Definition at line 416 of file JPDFTransformer.hh.

417 {
418 out << ln;
419 out << alpha;
420 out << kmin;
421 out << kmax;
422
423 return out;
424 }

◆ print()

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

Print PDF transformer to output stream.

Parameters
outoutput stream
Returns
output stream

Definition at line 433 of file JPDFTransformer.hh.

434 {
435 using namespace std;
436
437 out << "Effective attenuation length [m] " << ln << endl;
438 out << "Distance dependence (power term) " << alpha << endl;
439 out << "Minimal kappa " << kmin << endl;
440 out << "Maximal kappa " << kmax << endl;
441
442 return out;
443 }

◆ getWeight() [2/2]

template<class JArgument_t >
template<class ... Args>
double JTOOLS::JMultiMapTransformer< N, JArgument_t >::getWeight ( const argument_type x,
const Args &... args ) const
inline

Weight function.

Parameters
xfirst abscissa values
argscomma seperated list of remaining abscissa values
Returns
weight

Definition at line 84 of file JMultiMapTransformer.hh.

85 {
86 return getWeight(array_type(x, args...));
87 }
virtual double getWeight(const_array_type &buffer) const override
Weight function.
JArray< N, argument_type > array_type

◆ getDefaultTransformer()

template<unsigned int N, class JArgument_t >
static const JMultiMapTransformer & JTOOLS::JMultiMapTransformer< N, JArgument_t >::getDefaultTransformer ( )
inlinestaticinherited

Get default transformer.

Returns
default transformer

Definition at line 101 of file JMultiMapTransformer.hh.

102 {
103 static const JMultiMapDefaultTransformer transformer;
104
105 return transformer;
106 }

◆ getClone()

template<unsigned int N, class JArgument_t >
static JMultiMapTransformer * JTOOLS::JMultiMapTransformer< N, JArgument_t >::getClone ( )
inlinestaticinherited

Get clone of default transformer.

Returns
pointer to newly created transformer

Definition at line 114 of file JMultiMapTransformer.hh.

115 {
116 return new JMultiMapDefaultTransformer();
117 }

Member Data Documentation

◆ ln

template<class JArgument_t >
double JPHYSICS::JPD0Transformer_t< JArgument_t >::ln

Effective attenuation length [m].

Definition at line 446 of file JPDFTransformer.hh.

◆ alpha

template<class JArgument_t >
int JPHYSICS::JPD0Transformer_t< JArgument_t >::alpha

Distance dependence (power term)

Definition at line 447 of file JPDFTransformer.hh.

◆ kmin

template<class JArgument_t >
double JPHYSICS::JPD0Transformer_t< JArgument_t >::kmin

minimal kappa

Definition at line 448 of file JPDFTransformer.hh.

◆ kmax

template<class JArgument_t >
double JPHYSICS::JPD0Transformer_t< JArgument_t >::kmax

maximal kappa

Definition at line 449 of file JPDFTransformer.hh.


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