Jpp  17.1.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Friends | List of all members
JOSCPROB::JOscParametersInterface< T > Struct Template Referenceabstract

Abstract base class for sets of oscillation parameters. More...

#include <JOscParametersInterface.hh>

Inheritance diagram for JOSCPROB::JOscParametersInterface< T >:
JIO::JSerialisable

Classes

struct  JOscParametersHelper
 Auxiliary class for I/O of oscillation parameters. More...
 

Public Types

typedef
JOscParametersInterface< T
JOscParameters_t
 
typedef JParameter< TJParameter_t
 
typedef JParameter_t::argument_type argument_type
 

Public Member Functions

 JOscParametersInterface ()
 Default constructor. More...
 
 JOscParametersInterface (const T &dM21sq, const T &dM31sq, const T &deltaCP, const T &sinsqTh12, const T &sinsqTh13, const T &sinsqTh23)
 Constructor. More...
 
template<class... Args>
 JOscParametersInterface (const std::string &name, const T &value, const Args &...args)
 Constructor. More...
 
void set (const std::string &name, const T &value)
 Set value for a given oscillation parameter. More...
 
template<class... Args>
void set (const std::string &name, const T &value, const Args &...args)
 Set value for given list of oscillation parameters. More...
 
JOscParameters_tjoin (const JOscParameters_t &parameters)
 Join the given oscillation parameters with these oscillation parameters. More...
 
const JOscParameters_tgetOscParameters () const
 Get oscillation parameters. More...
 
void setOscParameters (const JOscParameters_t &parameters)
 Set oscillation parameters. More...
 
virtual bool is_valid () const =0
 Check validity of oscillation parameters. More...
 
virtual unsigned int size () const
 Get size of this oscillation parameters set. More...
 
virtual bool contains (const JOscParameters_t &parameters) const
 Check if this oscillations parameter set contains the given oscillation parameters. More...
 
JReaderread (JReader &in) override
 Binary stream input of oscillation parameters. More...
 
JWriterwrite (JWriter &out) const override
 Binary stream output of oscillation parameters. More...
 
JProperties getProperties (const JEquationParameters &equation=JOscParameters_t::getEquationParameters())
 Get properties of this class. More...
 
JProperties getProperties (const JEquationParameters &equation=JOscParameters_t::getEquationParameters()) const
 Get properties of this class. More...
 
void setProperties (const JProperties &properties)
 Set properties of this class. More...
 

Static Public Member Functions

static JEquationParametersgetEquationParameters ()
 Get equation parameters. More...
 
static void setEquationParameters (const JEquationParameters &equation)
 Set equation parameters. More...
 

Public Attributes

JParameter_t dM21sq
 Squared mass difference between the first and second neutrino mass eigenstates [eV2]. More...
 
JParameter_t dM31sq
 Squared mass difference between the first and third neutrino mass eigenstates [eV2]. More...
 
JParameter_t deltaCP
 PMNS phase angle [pi * rad]. More...
 
JParameter_t sinsqTh12
 Squared sine of the PMNS mixing angle between the first and second neutrino mass eigenstates [-]. More...
 
JParameter_t sinsqTh13
 Squared sine of the PMNS mixing angle between the first and third neutrino mass eigenstates [-]. More...
 
JParameter_t sinsqTh23
 Squared sine of the PMNS mixing angle between the second and third neutrino mass eigenstates [-]. More...
 

Friends

std::istream & operator>> (std::istream &in, JOscParameters_t &parameters)
 Stream input of oscillation parameters. More...
 
std::ostream & operator<< (std::ostream &out, const JOscParameters_t &parameters)
 Stream output of oscillation parameters. More...
 

Detailed Description

template<class T>
struct JOSCPROB::JOscParametersInterface< T >

Abstract base class for sets of oscillation parameters.

Definition at line 40 of file JOscParametersInterface.hh.

Member Typedef Documentation

Definition at line 43 of file JOscParametersInterface.hh.

Definition at line 44 of file JOscParametersInterface.hh.

Definition at line 45 of file JOscParametersInterface.hh.

Constructor & Destructor Documentation

Default constructor.

Definition at line 51 of file JOscParametersInterface.hh.

51  :
52  dM21sq (),
53  dM31sq (),
54  deltaCP (),
55  sinsqTh12(),
56  sinsqTh13(),
57  sinsqTh23()
58  {}
JParameter_t sinsqTh12
Squared sine of the PMNS mixing angle between the first and second neutrino mass eigenstates [-]...
JParameter_t dM21sq
Squared mass difference between the first and second neutrino mass eigenstates [eV2].
JParameter_t sinsqTh13
Squared sine of the PMNS mixing angle between the first and third neutrino mass eigenstates [-]...
JParameter_t dM31sq
Squared mass difference between the first and third neutrino mass eigenstates [eV2].
JParameter_t sinsqTh23
Squared sine of the PMNS mixing angle between the second and third neutrino mass eigenstates [-]...
JParameter_t deltaCP
PMNS phase angle [pi * rad].
template<class T>
JOSCPROB::JOscParametersInterface< T >::JOscParametersInterface ( const T dM21sq,
const T dM31sq,
const T deltaCP,
const T sinsqTh12,
const T sinsqTh13,
const T sinsqTh23 
)
inline

Constructor.

Parameters
dM21sqSquared mass difference between the first and second neutrino mass eigenstates [eV2]
dM31sqSquared mass difference between the first and third neutrino mass eigenstates [eV2]
deltaCPPMNS phase angle [pi rad]
sinsqTh12Squared sine of the PMNS mixing angle between the first and second neutrino mass eigenstates [-]
sinsqTh13Squared sine of the PMNS mixing angle between the first and third neutrino mass eigenstates [-]
sinsqTh23Squared sine of the PMNS mixing angle between the second and third neutrino mass eigenstates [-]

Definition at line 71 of file JOscParametersInterface.hh.

76  :
77  dM21sq (dM21sq),
78  dM31sq (dM31sq),
79  deltaCP (deltaCP),
83  {}
JParameter_t sinsqTh12
Squared sine of the PMNS mixing angle between the first and second neutrino mass eigenstates [-]...
JParameter_t dM21sq
Squared mass difference between the first and second neutrino mass eigenstates [eV2].
JParameter_t sinsqTh13
Squared sine of the PMNS mixing angle between the first and third neutrino mass eigenstates [-]...
JParameter_t dM31sq
Squared mass difference between the first and third neutrino mass eigenstates [eV2].
JParameter_t sinsqTh23
Squared sine of the PMNS mixing angle between the second and third neutrino mass eigenstates [-]...
JParameter_t deltaCP
PMNS phase angle [pi * rad].
template<class T>
template<class... Args>
JOSCPROB::JOscParametersInterface< T >::JOscParametersInterface ( const std::string &  name,
const T value,
const Args &...  args 
)
inline

Constructor.

Parameters
nameparameter name
valueparameter value
argsremaining pairs of parameter names and values

Definition at line 94 of file JOscParametersInterface.hh.

97  {
98  set(name, value, args...);
99  }
then echo Enter input within $TIMEOUT_S seconds echo n User name
Definition: JCookie.sh:42
void set(const std::string &name, const T &value)
Set value for a given oscillation parameter.

Member Function Documentation

template<class T>
void JOSCPROB::JOscParametersInterface< T >::set ( const std::string &  name,
const T value 
)
inline

Set value for a given oscillation parameter.

Parameters
nameparameter name
valueparameter value

Definition at line 108 of file JOscParametersInterface.hh.

110  {
111  JProperties properties = this->getProperties();
112 
113  JProperties::iterator i = properties.find(name);
114 
115  if (i != properties.end()) {
116 
117  i->second.setValue(JParameter_t(value));
118 
119  } else {
120 
121  THROW(JValueOutOfRange,
122  "template<class T> JOscParametersInterface<T>::set(const std::string&, const T&): " <<
123  "Invalid oscillation parameter name " << name << "; Valid options:\n" << JLANG::get_keys(properties));
124  }
125  }
#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
Utility class to parse parameter values.
Definition: JProperties.hh:496
JProperties getProperties(const JEquationParameters &equation=JOscParameters_t::getEquationParameters())
Get properties of this class.
void setValue(const std::string &key, const T &value)
Set value.
const array_type< JKey_t > & get_keys(const std::map< JKey_t, JValue_t, JComparator_t, JAllocator_t > &data)
Method to create array of keys of map.
Definition: JVectorize.hh:139
template<class T>
template<class... Args>
void JOSCPROB::JOscParametersInterface< T >::set ( const std::string &  name,
const T value,
const Args &...  args 
)
inline

Set value for given list of oscillation parameters.

Parameters
nameparameter name
valueparameter value
argsremaining pairs of parameter names and values

