Jpp  16.0.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Private Attributes | List of all members
JOSCPROB::JOscProbInterpolator2D< JDistance_t > Struct Template Reference

Auxiliary class for interpolating an oscillation probability table in 2 dimensions
(in terms of the energy and cosine zenith angle). More...

#include <JOscProbInterpolator2D.hh>

Public Types

typedef JOscProbTable2D
< JDistance_t > 
table_type
 
typedef table_type::data_type data_type
 

Public Member Functions

 JOscProbInterpolator2D ()
 Default constructor. More...
 
 JOscProbInterpolator2D (const table_type *pTable)
 Constructor. More...
 
double operator() (const JOscChannel &channel, const double log10E, const double costh) const
 Get oscillation probability for given oscillation channel. More...
 

Private Attributes

const table_typepTable
 Pointer to 2D oscillation probability table. More...
 

Detailed Description

template<class JDistance_t = JTOOLS::JDistance<typename JOscProbTable2D_t::JFunction2D_t::argument_type>>
struct JOSCPROB::JOscProbInterpolator2D< JDistance_t >

Auxiliary class for interpolating an oscillation probability table in 2 dimensions
(in terms of the energy and cosine zenith angle).

Definition at line 37 of file JOscProbInterpolator2D.hh.

Member Typedef Documentation

template<class JDistance_t = JTOOLS::JDistance<typename JOscProbTable2D_t::JFunction2D_t::argument_type>>
typedef JOscProbTable2D<JDistance_t> JOSCPROB::JOscProbInterpolator2D< JDistance_t >::table_type

Definition at line 39 of file JOscProbInterpolator2D.hh.

template<class JDistance_t = JTOOLS::JDistance<typename JOscProbTable2D_t::JFunction2D_t::argument_type>>
typedef table_type::data_type JOSCPROB::JOscProbInterpolator2D< JDistance_t >::data_type

Definition at line 40 of file JOscProbInterpolator2D.hh.

Constructor & Destructor Documentation

template<class JDistance_t = JTOOLS::JDistance<typename JOscProbTable2D_t::JFunction2D_t::argument_type>>
JOSCPROB::JOscProbInterpolator2D< JDistance_t >::JOscProbInterpolator2D ( )
inline

Default constructor.

Definition at line 46 of file JOscProbInterpolator2D.hh.

46  :
47  pTable()
48  {}
const table_type * pTable
Pointer to 2D oscillation probability table.
template<class JDistance_t = JTOOLS::JDistance<typename JOscProbTable2D_t::JFunction2D_t::argument_type>>
JOSCPROB::JOscProbInterpolator2D< JDistance_t >::JOscProbInterpolator2D ( const table_type pTable)
inline

Constructor.

Parameters
pTablepointer to 2D oscillation probability table

Definition at line 56 of file JOscProbInterpolator2D.hh.

56  :
57  pTable(pTable)
58  {}
const table_type * pTable
Pointer to 2D oscillation probability table.

Member Function Documentation

template<class JDistance_t = JTOOLS::JDistance<typename JOscProbTable2D_t::JFunction2D_t::argument_type>>
double JOSCPROB::JOscProbInterpolator2D< JDistance_t >::operator() ( const JOscChannel channel,
const double  log10E,
const double  costh 
) const
inline

Get oscillation probability for given oscillation channel.

Parameters
channeloscillation channel
log10Elogarithmic neutrino energy
costhcosine zenith angle
Returns
oscillation probability

Definition at line 69 of file JOscProbInterpolator2D.hh.

72  {
73  using namespace std;
74  using namespace JPP;
75 
76  const JOscChannel* p = find(getOscChannel, getOscChannel + NUMBER_OF_OSCCHANNELS, channel);
77 
78  if (pTable != NULL) {
79 
80  if (p != end(getOscChannel)) {
81 
82  const size_t index = distance(getOscChannel, p);
83  const data_type& probabilities = (*pTable)(log10E, costh);
84 
85  return probabilities[index];
86 
87  } else {
88 
89  THROW(JValueOutOfRange, "JOscProbInterpolator2D::operator(): Invalid oscillation channel " << channel << endl);
90  }
91 
92  } else {
93 
94  THROW(JNullPointerException, "JOscProbInterpolator2D::operator(): Unspecified oscillation probability table." << endl);
95  }
96  }
Neutrino oscillation channel.
Definition: JOscChannel.hh:29
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:696
static const JOscChannel getOscChannel[]
Declare group of neutrino oscillation channels.
Definition: JOscChannel.hh:340
const table_type * pTable
Pointer to 2D oscillation probability table.
static const int NUMBER_OF_OSCCHANNELS
Number of neutrino oscillation channels.
Definition: JOscChannel.hh:365

Member Data Documentation

template<class JDistance_t = JTOOLS::JDistance<typename JOscProbTable2D_t::JFunction2D_t::argument_type>>
const table_type* JOSCPROB::JOscProbInterpolator2D< JDistance_t >::pTable
private

Pointer to 2D oscillation probability table.

Definition at line 101 of file JOscProbInterpolator2D.hh.


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