Jpp  17.0.0-rc.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JOscProbToolkit.hh
Go to the documentation of this file.
1 #ifndef __JOSCPROB__JOSCPROBTOOLKIT__
2 #define __JOSCPROB__JOSCPROBTOOLKIT__
3 
6 
7 #include "Jeep/JMessage.hh"
8 
9 #include "JLang/JException.hh"
10 
11 #include "JTools/JRange.hh"
12 
13 
14 /**
15  * \author bjung
16  * Auxiliary methods for oscillation probabilities.
17  */
18 
19 namespace JOSCPROB {}
20 namespace JPP { using namespace JOSCPROB; }
21 
22 namespace JOSCPROB {
23 
25 
26  using JTOOLS::JRange;
27 
28 
29  /**
30  * Allowed ranges of neutrino oscillation parameters.
31  */
32  static const JRange<double> SINSQTH12Range(0.250, 0.354);
33  static const JRange<double> DM21Range (6.93e-5, 7.96e-5); // [eV^2]
34  static const JRange<double> SINSQTH13Range(0.019, 0.025);
35  static const JRange<double> DM31Range (+2.45e-3, +2.69e-3); // [eV^2]
36  static const JRange<double> SINSQTH23Range(0.381, 0.636);
37  static const JRange<double> DCPRange (0.000, 2.000); // [pi]
38 
39 
40  /**
41  * Earth radii.
42  */
43  static const double R_EARTH_BELOW = 6368; //!< Earth radius, up until detector layer [km]
44  static const double R_EARTH_ABOVE = 6386; //!< Earth radius, including layer above detector [km]
45 
46 
47  /**
48  * Get baseline for a given cosine zenith angle.
49  *
50  * \param costh cosine zenith angle
51  * \return baseline [km]
52  */
53  inline double getL(const double costh)
54  {
55  using namespace std;
56  using namespace JPP;
57 
58  static const double epsilon = 1e-6;
59 
60  if (fabs(costh) < 1.0 || fabs(costh) - 1.0 < epsilon) {
61 
62  return (-R_EARTH_BELOW * costh + sqrt(R_EARTH_ABOVE*R_EARTH_ABOVE -
63  R_EARTH_BELOW*R_EARTH_BELOW * (1 - costh) * (1 + costh)));
64 
65  } else {
66 
67  THROW(JValueOutOfRange, "getL(): Invalid cosine zenith angle " << costh << endl);
68  }
69  }
70 }
71 
72 #endif
Exceptions.
static const double R_EARTH_ABOVE
Earth radius, including layer above detector [km].
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:696
static const JRange< double > SINSQTH12Range(0.250, 0.354)
Allowed ranges of neutrino oscillation parameters.
static const JRange< double > SINSQTH13Range(0.019, 0.025)
static const JRange< double > DM21Range(6.93e-5, 7.96e-5)
double getL(const double costh)
Get baseline for a given cosine zenith angle.
Range of values.
Definition: JRange.hh:38
General purpose messaging.
static const JRange< double > DCPRange(0.000, 2.000)
Auxiliary class to define a range between two values.
static const JRange< double > DM31Range(+2.45e-3,+2.69e-3)
Exception for accessing a value in a collection that is outside of its range.
Definition: JException.hh:162
static const double R_EARTH_BELOW
Earth radii.
static const JRange< double > SINSQTH23Range(0.381, 0.636)
const double epsilon
Definition: JQuadrature.cc:21