Definition at line 136 of file JOscParametersInterface.hh.

139  {
140  set(name, value);
141  set(args...);
142  }
then echo Enter input within $TIMEOUT_S seconds echo n User name
Definition: JCookie.sh:42
void set(const std::string &name, const T &value)
Set value for a given oscillation parameter.
template<class T>
JOscParameters_t& JOSCPROB::JOscParametersInterface< T >::join ( const JOscParameters_t parameters)
inline

Join the given oscillation parameters with these oscillation parameters.

Parameters
parametersoscillation parameters

Definition at line 150 of file JOscParametersInterface.hh.

151  {
152  if (parameters.dM21sq.isDefined()) { this->dM21sq = parameters.dM21sq; }
153  if (parameters.dM31sq.isDefined()) { this->dM31sq = parameters.dM31sq; }
154  if (parameters.deltaCP.isDefined()) { this->deltaCP = parameters.deltaCP; }
155  if (parameters.sinsqTh12.isDefined()) { this->sinsqTh12 = parameters.sinsqTh12; }
156  if (parameters.sinsqTh13.isDefined()) { this->sinsqTh13 = parameters.sinsqTh13; }
157  if (parameters.sinsqTh23.isDefined()) { this->sinsqTh23 = parameters.sinsqTh23; }
158 
159  return *this;
160  }
JParameter_t sinsqTh12
Squared sine of the PMNS mixing angle between the first and second neutrino mass eigenstates [-]...
JParameter_t dM21sq
Squared mass difference between the first and second neutrino mass eigenstates [eV2].
*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
JParameter_t sinsqTh13
Squared sine of the PMNS mixing angle between the first and third neutrino mass eigenstates [-]...
JParameter_t dM31sq
Squared mass difference between the first and third neutrino mass eigenstates [eV2].
JParameter_t sinsqTh23
Squared sine of the PMNS mixing angle between the second and third neutrino mass eigenstates [-]...
JParameter_t deltaCP
PMNS phase angle [pi * rad].
template<class T>
const JOscParameters_t& JOSCPROB::JOscParametersInterface< T >::getOscParameters ( ) const
inline

Get oscillation parameters.

Returns
oscillation parameters

Definition at line 168 of file JOscParametersInterface.hh.

169  {
170  return static_cast<const JOscParameters_t&>(*this);
171  }
JOscParametersInterface< T > JOscParameters_t
template<class T>
void JOSCPROB::JOscParametersInterface< T >::setOscParameters ( const JOscParameters_t parameters)
inline

Set oscillation parameters.

Parameters
parametersoscillation parameters

Definition at line 179 of file JOscParametersInterface.hh.

180  {
181  static_cast<JOscParameters_t&>(*this) = parameters;
182  }
*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
JOscParametersInterface< T > JOscParameters_t
template<class T>
virtual bool JOSCPROB::JOscParametersInterface< T >::is_valid ( ) const
pure virtual

Check validity of oscillation parameters.

Returns
true if valid; else false

Implemented in JOSCPROB::JOscParametersGrid, and JOSCPROB::JOscParameters.

template<class T>
virtual unsigned int JOSCPROB::JOscParametersInterface< T >::size ( ) const
inlinevirtual

Get size of this oscillation parameters set.

Returns
size (= number of defined parameters)

Definition at line 198 of file JOscParametersInterface.hh.

199  {
200  return ((unsigned int) this->dM21sq.isDefined() +
201  (unsigned int) this->dM31sq.isDefined() +
202  (unsigned int) this->deltaCP.isDefined() +
203  (unsigned int) this->sinsqTh12.isDefined() +
204  (unsigned int) this->sinsqTh13.isDefined() +
205  (unsigned int) this->sinsqTh23.isDefined());
206  }
JParameter_t sinsqTh12
Squared sine of the PMNS mixing angle between the first and second neutrino mass eigenstates [-]...
JParameter_t dM21sq
Squared mass difference between the first and second neutrino mass eigenstates [eV2].
JParameter_t sinsqTh13
Squared sine of the PMNS mixing angle between the first and third neutrino mass eigenstates [-]...
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].
JParameter_t sinsqTh23
Squared sine of the PMNS mixing angle between the second and third neutrino mass eigenstates [-]...
JParameter_t deltaCP
PMNS phase angle [pi * rad].
template<class T>
virtual bool JOSCPROB::JOscParametersInterface< T >::contains ( const JOscParameters_t parameters) const
inlinevirtual

