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

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

#include <JPDFTransformer.hh>

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

Public Types

typedef JPDFTransformer< 2, JArgument_t > JFunction2DTransformer_t
 
typedef JTOOLS::JMultiMapTransformer< 4, 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 JTOOLS::JGridPolint1Function1D_t JFunction1D_t
 
typedef JMultiMapTransformer< N, JArgument_t > multimaptransformer_type
 
typedef JArray< N, argument_type > array_type
 

Public Member Functions

 JPDFTransformer ()
 Default constructor. More...
 
template<class T >
 JPDFTransformer (const double ln, const int alpha, const double kmin, const double kmax, const JGeant geant, const double bmin, T pmt, const double amin)
 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, theta, phi}. More...
 
virtual argument_type getXn (const_array_type &buffer, const argument_type xn) const
 Evaluate dt value as a function of {D, cd, theta, phi}. 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 transfomer 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

JFunction2DTransformer_t transformer
 
JFunction1D_t getAngularAcceptance
 

Private Attributes

va_list ap
 
JArray< N, argument_type > buffer
 

Detailed Description

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

Template specialisation of transformer of the 4D 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. zenith angle of the PMT
  4. azimuthal angle of the PMT
  5. arrival time [ns]

The evaluation of the weights is based on:

  1. effective attenuation length
  2. angular acceptance of PMT

Definition at line 659 of file JPDFTransformer.hh.

Member Typedef Documentation

◆ JFunction2DTransformer_t

template<class JArgument_t >
typedef JPDFTransformer<2, JArgument_t> JPHYSICS::JPDFTransformer< 4, JArgument_t >::JFunction2DTransformer_t

Definition at line 664 of file JPDFTransformer.hh.

◆ JMultiMapTransformer_t

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

Definition at line 665 of file JPDFTransformer.hh.

◆ clone_type

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

Definition at line 667 of file JPDFTransformer.hh.

◆ argument_type

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

Definition at line 668 of file JPDFTransformer.hh.

◆ const_array_type

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

Definition at line 669 of file JPDFTransformer.hh.

◆ JFunction1D_t

template<class JArgument_t >
typedef JTOOLS::JGridPolint1Function1D_t JPHYSICS::JPDFTransformer< 4, JArgument_t >::JFunction1D_t

Definition at line 671 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< 4, JArgument_t >::JPDFTransformer ( )
inline

Default constructor.

Definition at line 681 of file JPDFTransformer.hh.

681  :
682  transformer(),
684  {}

◆ JPDFTransformer() [2/2]

template<class JArgument_t >
template<class T >
JPHYSICS::JPDFTransformer< 4, JArgument_t >::JPDFTransformer ( const double  ln,
const int  alpha,
const double  kmin,
const double  kmax,
const JGeant  geant,
const double  bmin,
T  pmt,
const double  amin 
)
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
pmtFunction angular acceptance of PMT
aminBaseline angular acceptance of PMT

Definition at line 700 of file JPDFTransformer.hh.

707  :
708  transformer(ln, alpha, kmin, kmax, geant, bmin),
710  {
711  getAngularAcceptance.configure(JTOOLS::make_grid(1000, -1.0, +1.0), pmt);
712  getAngularAcceptance.add(amin);
713  getAngularAcceptance.compile();
714  getAngularAcceptance.setExceptionHandler(new JFunction1D_t::JDefaultResult(0.0));
715  }

Member Function Documentation

◆ getDmin()

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

Definition at line 675 of file JPDFTransformer.hh.

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

◆ clone()

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

Clone object.

Returns
pointer to newly created JPDFTransformer

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

Definition at line 723 of file JPDFTransformer.hh.

724  {
725  return new JPDFTransformer(*this);
726  }

◆ putXn() [1/2]

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

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

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

Definition at line 736 of file JPDFTransformer.hh.

737  {
738  return transformer.putXn(buffer, xn);
739  }

◆ getXn() [1/2]

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

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

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

Definition at line 749 of file JPDFTransformer.hh.

750  {
751  return transformer.getXn(buffer, xn);
752  }

◆ getWeight() [1/3]

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

Weight function.

Parameters
buffer{D, cd, theta, phi}
Returns
weight

Definition at line 761 of file JPDFTransformer.hh.

