Jpp  debug
the software that should make you happy
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Attributes | List of all members
JPHYSICS::JCDFTable1D< JArgument_t, JResult_t > Class Template Referenceabstract

Custom class for CDF table in 1 dimension. More...

#include <JCDFTable1D.hh>

Inheritance diagram for JPHYSICS::JCDFTable1D< JArgument_t, JResult_t >:
JTOOLS::JPolintFunction1D< N, JElement_t, JCollection_t, JResult_t, JDistance_t > JTOOLS::JPolintFunction< N, JElement_t, JCollection_t, typename JElement_t::ordinate_type, JDistance< typename JElement_t::abscissa_type > > JTOOLS::JFunction1D< JElement_t::abscissa_type, typename JElement_t::ordinate_type > JTOOLS::JFunctional< JArgument_t, JResult_t >

Public Types

typedef JArgument_t argument_type
 
typedef JResult_t result_type
 
typedef JElement2D< argument_type, result_typeJElement2D_t
 
typedef JPolintFunction1D< 1, JElement2D_t, JGridCollectionJFunction1D_t
 
typedef JMultiMapTransformer< 1, argument_typetransformer_type
 
typedef JCollection_t< JElement_t, JDistance_t > collection_type
 
typedef collection_type::abscissa_type abscissa_type
 
typedef collection_type::ordinate_type ordinate_type
 
typedef collection_type::value_type value_type
 
typedef collection_type::distance_type distance_type
 
typedef collection_type::const_iterator const_iterator
 
typedef collection_type::const_reverse_iterator const_reverse_iterator
 
typedef collection_type::iterator iterator
 
typedef collection_type::reverse_iterator reverse_iterator
 
typedef JFunction1D< abscissa_type, JResult_t > function_type
 
typedef function_type::JExceptionHandler exceptionhandler_type
 
enum  
 
typedef JFunctional< JElement_t::abscissa_type, typename JElement_t::ordinate_type > functional_type
 
typedef JSupervisor supervisor_type
 

Public Member Functions

 JCDFTable1D ()
 Default constructor. More...
 
template<class JCDF_t , class JCDFMaplist_t , class JCDFDistance_t >
 JCDFTable1D (const JCDFTable< JCDF_t, JCDFMaplist_t, JCDFDistance_t > &cdf, const int number_of_bins, const double safety_factor=2.0)
 Constructor. More...
 
double getNPE (const double R) const
 Get number of photo-electrons. More...
 
result_type operator() (const argument_type x) const
 Function value evaluation. More...
 
virtual result_type evaluate (const argument_type *pX) const =0
 Recursive function value evaluation. More...
 
JSupervisor getSupervisor () const
 Get supervisor. More...
 
const JExceptionHandlergetExceptionHandler () const
 Get exception handler. More...
 
void setExceptionHandler (const JSupervisor &supervisor)
 Set the supervisor for handling of exceptions. More...
 

Static Public Member Functions

static result_type getValue (const JFunctional &function, const argument_type *pX)
 Recursive function value evaluation. More...
 
static JClass< result_type >::argument_type getValue (typename JClass< result_type >::argument_type value, const argument_type *pX)
 Termination of recursive function value evaluation. More...
 

Public Attributes

JLANG::JSharedPointer< transformer_typetransformer
 

Protected Attributes

JSupervisor supervisor
 

Detailed Description

template<class JArgument_t, class JResult_t>
class JPHYSICS::JCDFTable1D< JArgument_t, JResult_t >

Custom class for CDF table in 1 dimension.

This class provides an upper limit for the avegare number of photo-electrons as a function of the distance.

Definition at line 39 of file JCDFTable1D.hh.

Member Typedef Documentation

◆ argument_type

template<class JArgument_t , class JResult_t >
typedef JArgument_t JPHYSICS::JCDFTable1D< JArgument_t, JResult_t >::argument_type

Definition at line 44 of file JCDFTable1D.hh.

◆ result_type

template<class JArgument_t , class JResult_t >
typedef JResult_t JPHYSICS::JCDFTable1D< JArgument_t, JResult_t >::result_type

Definition at line 45 of file JCDFTable1D.hh.

◆ JElement2D_t

template<class JArgument_t , class JResult_t >
typedef JElement2D<argument_type, result_type> JPHYSICS::JCDFTable1D< JArgument_t, JResult_t >::JElement2D_t