Check if this oscillations parameter set contains the given oscillation parameters.

Parameters
parametersoscillation parameters
Returns
true if all given oscillation parameters
are also defined in this oscillation parameters set

Definition at line 216 of file JOscParametersInterface.hh.

217  {
218  if ( (parameters.dM21sq.isDefined() && !this->dM21sq.isDefined()) ||
219  (parameters.dM31sq.isDefined() && !this->dM31sq.isDefined()) ||
220  (parameters.deltaCP.isDefined() && !this->deltaCP.isDefined()) ||
221  (parameters.sinsqTh12.isDefined() && !this->sinsqTh12.isDefined()) ||
222  (parameters.sinsqTh13.isDefined() && !this->sinsqTh13.isDefined()) ||
223  (parameters.sinsqTh23.isDefined() && !this->sinsqTh23.isDefined()) ) {
224  return false;
225  } else {
226  return true;
227  }
228  }
JParameter_t sinsqTh12
Squared sine of the PMNS mixing angle between the first and second neutrino mass eigenstates [-]...
JParameter_t dM21sq
Squared mass difference between the first and second neutrino mass eigenstates [eV2].
*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
JParameter_t sinsqTh13
Squared sine of the PMNS mixing angle between the first and third neutrino mass eigenstates [-]...
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].
JParameter_t sinsqTh23
Squared sine of the PMNS mixing angle between the second and third neutrino mass eigenstates [-]...
JParameter_t deltaCP
PMNS phase angle [pi * rad].
template<class T>
JReader& JOSCPROB::JOscParametersInterface< T >::read ( JReader in)
inlineoverridevirtual

Binary stream input of oscillation parameters.

Parameters
ininput stream
Returns
input stream

Implements JIO::JSerialisable.

Definition at line 269 of file JOscParametersInterface.hh.

270  {
271  JProperties properties = getProperties();
272 
273  for (JProperties::iterator i = properties.begin(); i != properties.end(); ++i) {
274 
275  bool is_defined;
276  T value;
277 
278  if ((in >> is_defined >> value) && is_defined) {
279 
280  JParameter_t& parameter = i->second.getValue<JParameter_t>();
281 
282  parameter.setValue(value);
283  }
284  }
285 
286  return in;
287  }
Utility class to parse parameter values.
Definition: JProperties.hh:496
JProperties getProperties(const JEquationParameters &equation=JOscParameters_t::getEquationParameters())
Get properties of this class.
do set_variable OUTPUT_DIRECTORY $WORKDIR T
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:46
template<class T>
JWriter& JOSCPROB::JOscParametersInterface< T >::write ( JWriter out) const
inlineoverridevirtual

Binary stream output of oscillation parameters.

Parameters
outoutput stream
Returns
output stream

Implements JIO::JSerialisable.

Definition at line 296 of file JOscParametersInterface.hh.

297  {
298  const JProperties properties = getProperties();
299 
300  for (JProperties::const_iterator i = properties.cbegin(); i != properties.cend(); ++i) {
301 
302  const JParameter_t& parameter = i->second.getValue<JParameter_t>();
303 
304  out << parameter.isDefined() << parameter.getValue();
305  }
306 
307  return out;
308  }
Utility class to parse parameter values.
Definition: JProperties.hh:496
JProperties getProperties(const JEquationParameters &equation=JOscParameters_t::getEquationParameters())
Get properties of this class.
template<class T>
static JEquationParameters& JOSCPROB::JOscParametersInterface< T >::getEquationParameters ( )
inlinestatic

Get equation parameters.

Returns
equation parameters

Definition at line 316 of file JOscParametersInterface.hh.

317  {
318  static JEquationParameters equation("=", "\n\r;,", "./", "#");
319 
320  return equation;
321  }
Simple data structure to support I/O of equations (see class JLANG::JEquation).
template<class T>
static void JOSCPROB::JOscParametersInterface< T >::setEquationParameters ( const JEquationParameters equation)
inlinestatic

Set equation parameters.

Parameters
equationequation parameters

Definition at line 329 of file JOscParametersInterface.hh.

330  {
331  getEquationParameters() = equation;
332  }
static JEquationParameters & getEquationParameters()
Get equation parameters.
template<class T>
JProperties JOSCPROB::JOscParametersInterface< T >::getProperties ( const JEquationParameters equation = JOscParameters_t::getEquationParameters())
inline

Get properties of this class.

Parameters
equationequation parameters