762  {
763  const double cd = buffer[1];
764  const double theta = buffer[2];
765  const double phi = buffer[3];
766 
767  const double ct0 = cd;
768  const double st0 = sqrt((1.0 + ct0)*(1.0 - ct0));
769 
770  const double px = sin(theta)*cos(phi);
771  //const double py = sin(theta)*sin(phi);
772  const double pz = cos(theta);
773 
774  const double ct = st0*px + ct0*pz;
775 
777  }

◆ read()

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

Read PDF transformer from input.

Parameters
inreader
Returns
reader

Implements JIO::JSerialisable.

Definition at line 786 of file JPDFTransformer.hh.

787  {
788  in >> transformer;
789  in >> getAngularAcceptance;
790 
791  getAngularAcceptance.compile();
792 
793  return in;
794  }

◆ write()

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

Write PDF transformer to output.

Parameters
outwriter
Returns
writer

Implements JIO::JSerialisable.

Definition at line 803 of file JPDFTransformer.hh.

804  {
805  out << transformer;
806  out << getAngularAcceptance;
807 
808  return out;
809  }

◆ print()

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

Print PDF transfomer to output stream.

Parameters
outoutput stream
Returns
output stream

Definition at line 818 of file JPDFTransformer.hh.

819  {
820  return transformer.print(out);
821  }

◆ 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

◆ transformer

template<class JArgument_t >
JFunction2DTransformer_t JPHYSICS::JPDFTransformer< 4, JArgument_t >::transformer

Definition at line 824 of file JPDFTransformer.hh.

◆ getAngularAcceptance

template<class JArgument_t >
JFunction1D_t JPHYSICS::JPDFTransformer< 4, JArgument_t >::getAngularAcceptance

Definition at line 825 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:
JPHYSICS::JPDFTransformer< 4, JArgument_t >::JPDFTransformer
JPDFTransformer()
Default constructor.
Definition: JPDFTransformer.hh:681
JTOOLS::JMultiMapTransformer< 4, JArgument_t >::ap
va_list ap
Definition: JMultiMapTransformer.hh:131
JPHYSICS::JPDFTransformer< 2, JArgument_t >::print
std::ostream & print(std::ostream &out) const
Print PDF transformer to output stream.
Definition: JPDFTransformer.hh:440
JPHYSICS::JPDFTransformer< 2, JArgument_t >::getWeight
virtual double getWeight(const_array_type &buffer) const
Weight function.
Definition: JPDFTransformer.hh:385
JTOOLS::JMultiMapTransformer< 4, JArgument_t >::buffer
JArray< N, argument_type > buffer
Definition: JMultiMapTransformer.hh:132
JPHYSICS::JPDFTransformer< 4, JArgument_t >::transformer
JFunction2DTransformer_t transformer
Definition: JPDFTransformer.hh:824
JPHYSICS::JPDFTransformer< 4, JArgument_t >::getAngularAcceptance
JFunction1D_t getAngularAcceptance
Definition: JPDFTransformer.hh:825
JPHYSICS::JPDFTransformer< 2, JArgument_t >::putXn
virtual argument_type putXn(const_array_type &buffer, const argument_type xn) const
Evaluate dt value as a function of {D, cd}.
Definition: JPDFTransformer.hh:328
JTOOLS::JMultiMapTransformer< 4, JArgument_t >::getWeight
virtual double getWeight(const_array_type &buffer) const=0
Weight function.
JPHYSICS::JPDFTransformer< 2, JArgument_t >::getXn
virtual argument_type getXn(const_array_type &buffer, const argument_type xn) const
Evaluate dt value as a function of {D, cd}.
Definition: JPDFTransformer.hh:357
JTOOLS::make_grid
JGrid< JAbscissa_t > make_grid(const int nx, const JAbscissa_t Xmin, const JAbscissa_t Xmax)
Helper method for JGrid.
Definition: JGrid.hh:177
JTOOLS::JMultiMapTransformer< 4, JArgument_t >::argument_type
JArgument_t argument_type
Definition: JMultiMapTransformer.hh:44
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::JFunctional::setExceptionHandler
void setExceptionHandler(const JSupervisor &supervisor)
Set the supervisor for handling of exceptions.
Definition: JFunctional.hh:288