Definition at line 47 of file JCDFTable1D.hh.

◆ JFunction1D_t

template<class JArgument_t , class JResult_t >
typedef JPolintFunction1D<1, JElement2D_t, JGridCollection> JPHYSICS::JCDFTable1D< JArgument_t, JResult_t >::JFunction1D_t

Definition at line 48 of file JCDFTable1D.hh.

◆ transformer_type

template<class JArgument_t , class JResult_t >
typedef JMultiMapTransformer<1, argument_type> JPHYSICS::JCDFTable1D< JArgument_t, JResult_t >::transformer_type

Definition at line 50 of file JCDFTable1D.hh.

◆ collection_type

template<unsigned int N, class JElement_t , template< class, class > class JCollection_t, class JResult_t = typename JElement_t::ordinate_type, class JDistance_t = JDistance<typename JElement_t::abscissa_type>>
typedef JCollection_t<JElement_t, JDistance_t> JTOOLS::JPolintFunction1D< N, JElement_t, JCollection_t, JResult_t, JDistance_t >::collection_type
inherited

Definition at line 1098 of file JPolint.hh.

◆ abscissa_type

template<unsigned int N, class JElement_t , template< class, class > class JCollection_t, class JResult_t = typename JElement_t::ordinate_type, class JDistance_t = JDistance<typename JElement_t::abscissa_type>>
typedef collection_type::abscissa_type JTOOLS::JPolintFunction1D< N, JElement_t, JCollection_t, JResult_t, JDistance_t >::abscissa_type
inherited

Definition at line 1100 of file JPolint.hh.

◆ ordinate_type

template<unsigned int N, class JElement_t , template< class, class > class JCollection_t, class JResult_t = typename JElement_t::ordinate_type, class JDistance_t = JDistance<typename JElement_t::abscissa_type>>
typedef collection_type::ordinate_type JTOOLS::JPolintFunction1D< N, JElement_t, JCollection_t, JResult_t, JDistance_t >::ordinate_type
inherited

Definition at line 1101 of file JPolint.hh.

◆ value_type

template<unsigned int N, class JElement_t , template< class, class > class JCollection_t, class JResult_t = typename JElement_t::ordinate_type, class JDistance_t = JDistance<typename JElement_t::abscissa_type>>
typedef collection_type::value_type JTOOLS::JPolintFunction1D< N, JElement_t, JCollection_t, JResult_t, JDistance_t >::value_type
inherited

Definition at line 1102 of file JPolint.hh.

◆ distance_type

template<unsigned int N, class JElement_t , template< class, class > class JCollection_t, class JResult_t = typename JElement_t::ordinate_type, class JDistance_t = JDistance<typename JElement_t::abscissa_type>>
typedef collection_type::distance_type JTOOLS::JPolintFunction1D< N, JElement_t, JCollection_t, JResult_t, JDistance_t >::distance_type
inherited

Definition at line 1103 of file JPolint.hh.

◆ const_iterator

template<unsigned int N, class JElement_t , template< class, class > class JCollection_t, class JResult_t = typename JElement_t::ordinate_type, class JDistance_t = JDistance<typename JElement_t::abscissa_type>>
typedef collection_type::const_iterator JTOOLS::JPolintFunction1D< N, JElement_t, JCollection_t, JResult_t, JDistance_t >::const_iterator
inherited

Definition at line 1105 of file JPolint.hh.

◆ const_reverse_iterator

template<unsigned int N, class JElement_t , template< class, class > class JCollection_t, class JResult_t = typename JElement_t::ordinate_type, class JDistance_t = JDistance<typename JElement_t::abscissa_type>>
typedef collection_type::const_reverse_iterator JTOOLS::JPolintFunction1D< N, JElement_t, JCollection_t, JResult_t, JDistance_t >::const_reverse_iterator
inherited

Definition at line 1106 of file JPolint.hh.

◆ iterator

template<unsigned int N, class JElement_t , template< class, class > class JCollection_t, class JResult_t = typename JElement_t::ordinate_type, class JDistance_t = JDistance<typename JElement_t::abscissa_type>>
typedef collection_type::iterator JTOOLS::JPolintFunction1D< N, JElement_t, JCollection_t, JResult_t, JDistance_t >::iterator
inherited

Definition at line 1107 of file JPolint.hh.

◆ reverse_iterator