Definition at line 340 of file JOscParametersInterface.hh.

341  {
342  return JOscParametersHelper(*this, equation);
343  }
template<class T>
JProperties JOSCPROB::JOscParametersInterface< T >::getProperties ( const JEquationParameters equation = JOscParameters_t::getEquationParameters()) const
inline

Get properties of this class.

Parameters
equationequation parameters

Definition at line 351 of file JOscParametersInterface.hh.

352  {
353  return JOscParametersHelper(*this, equation);
354  }
template<class T>
void JOSCPROB::JOscParametersInterface< T >::setProperties ( const JProperties properties)
inline

Set properties of this class.

Parameters
propertiesproperties

Definition at line 362 of file JOscParametersInterface.hh.

363  {
364  this->dM21sq = properties.getValue<JParameter_t>("dM21sq");
365  this->dM31sq = properties.getValue<JParameter_t>("dM31sq");
366  this->deltaCP = properties.getValue<JParameter_t>("deltaCP");
367  this->sinsqTh12 = properties.getValue<JParameter_t>("sinsqTh12");
368  this->sinsqTh13 = properties.getValue<JParameter_t>("sinsqTh13");
369  this->sinsqTh23 = properties.getValue<JParameter_t>("sinsqTh23");
370  }
JParameter_t sinsqTh12
Squared sine of the PMNS mixing angle between the first and second neutrino mass eigenstates [-]...
JParameter_t dM21sq
Squared mass difference between the first and second neutrino mass eigenstates [eV2].
JParameter_t sinsqTh13
Squared sine of the PMNS mixing angle between the first and third neutrino mass eigenstates [-]...
const T & getValue(const std::string &key) const
Get value.
Definition: JProperties.hh:974
JParameter_t dM31sq
Squared mass difference between the first and third neutrino mass eigenstates [eV2].
JParameter_t sinsqTh23
Squared sine of the PMNS mixing angle between the second and third neutrino mass eigenstates [-]...
JParameter_t deltaCP
PMNS phase angle [pi * rad].

Friends And Related Function Documentation

template<class T>
std::istream& operator>> ( std::istream &  in,
JOscParameters_t parameters 
)
friend

Stream input of oscillation parameters.

Parameters
ininput stream
parametersoscillation parameters
Returns
input stream

Definition at line 238 of file JOscParametersInterface.hh.

239  {
240  JProperties properties(parameters.getProperties());
241 
242  in >> properties;
243 
244  parameters.setProperties(properties);
245 
246  return in;
247  }
Utility class to parse parameter values.
Definition: JProperties.hh:496
*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
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:46
template<class T>
std::ostream& operator<< ( std::ostream &  out,
const JOscParameters_t parameters 
)
friend

Stream output of oscillation parameters.

Parameters
outoutput stream
parametersoscillation parameters
Returns
output stream

Definition at line 257 of file JOscParametersInterface.hh.

258  {
259  return out << parameters.getProperties();
260  }
*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

Member Data Documentation

template<class T>
JParameter_t JOSCPROB::JOscParametersInterface< T >::dM21sq

Squared mass difference between the first and second neutrino mass eigenstates [eV2].

Definition at line 373 of file JOscParametersInterface.hh.

template<class T>
JParameter_t JOSCPROB::JOscParametersInterface< T >::dM31sq

Squared mass difference between the first and third neutrino mass eigenstates [eV2].

Definition at line 374 of file JOscParametersInterface.hh.

template<class T>
JParameter_t JOSCPROB::JOscParametersInterface< T >::deltaCP

PMNS phase angle [pi * rad].

Definition at line 375 of file JOscParametersInterface.hh.

template<class T>
JParameter_t JOSCPROB::JOscParametersInterface< T >::sinsqTh12

Squared sine of the PMNS mixing angle between the first and second neutrino mass eigenstates [-].

Definition at line 376 of file JOscParametersInterface.hh.

template<class T>
JParameter_t JOSCPROB::JOscParametersInterface< T >::sinsqTh13

Squared sine of the PMNS mixing angle between the first and third neutrino mass eigenstates [-].

Definition at line 377 of file JOscParametersInterface.hh.

template<class T>
JParameter_t JOSCPROB::JOscParametersInterface< T >::sinsqTh23

Squared sine of the PMNS mixing angle between the second and third neutrino mass eigenstates [-].

Definition at line 378 of file JOscParametersInterface.hh.


The documentation for this struct was generated from the following file: