Jpp  16.0.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JOscProbInterpolator8D.hh
Go to the documentation of this file.
1 #ifndef __JOSCPROB__JOSCPROBINTERPOLATOR8D__
2 #define __JOSCPROB__JOSCPROBINTERPOLATOR8D__
3 
4 #include <string>
5 
7 
8 #include "Jeep/JMessage.hh"
9 
10 #include "JLang/JException.hh"
11 
12 #include "JTools/JDistance.hh"
13 
17 #include "JOscProb/JOscChannel.hh"
19 
20 
21 namespace JOSCPROB {};
22 namespace JPP { using namespace JOSCPROB; }
23 
24 namespace JOSCPROB {
25 
28 
30 
31 
32  /**
33  * Auxiliary class for interpolating an oscillation probability table in 8 dimensions in terms of:\n
34  * 1. \f$sin^2(\theta_{12})\f$
35  * 2. \f$\Delta m_{21}^2\f$
36  * 3. \f$sin^2(\theta_{13})\f$
37  * 4. \f$\Delta m_{31}^2\f$
38  * 5. \f$sin^2(\theta_{23})\f$
39  * 6. \f$\delta_{\text{CP}}\f$
40  * 7. \f$log_{10}(E)\f$
41  * 8. \f$cos(\theta)\f$
42  */
43  template<class JDistance_t = JTOOLS::JDistance<typename JOscProbTable8D_t::JFunction2D_t::argument_type> >
45  public JOscParameters
46  {
48  typedef typename table_type::data_type data_type;
49 
50 
51  /**
52  * Default constructor.
53  */
55  pTable(),
57  {}
58 
59 
60  /**
61  * Constructor.
62  *
63  * \param pTable pointer to 8D oscillation probability table
64  * \param parameters oscillation parameters
65  */
67  const JOscParameters& parameters) :
68  pTable (pTable),
69  JOscParameters(parameters)
70  {}
71 
72 
73  /**
74  * Get oscillation probability for given oscillation channel.
75  *
76  * \param channel oscillation channel
77  * \param log10E logarithmic neutrino energy
78  * \param costh cosine zenith angle
79  * \return oscillation probability
80  */
81  virtual double operator()(const JOscChannel& channel,
82  const double log10E,
83  const double costh) const
84  {
85  using namespace std;
86  using namespace JPP;
87 
88  const JOscChannel* p = find(getOscChannel, getOscChannel + NUMBER_OF_OSCCHANNELS, channel);
89 
90  if (pTable != NULL) {
91 
92  if (p != end(getOscChannel) && is_valid()) {
93 
94  const size_t index = distance(getOscChannel, p);
95 
96  const data_type& probabilities = (*pTable)(this->sinsqTh12, this->dM21sq,
97  this->sinsqTh13, this->dM31sq,
98  this->sinsqTh23, this->deltaCP,
99  log10E, costh);
100  return probabilities[index];
101 
102  } else {
103 
104  if (is_valid()) {
105  THROW(JValueOutOfRange, "JOscProbInterpolator8D::operator(): Invalid oscillation channel " << channel << endl);
106  } else {
107  THROW(JValueOutOfRange, "JOscProbInterpolator8D::operator(): Invalid oscillation parameters " << static_cast<const JOscParameters&>(*this) << endl);
108  }
109  }
110 
111  } else {
112 
113  THROW(JNullPointerException, "JOscProbInterpolator8D::operator(): Unspecified oscillation probability table." << endl);
114  }
115  }
116 
117 
118  private:
119 
120  const table_type* pTable; //!< Pointer to 8D oscillation probability table
121  };
122 }
123 
124 
125 #endif
Exceptions.
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
Explicit template specialization for 8D interpolation table in: .
Data structure for oscillation parameters.
*fatal Wrong number of arguments esac JCookie sh typeset Z DETECTOR typeset Z SOURCE_RUN typeset Z TARGET_RUN set_variable PARAMETERS_FILE $WORKDIR parameters
Definition: diff-Tuna.sh:38
double sinsqTh23
Squared sine of the PMNS mixing angle between the second and third neutrino mass eigenstates [-]...
double deltaCP
PMNS phase angle [pi * rad].
const table_type * pTable
Pointer to 8D oscillation probability table.
double dM31sq
Squared mass difference between the first and third neutrino mass eigenstates [eV2].
double sinsqTh12
Squared sine of the PMNS mixing angle between the first and second neutrino mass eigenstates [-]...
Exception for null pointer operation.
Definition: JException.hh:216
JOscProbTable8D< JDistance_t > table_type
static const JOscChannel getOscChannel[]
Declare group of neutrino oscillation channels.
Definition: JOscChannel.hh:340
virtual double operator()(const JOscChannel &channel, const double log10E, const double costh) const
Get oscillation probability for given oscillation channel.
double dM21sq
Squared mass difference between the first and second neutrino mass eigenstates [eV2].
General purpose messaging.
JOscProbInterpolator8D(const table_type *pTable, const JOscParameters &parameters)
Constructor.
bool is_valid() const
Check validity of oscillation parameters.
JOscProbInterpolator8D()
Default constructor.
Exception for accessing a value in a collection that is outside of its range.
Definition: JException.hh:162
Auxiliary class for interpolating an oscillation probability table in 8 dimensions in terms of: ...
static const int NUMBER_OF_OSCCHANNELS
Number of neutrino oscillation channels.
Definition: JOscChannel.hh:365
double sinsqTh13
Squared sine of the PMNS mixing angle between the first and third neutrino mass eigenstates [-]...