Jpp  17.2.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JOscParameters.hh
Go to the documentation of this file.
1 #ifndef __JOSCPROB__JOSCPARAMETERS__
2 #define __JOSCPROB__JOSCPARAMETERS__
3 
4 #include "JLang/JException.hh"
5 
7 
8 
9 /**
10  * \author bjung, mdejong
11  */
12 
13 namespace JOSCPROB {}
14 namespace JPP { using namespace JOSCPROB; }
15 
16 namespace JOSCPROB {
17 
19 
20  using JIO::JReader;
21  using JIO::JWriter;
22 
23 
24  /**
25  * Data structure for single set of oscillation parameters.
26  */
27  struct JOscParameters :
28  public JOscParametersInterface<double>
29  {
33 
34 
35  /**
36  * Default constructor.
37  */
40  {}
41 
42 
43  /**
44  * Constructor.
45  *
46  * \param dM21sq Squared mass difference between the first and second neutrino mass eigenstates [eV2]
47  * \param dM31sq Squared mass difference between the first and third neutrino mass eigenstates [eV2]
48  * \param deltaCP PMNS phase angle [pi rad]
49  * \param sinsqTh12 Squared sine of the PMNS mixing angle between the first and second neutrino mass eigenstates [-]
50  * \param sinsqTh13 Squared sine of the PMNS mixing angle between the first and third neutrino mass eigenstates [-]
51  * \param sinsqTh23 Squared sine of the PMNS mixing angle between the second and third neutrino mass eigenstates [-]
52  */
53  JOscParameters(const double dM21sq,
54  const double dM31sq,
55  const double deltaCP,
56  const double sinsqTh12,
57  const double sinsqTh13,
58  const double sinsqTh23) :
59  JOscParameters_t(dM21sq,
60  dM31sq,
61  deltaCP,
62  sinsqTh12,
63  sinsqTh13,
64  sinsqTh23)
65  {
66  if (!is_valid()) {
67  THROW(JLANG::JValueOutOfRange, "JOscParameters::JOscParameters(...): Invalid parameters " << *this);
68  }
69  }
70 
71 
72  /**
73  * Constructor.
74  *
75  * \param name parameter name
76  * \param value parameter value
77  * \param args remaining pairs of parameter names and values
78  */
79  template<class ...Args>
80  JOscParameters(const std::string& name,
81  const double value,
82  const Args& ...args) :
83  JOscParameters_t(name, value, args...)
84  {
85  if (!is_valid()) {
86  THROW(JLANG::JValueOutOfRange, "JOscParameters::JOscParameters(...): Invalid parameters " << *this);
87  }
88  }
89 
90 
91  /**
92  * Constructor.
93  *
94  * Values taken from the NuFIT 5.1 three-flavour global analysis best fit values in:\n
95  * https://arxiv.org/abs/2111.03086?context=hep-ex\n
96  * including the Super-Kamiokande atmospheric data.
97  *
98  * \param useIO toggle inverted ordering
99  */
100  JOscParameters(const bool useIO) :
101  JOscParameters_t( 7.42e-5,
102  useIO ? -2.490e-3 + 7.42e-5 : 2.510e-3,
103  useIO ? 1.544 : 1.278,
104  0.304,
105  useIO ? 0.02241 : 0.02246,
106  useIO ? 0.570 : 0.450 )
107  {}
108 
109 
110  /**
111  * Check validity of oscillation parameters.
112  *
113  * \return true if valid; else false
114  */
115  bool is_valid() const override
116  {
117  if ((this->sinsqTh12.isDefined() && this->sinsqTh12.getValue() < 0.0) ||
118  (this->sinsqTh13.isDefined() && this->sinsqTh13.getValue() < 0.0) ||
119  (this->sinsqTh23.isDefined() && this->sinsqTh23.getValue() < 0.0)) {
120  return false;
121  }
122 
123  return true;
124  }
125  };
126 }
127 
128 #endif
JOscParametersInterface< double > JOscParameters_t
Exceptions.
Interface for binary output.
Parameter class.
Definition: JParameter.hh:34
JParameter_t sinsqTh12
Squared sine of the PMNS mixing angle between the first and second neutrino mass eigenstates [-]...
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:696
then echo Enter input within $TIMEOUT_S seconds echo n User name
Definition: JCookie.sh:42
JParameter_t dM21sq
Squared mass difference between the first and second neutrino mass eigenstates [eV2].
Data structure for single set of oscillation parameters.
Simple data structure to support I/O of equations (see class JLANG::JEquation).
JParameter_t sinsqTh13
Squared sine of the PMNS mixing angle between the first and third neutrino mass eigenstates [-]...
JOscParameters(const double dM21sq, const double dM31sq, const double deltaCP, const double sinsqTh12, const double sinsqTh13, const double sinsqTh23)
Constructor.
const bool isDefined() const
Get status of parameter.
Definition: JParameter.hh:136
JOscParameters()
Default constructor.
JOscParameters_t::argument_type argument_type
JParameter_t dM31sq
Squared mass difference between the first and third neutrino mass eigenstates [eV2].
Interface for binary input.
JOscParameters(const bool useIO)
Constructor.
JOscParameters(const std::string &name, const double value, const Args &...args)
Constructor.
JParameter_t sinsqTh23
Squared sine of the PMNS mixing angle between the second and third neutrino mass eigenstates [-]...
Abstract base class for sets of oscillation parameters.
const T & getValue() const
Get value of parameter.
Definition: JParameter.hh:80
bool is_valid() const override
Check validity of oscillation parameters.
Exception for accessing a value in a collection that is outside of its range.
Definition: JException.hh:162
JParameter_t deltaCP
PMNS phase angle [pi * rad].
JOscParameters_t::JParameter_t JParameter_t