template<unsigned int N, class JElement_t , template< class, class > class JCollection_t, class JResult_t = typename JElement_t::ordinate_type, class JDistance_t = JDistance<typename JElement_t::abscissa_type>>
typedef collection_type::reverse_iterator JTOOLS::JPolintFunction1D< N, JElement_t, JCollection_t, JResult_t, JDistance_t >::reverse_iterator
inherited

Definition at line 1108 of file JPolint.hh.

◆ function_type

template<unsigned int N, class JElement_t , template< class, class > class JCollection_t, class JResult_t = typename JElement_t::ordinate_type, class JDistance_t = JDistance<typename JElement_t::abscissa_type>>
typedef JFunction1D<abscissa_type, JResult_t> JTOOLS::JPolintFunction1D< N, JElement_t, JCollection_t, JResult_t, JDistance_t >::function_type
inherited

Definition at line 1110 of file JPolint.hh.

◆ exceptionhandler_type

template<unsigned int N, class JElement_t , template< class, class > class JCollection_t, class JResult_t = typename JElement_t::ordinate_type, class JDistance_t = JDistance<typename JElement_t::abscissa_type>>
typedef function_type::JExceptionHandler JTOOLS::JPolintFunction1D< N, JElement_t, JCollection_t, JResult_t, JDistance_t >::exceptionhandler_type
inherited

Definition at line 1114 of file JPolint.hh.

◆ functional_type

typedef JFunctional<JElement_t::abscissa_type , typename JElement_t::ordinate_type > JTOOLS::JFunction1D< JElement_t::abscissa_type , typename JElement_t::ordinate_type >::functional_type
inherited

Definition at line 337 of file JFunctional.hh.

◆ supervisor_type

template<class JArgument_t , class JResult_t >
typedef JSupervisor JTOOLS::JFunctional< JArgument_t, JResult_t >::supervisor_type
inherited

Definition at line 89 of file JFunctional.hh.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
inherited

Constructor & Destructor Documentation

◆ JCDFTable1D() [1/2]

template<class JArgument_t , class JResult_t >
JPHYSICS::JCDFTable1D< JArgument_t, JResult_t >::JCDFTable1D ( )
inline

Default constructor.

Definition at line 56 of file JCDFTable1D.hh.

57  {}

◆ JCDFTable1D() [2/2]

template<class JArgument_t , class JResult_t >
template<class JCDF_t , class JCDFMaplist_t , class JCDFDistance_t >
JPHYSICS::JCDFTable1D< JArgument_t, JResult_t >::JCDFTable1D ( const JCDFTable< JCDF_t, JCDFMaplist_t, JCDFDistance_t > &  cdf,
const int  number_of_bins,
const double  safety_factor = 2.0 
)
inline

Constructor.

Parameters
cdfCDF (4D table)
number_of_binsnumber of bins (1D table)
safety_factorsafety factor

Definition at line 68 of file JCDFTable1D.hh.

71  {
72  using namespace JPP;
73 
74  // extract the weight function
75 
76  try {
77 
79 
80  const JPDFTransformer_t& object = dynamic_cast<const JPDFTransformer_t&>(*(cdf.transformer));
81 
82  transformer.reset(object.transformer.clone());
83  }
84  catch(const std::exception& error) {
86  }
87 
88  // build the 1D table
89 
90  this->configure(make_grid(number_of_bins, cdf.intensity.begin()->getX(), cdf.intensity.rbegin()->getX()));
91 
92  const JOmega3D omega(JDirection3D(0,1,0), JOmega3D::range_type(0.0,0.501*PI), 0.07*PI);
93 
94  for (typename JFunction1D_t::iterator j = this->begin(); j != this->end(); ++j) {
95 
96  const double R = j->getX();
97  const double W = transformer->getWeight(R);
98 
99  double y = 0.0;
100 
101  for (JOmega3D::const_iterator dir = omega.begin(); dir != omega.end(); ++dir) {
102  y += cdf.getNPE(R, dir->getTheta(), fabs(dir->getPhi()));
103  }
104 
105  y /= omega.size();
106 
107  j->getY() = safety_factor * y / W;
108  }
109 
110  this->compile();
111  }
Data structure for direction in three dimensions.
Definition: JDirection3D.hh:35
Direction set covering (part of) solid angle.
Definition: JOmega3D.hh:68
JLANG::JSharedPointer< transformer_type > transformer
Definition: JCDFTable1D.hh:131
JLANG::JSharedPointer< transformer_type > transformer
Definition: JCDFTable.hh:231
JMultiQuantile_t intensity
Definition: JCDFTable.hh:229
double getNPE(const Args &...args) const
Get number of photo-electrons.
Definition: JCDFTable.hh:159
Transformer for the 1D probability density function (PDF) of the time response of a PMT to a muon.
Template definition of transformer of the probability density function (PDF) of the time response of ...
static JMultiMapTransformer * getClone()
Get clone of default transformer.
collection_type::iterator iterator
Definition: JPolint.hh:1107
static const double PI
Mathematical constants.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
void configure(const T &value, const JAbstractCollection< JAbscissa_t > &bounds, JBool< false > option)
Configuration of value.
JGrid< JAbscissa_t > make_grid(const int nx, const JAbscissa_t Xmin, const JAbscissa_t Xmax)
Helper method for JGrid.
Definition: JGrid.hh:209
int j
Definition: JPolint.hh:792
JRange< int > range_type

Member Function Documentation

◆ getNPE()

template<class JArgument_t , class JResult_t >
double JPHYSICS::JCDFTable1D< JArgument_t, JResult_t >::getNPE ( const double  R) const
inline

Get number of photo-electrons.

Parameters
Rdistance between muon and PMT [m]
Returns
number of photo-electrons

Definition at line 120 of file JCDFTable1D.hh.

121  {
122  const double buffer[] = { R };
123 
124  const double y = this->evaluate(buffer);
125  const double W = this->transformer->getWeight(R);
126 
127  return y * W;
128  }
virtual result_type evaluate(const argument_type *pX) const =0
Recursive function value evaluation.

◆ operator()()

result_type JTOOLS::JFunction1D< JElement_t::abscissa_type , typename JElement_t::ordinate_type >::operator() ( const argument_type  x) const
inlineinherited

Function value evaluation.

Parameters
xargument value
Returns
function value

Definition at line 348 of file JFunctional.hh.

349  {
350  return this->evaluate(&x);
351  }

◆ evaluate()

template<class JArgument_t , class JResult_t >
virtual result_type JTOOLS::JFunctional< JArgument_t, JResult_t >::evaluate ( const argument_type pX) const
pure virtualinherited

Recursive function value evaluation.

Parameters
pXpointer to abscissa values
Returns
function value

Implemented in JTOOLS::JSplineMap< JKey_t, JValue_t, JMap_t, JResult_t, JDistance_t >, JTOOLS::JSplineMap< JKey_t, JValue_t, JGridMap, JResultType< JValue_t >::result_type, JDistance< JKey_t > >, JTOOLS::JSplineMap< JKey_t, JValue_t, JMap, JResultDerivative< JResultType< JValue_t >::result_type >, JDistance< JKey_t > >, JTOOLS::JSplineMap< JKey_t, JValue_t, JMap, JResultType< JValue_t >::result_type, JDistance< JKey_t > >, JTOOLS::JSplineMap< JKey_t, JValue_t, JGridMap, JResultDerivative< JResultType< JValue_t >::result_type >, JDistance< JKey_t > >, JTOOLS::JSplineFunction< JElement_t, JCollection_t, JResultPDF< typename JResultType< typename JElement_t::ordinate_type >::result_type >, JDistance_t >, JTOOLS::JSplineFunction< JElement_t, JCollection_t, JResultDerivative< typename JResultType< typename JElement_t::ordinate_type >::result_type >, JDistance_t >, JTOOLS::JSplineFunction< JElement_t, JCollection_t, typename JResultType< typename JElement_t::ordinate_type >::result_type, JDistance_t >, JTOOLS::JPolintFunction< N, JElement_t, JCollection_t, JResultHesse< typename JResultType< typename JElement_t::ordinate_type >::result_type >, JDistance_t >, JTOOLS::JPolintFunction< N, JElement_t, JCollection_t, JResultDerivative< typename JResultType< typename JElement_t::ordinate_type >::result_type >, JDistance_t >, JTOOLS::JPolintFunction< N, JElement_t, JCollection_t, JResultPolynome< M, typename JResultType< typename JElement_t::ordinate_type >::result_type >, JDistance_t >, JTOOLS::JPolintFunction< N, JElement_t, JCollection_t, JResultPDF< typename JResultType< typename JElement_t::ordinate_type >::result_type >, JDistance_t >, JTOOLS::JPolintFunction< 1, JElement_t, JCollection_t, typename JResultType< typename JElement_t::ordinate_type >::result_type, JDistance_t >, JTOOLS::JPolintFunction< 0, JElement_t, JCollection_t, typename JResultType< typename JElement_t::ordinate_type >::result_type, JDistance_t >, JTOOLS::JPolintFunction< N, JElement_t, JCollection_t, typename JResultType< typename JElement_t::ordinate_type >::result_type, JDistance_t >, JTOOLS::JPolfitFunction< N, M, JElement_t, JCollection_t, JResult_t, JDistance_t >, JTOOLS::JPolfitFunction< N, M, JElement_t, JCollection_t, typename JElement_t::ordinate_type, JDistance< typename JElement_t::abscissa_type > >, JTOOLS::JHermiteSplineMap< JKey_t, JValue_t, JMap_t, JResult_t, JDistance_t >, JTOOLS::JHermiteSplineFunction< JElement_t, JCollection_t, JResultPDF< typename JResultType< typename JElement_t::ordinate_type >::result_type >, JDistance_t >, JTOOLS::JHermiteSplineFunction< JElement_t, JCollection_t, JResultDerivative< typename JResultType< typename JElement_t::ordinate_type >::result_type >, JDistance_t >, JTOOLS::JHermiteSplineFunction< JElement_t, JCollection_t, typename JResultType< typename JElement_t::ordinate_type >::result_type, JDistance_t >, JTOOLS::JFunctionObject1D< JArgument_t, JResult_t >, JTOOLS::JExternalFunction1D< JArgument_t, JResult_t >, and JTOOLS::JConstantFunction1D< JArgument_t, JResult_t >.

