Jpp
 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::JPDFTransformer< 1, JArgument_t > Class Template Reference

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

#include <JPDFTransformer.hh>

Inheritance diagram for JPHYSICS::JPDFTransformer< 1, JArgument_t >:
JTOOLS::JMultiMapTransformer< 1, JArgument_t > JLANG::JClonable< JClass_t > JIO::JSerialisable

Public Types

typedef
JTOOLS::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_typearray_type
 

Public Member Functions

 JPDFTransformer ()
 Default constructor. More...
 
 JPDFTransformer (const double ln, const int alpha, const double kmin, const double kmax)
 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 {R}. More...
 
virtual argument_type getXn (const_array_type &buffer, const argument_type xn) const
 Evaluate dt value as a function of {R}. More...
 
virtual double getWeight (const_array_type &buffer) const
 Weight function. More...
 
virtual JReaderread (JReader &in)
 Read PDF transformer from input. More...
 
virtual JWriterwrite (JWriter &out) const
 Write PDF transformer to output. More...
 
std::ostream & print (std::ostream &out) const
 Print PDF transformer to output stream. More...
 
double getWeight (const argument_type x,...) const
 Weight function. More...
 

Static Public Member Functions

static double getRmin ()
 
static const JMultiMapTransformergetDefaultTransformer ()
 Get default transformer. More...
 
static JMultiMapTransformergetClone ()
 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::JPDFTransformer< 1, JArgument_t >

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

PDFs are evaluated by interpolation for:

  1. distance of closest approach of the muon to the PMT [m]
  2. arrival time [ns]

The evaluation of the weights is based on:

  1. effective attenuation length

Definition at line 47 of file JPDFTransformer.hh.

Member Typedef Documentation

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

Definition at line 52 of file JPDFTransformer.hh.

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

Definition at line 54 of file JPDFTransformer.hh.

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

Definition at line 55 of file JPDFTransformer.hh.

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

Definition at line 56 of file JPDFTransformer.hh.

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

Definition at line 41 of file JMultiMapTransformer.hh.

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

Definition at line 45 of file JMultiMapTransformer.hh.

Constructor & Destructor Documentation

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

Default constructor.

Definition at line 66 of file JPDFTransformer.hh.

