Jpp - the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
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. More...
 
 JPD0Transformer_t (const double ln, const int alpha, const double kmin, const double kmax)
 Constructor. More...
 
virtual clone_type clone () const override
 Clone object. More...
 
virtual argument_type putXn (const_array_type &buffer, const argument_type xn) const override
 Evaluate arrival time. More...
 
virtual argument_type getXn (const_array_type &buffer, const argument_type xn) const override
 Evaluate arrival time. More...
 
virtual double getWeight (const_array_type &buffer) const override
 Weight function. More...
 
virtual JReader & read (JReader &in) override
 Read PDF transformer from input. More...
 
virtual JWriter & write (JWriter &out) const override
 Write PDF transformer to output. More...
 
std::ostream & print (std::ostream &out) const
 Print PDF transformer to output stream. More...
 
template<class... Args>
double getWeight (const argument_type x, const Args &...args) const
 Weight function. More...
 

Static Public Member Functions

static double getDmin ()
 Get shortest distance. More...
 
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...
 

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

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

Definition at line 259 of file JPDFTransformer.hh.

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

Definition at line 261 of file JPDFTransformer.hh.

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

Definition at line 262 of file JPDFTransformer.hh.

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

Definition at line 263 of file JPDFTransformer.hh.

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

Definition at line 39 of file JMultiMapTransformer.hh.

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

Definition at line 43 of file JMultiMapTransformer.hh.

Constructor & Destructor Documentation

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].
double kmax
maximal kappa
double kmin
minimal kappa
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  {}
int alpha
Distance dependence (power term)
double ln
Effective attenuation length [m].
double kmax
maximal kappa
double kmin
minimal kappa

Member Function Documentation

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  }
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.
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  }
do echo Generating $dir eval D
Definition: JDrawLED.sh:50
double getIndexOfRefraction()
Get average index of refraction of water corresponding to group velocity.
double kmax
maximal kappa
const double getInverseSpeedOfLight()
Get inverse speed of light.
double kmin
minimal kappa
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  }
do echo Generating $dir eval D
Definition: JDrawLED.sh:50
double getIndexOfRefraction()
Get average index of refraction of water corresponding to group velocity.
double kmax
maximal kappa
const double getInverseSpeedOfLight()
Get inverse speed of light.
double kmin
minimal kappa
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  }
do echo Generating $dir eval D
Definition: JDrawLED.sh:50
int alpha
Distance dependence (power term)
then set_variable FORMULA *[0] exp(-0.5 *(x-[1])*(x-[1])/([2]*[2]))*exp(-0.5 *(y-[1])*(y-[1])/([2]*[2]))" JF2 -o $WORKDIR/f2.root -F "$FORMULA" -@ "p0
double ln
Effective attenuation length [m].
static double getDmin()
Get shortest distance.
T pow(const T &x, const double y)
Power .
Definition: JMath.hh:98
then JMuonMCEvt f $INPUT_FILE o $INTERMEDIATE_FILE d
Definition: JMuonPath.sh:45
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  }
int alpha
Distance dependence (power term)
double ln
Effective attenuation length [m].
double kmax
maximal kappa
double kmin
minimal kappa
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
Definition: JCanberra.sh:38
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  }
int alpha
Distance dependence (power term)
double ln
Effective attenuation length [m].
double kmax
maximal kappa
double kmin
minimal kappa
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  }
int alpha
Distance dependence (power term)
double ln
Effective attenuation length [m].
double kmax
maximal kappa
double kmin
minimal kappa
template<unsigned int N, class JArgument_t>
template<class... Args>
double JTOOLS::JMultiMapTransformer< N, JArgument_t >::getWeight ( const argument_type  x,
const Args &...  args 
) const
inlineinherited

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  }
JArray< N, argument_type > array_type
virtual double getWeight(const_array_type &buffer) const =0
Weight function.
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  }
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

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

Effective attenuation length [m].

Definition at line 446 of file JPDFTransformer.hh.

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

Distance dependence (power term)

Definition at line 447 of file JPDFTransformer.hh.

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

minimal kappa

Definition at line 448 of file JPDFTransformer.hh.

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: