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

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

#include <JPDFTransformer.hh>

Inheritance diagram for JPHYSICS::JPDFTransformer_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_typearray_type
 

Public Member Functions

 JPDFTransformer_t ()
 Default constructor.
 
 JPDFTransformer_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 JReaderread (JReader &in) override
 Read PDF transformer from input.
 
virtual JWriterwrite (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 getRmin ()
 Get shortest distance of approach.
 
static const JMultiMapTransformergetDefaultTransformer ()
 Get default transformer.
 
static JMultiMapTransformergetClone ()
 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::JPDFTransformer_t< JArgument_t >

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

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 40 of file JPDFTransformer.hh.

Member Typedef Documentation

◆ JMultiMapTransformer_t

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

Definition at line 45 of file JPDFTransformer.hh.

◆ clone_type

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

Definition at line 47 of file JPDFTransformer.hh.

◆ argument_type

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

Definition at line 48 of file JPDFTransformer.hh.

◆ const_array_type

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

Definition at line 49 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

◆ JPDFTransformer_t() [1/2]

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

Default constructor.

Definition at line 67 of file JPDFTransformer.hh.

67 :
68 ln (0.0),
69 alpha(0),
70 kmin (0.0),
71 kmax (0.0)
72 {}
int alpha
Distance dependence (power term)
double ln
Effective attenuation length [m].

◆ JPDFTransformer_t() [2/2]

template<class JArgument_t >
JPHYSICS::JPDFTransformer_t< JArgument_t >::JPDFTransformer_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 83 of file JPDFTransformer.hh.

86 :
87 ln (ln),
88 alpha(alpha),
89 kmin (kmin),
90 kmax (kmax)
91 {}

Member Function Documentation

◆ getRmin()

template<class JArgument_t >
static double JPHYSICS::JPDFTransformer_t< JArgument_t >::getRmin ( )
inlinestatic

Get shortest distance of approach.

Returns
distance [m]

Definition at line 58 of file JPDFTransformer.hh.

59 {
60 return 0.01;
61 }

◆ clone()

template<class JArgument_t >
virtual clone_type JPHYSICS::JPDFTransformer_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 99 of file JPDFTransformer.hh.

100 {
101 return new JPDFTransformer_t(*this);
102 }
JPDFTransformer_t()
Default constructor.

◆ putXn()

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

Evaluate arrival time.

Parameters
buffer{R_m}
xnold t_ns
Returns
new t_ns

Implements JTOOLS::JMultiMapTransformer< N, JArgument_t >.

Definition at line 112 of file JPDFTransformer.hh.

113 {
114 using namespace JTOOLS;
115
116 const double R = buffer[0];
117
118 double x = xn;
119
120 const double t0 = R * getTanThetaC() * getInverseSpeedOfLight();
121 const double t1 = R * kmin * getInverseSpeedOfLight();
122
123 x -= t1 - t0;
124
125 if (kmax > kmin) {
126 x /= R * (kmax - kmin) * getInverseSpeedOfLight();
127 }
128
129 return x;
130 }
const double getInverseSpeedOfLight()
Get inverse speed of light.
double getTanThetaC()
Get average tangent of Cherenkov angle of water corresponding to group velocity.
Auxiliary classes and methods for multi-dimensional interpolations and histograms.

◆ getXn()

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

Evaluate arrival time.

Parameters
buffer{R_m}
xnold t_ns
Returns
new t_ns

Implements JTOOLS::JMultiMapTransformer< N, JArgument_t >.

Definition at line 140 of file JPDFTransformer.hh.

141 {
142 using namespace JTOOLS;
143
144 const double R = buffer[0];
145
146 double x = xn;
147
148 if (kmax > kmin) {
149 x *= R * (kmax - kmin) * getInverseSpeedOfLight();
150 }
151
152 const double t0 = R * getTanThetaC() * getInverseSpeedOfLight();
153 const double t1 = R * kmin * getInverseSpeedOfLight();
154
155 x += t1 - t0;
156
157 return x;
158 }

◆ getWeight() [1/2]

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

Weight function.

Parameters
buffer{R_m}
Returns
weight

Implements JTOOLS::JMultiMapTransformer< N, JArgument_t >.

Definition at line 167 of file JPDFTransformer.hh.

168 {
169 using namespace JTOOLS;
170
171 const double R = buffer[0];
172
173 const double n = getIndexOfRefraction();
174 const double ct0 = 1.0 / n;
175 const double st0 = sqrt((1.0 + ct0)*(1.0 - ct0));
176
177 const double d = sqrt(getRmin()*getRmin() + R*R) / st0;
178
179 return exp(-d/ln) / pow(d,alpha);
180 }
static double getRmin()
Get shortest distance of approach.
T pow(const T &x, const double y)
Power .
Definition JMath.hh:97
double getIndexOfRefraction()
Get average index of refraction of water corresponding to group velocity.
const int n
Definition JPolint.hh:791

◆ read()

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

Read PDF transformer from input.

Parameters
inreader
Returns
reader

Implements JIO::JSerialisable.

Definition at line 189 of file JPDFTransformer.hh.

190 {
191 in >> ln;
192 in >> alpha;
193 in >> kmin;
194 in >> kmax;
195
196 return in;
197 }

◆ write()

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

Write PDF transformer to output.

Parameters
outwriter
Returns
writer

Implements JIO::JSerialisable.

Definition at line 206 of file JPDFTransformer.hh.

207 {
208 out << ln;
209 out << alpha;
210 out << kmin;
211 out << kmax;
212
213 return out;
214 }

◆ print()

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

Print PDF transformer to output stream.

Parameters
outoutput stream
Returns
output stream

Definition at line 223 of file JPDFTransformer.hh.

224 {
225 using namespace std;
226
227 out << "Effective attenuation length [m] " << ln << endl;
228 out << "Distance dependence (power term) " << alpha << endl;
229 out << "Minimal kappa " << kmin << endl;
230 out << "Maximal kappa " << kmax << endl;
231
232 return out;
233 }

◆ 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::JPDFTransformer_t< JArgument_t >::ln

Effective attenuation length [m].

Definition at line 236 of file JPDFTransformer.hh.

◆ alpha

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

Distance dependence (power term)

Definition at line 237 of file JPDFTransformer.hh.

◆ kmin

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

minimal kappa

Definition at line 238 of file JPDFTransformer.hh.

◆ kmax

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

maximal kappa

Definition at line 239 of file JPDFTransformer.hh.


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