1#ifndef __JOSCPROB__JOSCPROBHELPER__
2#define __JOSCPROB__JOSCPROBHELPER__
32 public std::shared_ptr<JOscProbInterface>
90 this->reset(oscProb.
clone());
104 return *(this->get());
139 void set(
const std::string& name,
153 template<
class ...Args>
154 void set(
const std::string& name,
156 const Args& ...args)
const
197 const double costh)
const
216 const double costh)
const
233 double getP(
const std::string& name,
237 const double costh)
const
251 template<
class ...Args>
252 double getP(
const std::string& name,
254 const Args& ...args)
const
304 static const char* KEYWORD =
"oscprob";
306 if (!
object) {
return in; }
310 if (getFileStatus(is.str().c_str())) {
314 const streampos pos = is.tellg();
315 const ios_base::iostate state = is.rdstate();
321 is.imbue(locale(is.getloc(), facet.
clone()));
326 if (equation.
getKey() == KEYWORD) {
328 if (getFileStatus(equation.
getValue().c_str())) {
332 ifstream ifs(equation.
getValue().c_str());
345 properties2[KEYWORD] = properties1;
350 }
else if (!equation.
getValue().empty()) {
359 is.setstate(ios::badbit);
376 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 std::string & 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.
void load()
Load data from file with name corresponding to current contents.
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.