Jpp
JNPETable1D.hh
Go to the documentation of this file.
1 #ifndef __JNPETABLE1D__
2 #define __JNPETABLE1D__
3 
4 #include <cmath>
5 
6 #include "JTools/JSpline.hh"
7 #include "JTools/JElement.hh"
10 #include "JGeometry3D/JOmega3D.hh"
11 #include "JPhysics/JNPETable.hh"
12 
13 
14 /**
15  * \author mdejong
16  */
17 
18 namespace JPHYSICS {}
19 namespace JPP { using namespace JPHYSICS; }
20 
21 namespace JPHYSICS {
22 
27 
28 
29  /**
30  * Custom class for the integrated values of the PDF of the arrival time of Cherenkov light.
31  *
32  * This class provides for the average number of photo-electrons as a function of
33  * the leading parameter value (<tt>R</tt>).
34  * The average is taken over the orientations of the PMT in the full solid angle.
35  */
36  template<class JFunction1D_t>
37  class JNPETable1D :
38  public JFunction1D_t
39  {
40  public:
41 
43  typedef typename JFunction1D_t::result_type result_type;
44 
45 
46  /**
47  * Default constructor.
48  */
50  {}
51 
52 
53  /**
54  * Constructor.
55  *
56  * \param input multi-dimensional PDF
57  */
58  template<class JPDF_t, class JPDFMaplist_t, class JPDFDistance_t>
60  {
61  using namespace JTOOLS;
62  using namespace JGEOMETRY3D;
63 
64  typedef JTransformableMultiFunction<JPDF_t, JPDFMaplist_t, JPDFDistance_t> JTransformableMultiFunction_t;
65 
67 
68  const JOmega3D omega(0.03*PI);
69 
70  for (typename JTransformableMultiFunction_t::const_iterator i = input.begin(); i != input.end(); ++i) {
71 
72  const double R = i->getX();
73 
74  // average intensity
75 
76  double y = 0.0;
77 
78  for (JOmega3D::const_iterator dir = omega.begin(); dir != omega.end(); ++dir) {
79  y += intensity(R, dir->getTheta(), fabs(dir->getPhi()));
80  }
81 
82  this->put(R,y/omega.size());
83  }
84 
85  this->compile();
86  this->setExceptionHandler(new typename JFunction1D_t::JDefaultResult(JMATH::zero));
87  }
88  };
89 }
90 
91 #endif
JTOOLS::JGridCollection
General purpose class for collection of equidistant elements.
Definition: JGridCollection.hh:30
JElement.hh
JPHYSICS::JNPETable1D
Custom class for the integrated values of the PDF of the arrival time of Cherenkov light.
Definition: JNPETable1D.hh:37
JTOOLS::JTransformableMultiFunction
Transformable multidimensional function.
Definition: JTransformableMultiFunction.hh:38
JPHYSICS
Auxiliary classes and methods for calculation of PDF and muon energy loss.
Definition: JAbstractMedium.hh:9
JPHYSICS::JNPETable1D::JNPETable1D
JNPETable1D()
Default constructor.
Definition: JNPETable1D.hh:49
JTransformableMultiFunction.hh
JPHYSICS::JNPETable
Custom class for integrated values of the PDF of the arrival time of Cherenkov light.
Definition: JNPETable.hh:38
JPP
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition: JAAnetToolkit.hh:37
JTOOLS::JSplineFunction1D
Template class for spline interpolation in 1D.
Definition: JSpline.hh:657
JPHYSICS::JNPETable1D::JNPETable1D
JNPETable1D(const JTransformableMultiFunction< JPDF_t, JPDFMaplist_t, JPDFDistance_t > &input)
Constructor.
Definition: JNPETable1D.hh:59
JNPETable.hh
JPHYSICS::JNPETable1D::argument_type
JFunction1D_t::argument_type argument_type
Definition: JNPETable1D.hh:42
JGridCollection.hh
JTOOLS::PI
static const double PI
Constants.
Definition: JConstants.hh:20
JGEOMETRY3D
Auxiliary classes and methods for 3D geometrical objects and operations.
Definition: JAngle3D.hh:18
JPHYSICS::JNPETable1D::result_type
JFunction1D_t::result_type result_type
Definition: JNPETable1D.hh:43
JSpline.hh
JTOOLS::JSplineElement2D
2D Element for spline interpolations.
Definition: JElement.hh:151
JMATH::zero
static const JZero zero
Function object to assign zero value.
Definition: JZero.hh:94
JTOOLS
Auxiliary classes and methods for multi-dimensional interpolations and histograms.
Definition: JAbstractCollection.hh:9
JGEOMETRY3D::JOmega3D
Direction set covering (part of) solid angle.
Definition: JOmega3D.hh:64
JOmega3D.hh
argument_type
const typedef JMultiKey< N, const JKey_t > & argument_type
Definition: JMultiKey.hh:38