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