◆ getValue() [1/2]

template<class JArgument_t , class JResult_t >
static result_type JTOOLS::JFunctional< JArgument_t, JResult_t >::getValue ( const JFunctional< JArgument_t, JResult_t > &  function,
const argument_type pX 
)
inlinestaticinherited

Recursive function value evaluation.

Parameters
functionfunction
pXpointer to abscissa values

Definition at line 107 of file JFunctional.hh.

109  {
110  return function.evaluate(pX);
111  }

◆ getValue() [2/2]

template<class JArgument_t , class JResult_t >
static JClass<result_type>::argument_type JTOOLS::JFunctional< JArgument_t, JResult_t >::getValue ( typename JClass< result_type >::argument_type  value,
const argument_type pX 
)
inlinestaticinherited

Termination of recursive function value evaluation.

Parameters
valueresult
pXpointer to abscissa values

Definition at line 121 of file JFunctional.hh.

123  {
124  return value;
125  }

◆ getSupervisor()

template<class JArgument_t , class JResult_t >
JSupervisor JTOOLS::JFunctional< JArgument_t, JResult_t >::getSupervisor ( ) const
inlineinherited

Get supervisor.

Returns
supervisor

Definition at line 281 of file JFunctional.hh.

282  {
283  return supervisor;
284  }
JSupervisor supervisor
Definition: JFunctional.hh:310

◆ getExceptionHandler()

template<class JArgument_t , class JResult_t >
const JExceptionHandler& JTOOLS::JFunctional< JArgument_t, JResult_t >::getExceptionHandler ( ) const
inlineinherited

Get exception handler.

Returns
exception handler

Definition at line 292 of file JFunctional.hh.

293  {
294  return *supervisor;
295  }

◆ setExceptionHandler()

template<class JArgument_t , class JResult_t >
void JTOOLS::JFunctional< JArgument_t, JResult_t >::setExceptionHandler ( const JSupervisor supervisor)
inlineinherited

Set the supervisor for handling of exceptions.

Parameters
supervisorsupervisor

Definition at line 303 of file JFunctional.hh.

304  {
305  this->supervisor = supervisor;
306  }

Member Data Documentation

◆ transformer

template<class JArgument_t , class JResult_t >
JLANG::JSharedPointer<transformer_type> JPHYSICS::JCDFTable1D< JArgument_t, JResult_t >::transformer

Definition at line 131 of file JCDFTable1D.hh.

◆ supervisor

template<class JArgument_t , class JResult_t >
JSupervisor JTOOLS::JFunctional< JArgument_t, JResult_t >::supervisor
protectedinherited

Definition at line 310 of file JFunctional.hh.


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