1#ifndef __JOSCPROB__JOSCPROBHELPER__
2#define __JOSCPROB__JOSCPROBHELPER__
31 public std::shared_ptr<JOscProbInterface>
89 this->reset(oscProb.
clone());
103 return *(this->get());
138 void set(
const std::string& name,
152 template<
class ...Args>
153 void set(
const std::string& name,
155 const Args& ...args)
const
196 const double costh)
const
215 const double costh)
const
232 double getP(
const std::string& name,
236 const double costh)
const
250 template<
class ...Args>
251 double getP(
const std::string& name,
253 const Args& ...args)
const
303 static const char* KEYWORD =
"oscprob";
305 if (!
object) {
return in; }
309 const streampos pos = is.tellg();
310 const ios_base::iostate state = is.rdstate();
316 is.imbue(locale(is.getloc(), facet.
clone()));
321 if (equation.
getKey() == KEYWORD) {
325 if (filesystem::is_regular_file(equation.
getValue(), error)) {
329 ifstream ifs(equation.
getValue().c_str());
342 properties2[KEYWORD] = properties1;
347 }
else if (!equation.
getValue().empty()) {
356 is.setstate(ios::badbit);
373 out <<
object.getProperties();
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Utility class to parse parameter values.
Utility class to parse parameter values.
Facet class to specify parsing of equations in currect locale (see class JLANG::JEquation).
virtual JEquationFacet * clone() const override
Clone this facet.
Simple data structure to support I/O of equations (see class JLANG::JEquation).
const string_type & getEndOfLine() const
Get end of line characters.
General purpose equation class.
const std::string & getKey() const
Get key.
const std::string & getValue() const
Get value.
Exception for null pointer operation.
Wrapper class around STL stringstream class to facilitate optional loading of data from file.
Interface class for sets of oscillation parameters.
void set(const std::string &name, const value_type &value)
Set value for a given oscillation parameter.
Low-level interface for oscillation probability calculators.
virtual double getP(const JOscChannel &channel, const double E, const double costh) const =0
Get oscillation probability for a given oscillation channel.
static JEquationParameters & getEquationParameters()
Get equation parameters.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
virtual clone_type clone() const override
Get clone of this object.
virtual double getBaseline(const double costh) const =0
Get baseline for a given cosine zenith angle.
virtual double getCosth(const double L) const =0
Get cosine zenith angle for a given baseline.
Neutrino oscillation channel.
JOscParameters_t & getParameters() const
Get reference to oscillation parameters interface.
JOscParameters_t::argument_type argument_type
virtual JProperties getProperties(const JEquationParameters &equation=JOscParameters_t::getEquationParameters())
Get properties of this class.
JOscParameters_t::value_type value_type
Helper class for oscillation probability calculators.
void set(const std::string &name, const value_type &value) const
Set value for a given oscillation parameter.
void set(const JOscParameters_t ¶meters) const
Set oscillation parameters.
double getP(const std::string &name, const double value, const Args &...args) const
Get oscillation probability for a given set of oscillation parameters and a given oscillation channel...
JOscParameterReferences_t & getParameters() const
Get reference to oscillation parameters interface.
JOscProbInterface & getOscProbInterface() const
Get reference to oscillation probability interface.
JOscProbInterface::JOscParameterReferences_t JOscParameterReferences_t
JOscProbInterface::JOscParameters_t JOscParameters_t
JOscProbHelper(const pointer_type &pOscProb)
Copy constructor.
JProperties getProperties(const JEquationParameters &eqpars=JOscProbInterface::getEquationParameters()) const
Get properties of this class.
JOscProbHelper(const JOscProbInterface &oscProb)
Constructor.
JOscProbInterface::value_type value_type
std::shared_ptr< JOscProbInterface > pointer_type
double getBaseline(const double costh) const
Get baseline for a given cosine zenith angle.
JProperties getProperties(const JEquationParameters &eqpars=JOscProbInterface::getEquationParameters())
Get properties of this class.
JOscProbHelper()
Default constructor.
friend std::istream & operator>>(std::istream &in, JOscProbHelper &object)
Read from input.
double getP(const JOscChannel &channel, const double energy, const double costh) const
Get oscillation probability corresponding to given oscillation channel, neutrino energy and zenith an...
double getP(const std::string &name, const double value, const JOscChannel &channel, const double E, const double costh) const
Get oscillation probability for a given oscillation parameter and a given oscillation channel.
JOscProbInterface::argument_type argument_type
double getP(const JOscParameters_t ¶meters, const JOscChannel &channel, const double energy, const double costh) const
Get oscillation probability for a given set of oscillation parameters and a given oscillation channel...
void configure(const JOscProbInterface &oscProb)
Configure oscillation probability function.
void configure(const pointer_type &pOscProb)
Configure oscillation probability function.
void set(const std::string &name, const value_type &value, const Args &...args) const
Set value for given list of oscillation parameters.
JOscProbInterface::JParameter_t JParameter_t
double getCosth(const double L) const
Get cosine zenith angle for a given baseline.
friend std::ostream & operator<<(std::ostream &out, const JOscProbHelper &object)
Write to output.