66  :
67  __ln (0.0),
68  __alpha(0),
69  __kmin (0.0),
70  __kmax (0.0)
71  {}
double __ln
Effective attenuation length [m].
int __alpha
Distance dependence (power term)
template<class JArgument_t >
JPHYSICS::JPDFTransformer< 1, JArgument_t >::JPDFTransformer ( 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 82 of file JPDFTransformer.hh.

85  :
86  __ln (ln),
87  __alpha(alpha),
88  __kmin (kmin),
89  __kmax (kmax)
90  {}
double __ln
Effective attenuation length [m].
int __alpha
Distance dependence (power term)

Member Function Documentation

template<class JArgument_t >
static double JPHYSICS::JPDFTransformer< 1, JArgument_t >::getRmin ( )
inlinestatic

Definition at line 60 of file JPDFTransformer.hh.

60 { return 0.01; } // shortest distance of approach [m]
template<class JArgument_t >
virtual clone_type JPHYSICS::JPDFTransformer< 1, JArgument_t >::clone ( ) const
inlinevirtual

Clone object.

Returns
pointer to newly created JPDFTransformer

Implements JLANG::JClonable< JClass_t >.

Definition at line 98 of file JPDFTransformer.hh.

99  {
100  return new JPDFTransformer(*this);
101  }
template<class JArgument_t >
virtual argument_type JPHYSICS::JPDFTransformer< 1, JArgument_t >::putXn ( const_array_type buffer,
const argument_type  xn 
) const
inlinevirtual

Evaluate dt value as a function of {R}.

Parameters
buffer{R}
xnold dt value
Returns
new dt value

Implements JTOOLS::JMultiMapTransformer< 1, JArgument_t >.

Definition at line 111 of file JPDFTransformer.hh.

112  {
113  using namespace JTOOLS;
114 
115  const double R = buffer[0];
116 
117  double x = xn;
118 
119  const double t0 = R * getTanThetaC() * getInverseSpeedOfLight();
120  const double t1 = R * __kmin * getInverseSpeedOfLight();
121 
122  x -= t1 - t0;
123 
124  if (__kmax > __kmin) {
125  x /= R * (__kmax - __kmin) * getInverseSpeedOfLight();
126  }
127 
128  return x;
129  }
const double getInverseSpeedOfLight()
Get inverse speed of light.
Definition: JConstants.hh:100
double getTanThetaC()
Get average tangent of Cherenkov angle of water.
Definition: JConstants.hh:122
template<class JArgument_t >
virtual argument_type JPHYSICS::JPDFTransformer< 1, JArgument_t >::getXn ( const_array_type buffer,
const argument_type  xn 
) const
inlinevirtual

Evaluate dt value as a function of {R}.

Parameters
buffer{R}
xnold dt value
Returns
new dt value

Implements JTOOLS::JMultiMapTransformer< 1, JArgument_t >.

Definition at line 139 of file JPDFTransformer.hh.

140  {
141  using namespace JTOOLS;
142 
143  const double R = buffer[0];
144 
145  double x = xn;
146 
147  if (__kmax > __kmin) {
148  x *= R * (__kmax - __kmin) * getInverseSpeedOfLight();
149  }
150 
151  const double t0 = R * getTanThetaC() * getInverseSpeedOfLight();
152  const double t1 = R * __kmin * getInverseSpeedOfLight();
153 
154  x += t1 - t0;
155 
156  return x;
157  }
const double getInverseSpeedOfLight()
Get inverse speed of light.
Definition: JConstants.hh:100
double getTanThetaC()
Get average tangent of Cherenkov angle of water.
Definition: JConstants.hh:122
template<class JArgument_t >
virtual double JPHYSICS::JPDFTransformer< 1, JArgument_t >::getWeight ( const_array_type buffer) const
inlinevirtual

Weight function.

Parameters
buffer{R}
Returns
weight

Implements JTOOLS::JMultiMapTransformer< 1, JArgument_t >.

Definition at line 166 of file JPDFTransformer.hh.

167  {
168  using namespace JTOOLS;
169 
170  const double R = buffer[0];
171 
172  const double n = getIndexOfRefraction();
173  const double ct0 = 1.0 / n;
174  const double st0 = sqrt((1.0 + ct0)*(1.0 - ct0));
175 
176  const double d = sqrt(getRmin()*getRmin() + R*R) / st0;
177 
178  return exp(-d/__ln) / pow(d,__alpha);
179  }
double getIndexOfRefraction()
Get average index of refraction of water.
Definition: JConstants.hh:111
double __ln
Effective attenuation length [m].
int __alpha
Distance dependence (power term)
template<class JArgument_t >
virtual JReader& JPHYSICS::JPDFTransformer< 1, JArgument_t >::read ( JReader in)
inlinevirtual

Read PDF transformer from input.

Parameters
inreader
Returns
reader

Implements JIO::JSerialisable.

Definition at line 188 of file JPDFTransformer.hh.

189  {
190  in >> __ln;
191  in >> __alpha;
192  in >> __kmin;
193  in >> __kmax;
194 
195  return in;
196  }
double __ln
Effective attenuation length [m].
int __alpha
Distance dependence (power term)
template<class JArgument_t >
virtual JWriter& JPHYSICS::JPDFTransformer< 1, JArgument_t >::write ( JWriter out) const
inlinevirtual

Write PDF transformer to output.

Parameters
outwriter
Returns
writer

Implements JIO::JSerialisable.

Definition at line 205 of file JPDFTransformer.hh.

206  {
207  out << __ln;
208  out << __alpha;
209  out << __kmin;
210  out << __kmax;
211 
212  return out;
213  }
double __ln
Effective attenuation length [m].
int __alpha
Distance dependence (power term)
template<class JArgument_t >
std::ostream& JPHYSICS::JPDFTransformer< 1, JArgument_t >::print ( std::ostream &  out) const
inline

Print PDF transformer to output stream.

Parameters
outoutput stream
Returns
output stream

Definition at line 222 of file JPDFTransformer.hh.

223  {
224  using std::endl;
225 
226  out << "Effective attenuation length [m] " << __ln << endl;
227  out << "Distance dependence (power term) " << __alpha << endl;
228  out << "Minimal kappa " << __kmin << endl;
229  out << "Maximal kappa " << __kmax << endl;
230 
231  return out;
232  }
double __ln
Effective attenuation length [m].
int __alpha
Distance dependence (power term)
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  }
virtual double getWeight(const_array_type &buffer) const =0
Weight function.
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  }
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

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

Effective attenuation length [m].

Definition at line 235 of file JPDFTransformer.hh.

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

Distance dependence (power term)

Definition at line 236 of file JPDFTransformer.hh.

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

minimal kappa

Definition at line 237 of file JPDFTransformer.hh.

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

maximal kappa

Definition at line 238 of file JPDFTransformer.hh.


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