Jpp  17.1.0
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 
29 
30  /**
31  * Auxiliary class for interpolating an oscillation probability table in 8 dimensions in terms of:
32  *
33  * 1. \f$ \sin^{2}(\theta_{12}) \f$
34  * 2. \f$ \Delta m_{21}^{2} \left[\mathrm{eV}^{2}\right] \f$
35  * 3. \f$ \sin^{2}(\theta_{13}) \f$
36  * 4. \f$ \Delta m_{31}^{2} \left[\mathrm{eV}^{2}\right] \f$
37  * 5. \f$ \sin^{2}(\theta_{23}) \f$
38  * 6. \f$ \delta_{\mathrm{CP}} \left[\pi\right] \f$
39  * 7. \f$ E \left[\mathrm{GeV}\right] \f$
40  * 8. \f$ \sin(\theta)\f$
41  */
42  template<class JDistance_t = JTOOLS::JDistance<typename JOscProbTable8D_t::JFunction2D_t::argument_type> >
44  public JOscParameters
45  {
47  typedef typename table_type::data_type data_type;
48 
49 
50  /**
51  * Default constructor.
52  */
54  pTable(),
56  {}
57 
58 
59  /**
60  * Constructor.
61  *
62  * \param pTable pointer to 8D oscillation probability table
63  * \param parameters oscillation parameters
64  */
66  const JOscParameters& parameters) :
67  pTable (pTable),
68  JOscParameters(parameters)
69  {}
70 
71 
72  /**
73  * Get oscillation probability for given oscillation channel.
74  *
75  * \param channel oscillation channel
76  * \param E neutrino energy [GeV]
77  * \param costh cosine zenith angle
78  * \return oscillation probability
79  */
80  virtual double operator()(const JOscChannel& channel,
81  const double E,
82  const double costh) const
83  {
84  using namespace std;
85  using namespace JPP;
86 
87  if (pTable != NULL && is_valid()) {
88 
89  const JOscChannel* p = find(getOscChannel, getOscChannel + NUMBER_OF_OSCCHANNELS, channel);
90 
91  if (p != end(getOscChannel)) {
92 
93  const double L = getL(costh);
94  const double sinth = (fabs(costh) < 1.0 ? sqrt((1 - costh) * (1 + costh)) : 0.0);
95 
96  const size_t index = distance(getOscChannel, p);
97 
98  const data_type& probabilities = (*pTable)(this->sinsqTh12, this->dM21sq,
99  this->sinsqTh13, this->dM31sq,
100  this->sinsqTh23, this->deltaCP,
101  L/E, sinth);
102  return probabilities[index];
103 
104  } else {
105 
106  THROW(JValueOutOfRange, "JOscProbInterpolator8D::operator(): Invalid oscillation channel " << channel << endl);
107  }
108 
109  } else {
110 
111  if (is_valid()) {
112  THROW(JNullPointerException, "JOscProbInterpolator8D::operator(): Unspecified oscillation probability table." << endl);
113  } else {
114  THROW(JValueOutOfRange, "JOscProbInterpolator8D::operator(): Invalid oscillation parameters " << static_cast<const JOscParameters&>(*this) << endl);
115  }
116  }
117  }
118 
119 
120  private:
121 
122  const table_type* pTable; //!< Pointer to 8D oscillation probability table
123  };
124 }
125 
126 
127 #endif
Exceptions.
then usage E
Definition: JMuonPostfit.sh:35
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
double dM21sq
Squared mass difference between the first and second neutrino mass eigenstates [eV2].
double getL(const double costh)
Get baseline for a given cosine zenith angle.
virtual double operator()(const JOscChannel &channel, const double E, const double costh) const
Get oscillation probability for given oscillation channel.
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 [-]...