Jpp  18.3.0-rc.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | List of all members
JOSCPROB::JOscProbInterface Class Referenceabstract

Low-level interface for oscillation probability calculators. More...

#include <JOscProbInterface.hh>

Inheritance diagram for JOSCPROB::JOscProbInterface:
JOSCPROB::JBaselineComputerInterface JOSCPROB::JOscParametersHelper< double > JLANG::JClonable< JClonable_t, JDerived_t >

Public Types

typedef JOscParametersHelper
< double > 
JOscParametersHelper_t
 
typedef
JOscParametersHelper_t::JOscParameters_t 
JOscParameters_t
 
typedef
JOscParametersHelper_t::JOscParameter_t 
JOscParameter_t
 
typedef
JOscParametersHelper_t::JParameter_t 
JParameter_t
 
typedef
JOscParametersHelper_t::argument_type 
argument_type
 
typedef std::shared_ptr
< JOscParameters_t
pointer_type
 
typedef JClonable< JClonable_t >
::clone_type 
clone_type
 

Public Member Functions

 JOscProbInterface ()
 Default constructor. More...
 
virtual ~JOscProbInterface ()
 Virtual destructor. More...
 
virtual double getP (const JOscChannel &channel, const double E, const double costh) const =0
 Get oscillation probability for a given oscillation channel. More...
 
double getP (const JOscParameters_t &parameters, const JOscChannel &channel, const double E, const double costh) const
 Get oscillation probability for a given set of oscillation parameters
and a given oscillation channel. More...
 
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. More...
 
template<class... Args>
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. More...
 
double operator() (const JOscChannel &channel, const double E, const double costh) const
 Get oscillation probability for a given oscillation channel. More...
 
double operator() (const JOscParameters_t &parameters, const JOscChannel &channel, const double E, const double costh) const
 Get oscillation probability for a given set of oscillation parameters
and a given oscillation channel. More...
 
double operator() (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. More...
 
template<class... Args>
double operator() (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. More...
 
virtual double getCosth (const double L) const =0
 Get cosine zenith angle for a given baseline. More...
 
virtual double getBaseline (const double costh) const =0
 Get baseline for a given cosine zenith angle. More...
 
virtual void configure (const JOscParameters_t &parameters)
 Configure oscillation parameters. More...
 
JOscParameters_tgetParameters () const
 Get reference to oscillation parameters interface. More...
 
virtual void set (const std::string &name, argument_type value) const
 Set value for a given oscillation parameter. More...
 
void set (const std::string &name, argument_type value, const Args &...args) const
 Set value for given list of oscillation parameters. More...
 
void set (const JOscParameters_t &parameters) const
 Set oscillation parameters. More...
 
bool is_valid () const
 Check validity of oscillation parameters. More...
 
virtual clone_type clone () const override
 Get clone of this object. More...
 

Detailed Description

Low-level interface for oscillation probability calculators.

Definition at line 29 of file JOscProbInterface.hh.

Member Typedef Documentation

Definition at line 36 of file JOscProbInterface.hh.

Definition at line 38 of file JOscProbInterface.hh.

Definition at line 39 of file JOscProbInterface.hh.

Definition at line 40 of file JOscProbInterface.hh.

Definition at line 41 of file JOscProbInterface.hh.

typedef std::shared_ptr<JOscParameters_t> JOSCPROB::JOscParametersHelper< double >::pointer_type
inherited

Definition at line 34 of file JOscParametersHelper.hh.

template<class JClonable_t, class JDerived_t = JNullType>
typedef JClonable<JClonable_t>::clone_type JLANG::JClonable< JClonable_t, JDerived_t >::clone_type
inherited

Definition at line 61 of file JClonable.hh.

Constructor & Destructor Documentation

JOSCPROB::JOscProbInterface::JOscProbInterface ( )
inline

Default constructor.

Definition at line 47 of file JOscProbInterface.hh.

48  {}
virtual JOSCPROB::JOscProbInterface::~JOscProbInterface ( )
inlinevirtual

Virtual destructor.

Definition at line 54 of file JOscProbInterface.hh.

55  {}

Member Function Documentation

virtual double JOSCPROB::JOscProbInterface::getP ( const JOscChannel channel,
const double  E,
const double  costh 
) const
pure virtual

Get oscillation probability for a given oscillation channel.

Parameters
channeloscillation channel
Eneutrino energy [GeV]
costhcosine zenith angle
Returns
oscillation probability
double JOSCPROB::JOscProbInterface::getP ( const JOscParameters_t parameters,
const JOscChannel channel,
const double  E,
const double  costh 
) const
inline

Get oscillation probability for a given set of oscillation parameters
and a given oscillation channel.

Parameters
channeloscillation channel
parametersoscillation parameters
Eneutrino energy [GeV]
costhcosine zenith angle
Returns
oscillation probability

Definition at line 81 of file JOscProbInterface.hh.

85  {
86  this->set(parameters);
87 
88  return getP(channel, E, costh);
89  }
virtual double getP(const JOscChannel &channel, const double E, const double costh) const =0
Get oscillation probability for a given oscillation channel.
then usage $script< input file >[option[primary[working directory]]] nWhere option can be E
Definition: JMuonPostfit.sh:40
*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
virtual void set(const std::string &name, argument_type value) const
Set value for a given oscillation parameter.
double JOSCPROB::JOscProbInterface::getP ( const std::string name,
const double  value,
const JOscChannel channel,
const double  E,
const double  costh 
) const
inline

Get oscillation probability for a given oscillation parameter
and a given oscillation channel.

Parameters
nameparameter name
valueparameter value
channeloscillation channel
Eneutrino energy [GeV]
costhcosine zenith angle
Returns
oscillation probability

Definition at line 103 of file JOscProbInterface.hh.

108  {
109  this->set(name, value);
110 
111  return getP(channel, E, costh);
112  }
virtual double getP(const JOscChannel &channel, const double E, const double costh) const =0
Get oscillation probability for a given oscillation channel.
then usage $script< input file >[option[primary[working directory]]] nWhere option can be E
Definition: JMuonPostfit.sh:40
then echo Enter input within $TIMEOUT_S seconds echo n User name
Definition: JCookie.sh:42
virtual void set(const std::string &name, argument_type value) const
Set value for a given oscillation parameter.
template<class... Args>
double JOSCPROB::JOscProbInterface::getP ( const std::string name,
const double  value,
const Args &...  args 
) const
inline

Get oscillation probability for a given set of oscillation parameters
and a given oscillation channel.

Parameters
nameparameter name
valueparameter value
argsremaining arguments

Definition at line 124 of file JOscProbInterface.hh.

127  {
128  this->set(name, value);
129 
130  return getP(args...);
131  }
virtual double getP(const JOscChannel &channel, const double E, const double costh) const =0
Get oscillation probability for a given oscillation channel.
then echo Enter input within $TIMEOUT_S seconds echo n User name
Definition: JCookie.sh:42
virtual void set(const std::string &name, argument_type value) const
Set value for a given oscillation parameter.
double JOSCPROB::JOscProbInterface::operator() ( const JOscChannel channel,
const double  E,
const double  costh 
) const
inline

Get oscillation probability for a given oscillation channel.

Parameters
channeloscillation channel
Eneutrino energy [GeV]
costhcosine zenith angle
Returns
oscillation probability

Definition at line 142 of file JOscProbInterface.hh.

145  {
146  return getP(channel, E, costh);
147  }
virtual double getP(const JOscChannel &channel, const double E, const double costh) const =0
Get oscillation probability for a given oscillation channel.
then usage $script< input file >[option[primary[working directory]]] nWhere option can be E
Definition: JMuonPostfit.sh:40
double JOSCPROB::JOscProbInterface::operator() ( const JOscParameters_t parameters,
const JOscChannel channel,
const double  E,
const double  costh 
) const
inline

Get oscillation probability for a given set of oscillation parameters
and a given oscillation channel.

Parameters
channeloscillation channel
parametersoscillation parameters
Eneutrino energy [GeV]
costhcosine zenith angle
Returns
oscillation probability

Definition at line 160 of file JOscProbInterface.hh.

164  {
165  return getP(parameters, channel, E, costh);
166  }
virtual double getP(const JOscChannel &channel, const double E, const double costh) const =0
Get oscillation probability for a given oscillation channel.
then usage $script< input file >[option[primary[working directory]]] nWhere option can be E
Definition: JMuonPostfit.sh:40
*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
double JOSCPROB::JOscProbInterface::operator() ( const std::string name,
const double  value,
const JOscChannel channel,
const double  E,
const double  costh 
) const
inline

Get oscillation probability for a given oscillation parameter
and a given oscillation channel.

Parameters
nameparameter name
valueparameter value
channeloscillation channel
Eneutrino energy [GeV]
costhcosine zenith angle
Returns
oscillation probability

Definition at line 180 of file JOscProbInterface.hh.

185  {
186  return getP(name, value, channel, E, costh);
187  }
virtual double getP(const JOscChannel &channel, const double E, const double costh) const =0
Get oscillation probability for a given oscillation channel.
then usage $script< input file >[option[primary[working directory]]] nWhere option can be E
Definition: JMuonPostfit.sh:40
then echo Enter input within $TIMEOUT_S seconds echo n User name
Definition: JCookie.sh:42
template<class... Args>
double JOSCPROB::JOscProbInterface::operator() ( const std::string name,
const double  value,
const Args &...  args 
) const
inline

Get oscillation probability for a given set of oscillation parameters
and a given oscillation channel.

Parameters
nameparameter name
valueparameter value
argsremaining arguments

Definition at line 199 of file JOscProbInterface.hh.

202  {
203  return getP(name, value, args...);
204  }
virtual double getP(const JOscChannel &channel, const double E, const double costh) const =0
Get oscillation probability for a given oscillation channel.
then echo Enter input within $TIMEOUT_S seconds echo n User name
Definition: JCookie.sh:42
virtual double JOSCPROB::JBaselineComputerInterface::getCosth ( const double  L) const
pure virtualinherited

Get cosine zenith angle for a given baseline.

Parameters
Lbaseline [km]
Returns
cosine zenith angle

Implemented in JOSCPROB::JBaselineComputer.

virtual double JOSCPROB::JBaselineComputerInterface::getBaseline ( const double  costh) const
pure virtualinherited

Get baseline for a given cosine zenith angle.

Parameters
costhcosine zenith angle
Returns
baseline [km]

Implemented in JOSCPROB::JBaselineComputer.

virtual void JOSCPROB::JOscParametersHelper< double >::configure ( const JOscParameters_t parameters)
inlinevirtualinherited

Configure oscillation parameters.

Parameters
parametersoscillation parameters

Definition at line 81 of file JOscParametersHelper.hh.

82  {
83  using namespace std;
84  using namespace JPP;
85 
86  JOscParameters_t* p = dynamic_cast<JOscParameters_t*>(parameters.clone());
87 
88  if (p != NULL) {
89  reset(p);
90  } else {
91  THROW(JNullPointerException, "JOscParametersHelper::configure(): Unable to retrieve oscillation parameters interface.");
92  }
93  }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:712
*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
void reset(T &value)
Reset value.
JOscParametersInterface< double > JOscParameters_t
JOscParameters_t& JOSCPROB::JOscParametersHelper< double >::getParameters ( ) const
inlineinherited

Get reference to oscillation parameters interface.

Returns
reference to oscillation parameters interface

Definition at line 101 of file JOscParametersHelper.hh.

102  {
103  using namespace JPP;
104 
105  if (static_cast<const JOscParametersHelper_t&>(*this)) {
106  return *(this->get());
107  } else {
108  THROW(JNullPointerException, "JOscParametersHelper::getParameters(): Oscillation parameters interface is not set.");
109  }
110  }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:712
virtual void JOSCPROB::JOscParametersHelper< double >::set ( const std::string name,
argument_type  value 
) const
inlinevirtualinherited

Set value for a given oscillation parameter.

Parameters
nameparameter name
valueparameter value

Definition at line 119 of file JOscParametersHelper.hh.

121  {
122  getParameters().set(name, value);
123  }
JOscParameters_t & getParameters() const
Get reference to oscillation parameters interface.
then echo Enter input within $TIMEOUT_S seconds echo n User name
Definition: JCookie.sh:42
void set(const std::string &name, argument_type value)
Set value for a given oscillation parameter.
void JOSCPROB::JOscParametersHelper< double >::set ( const std::string name,
argument_type  value,
const Args &...  args 
) const
inlineinherited

Set value for given list of oscillation parameters.

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

Definition at line 134 of file JOscParametersHelper.hh.

137  {
138  this->set(name, value);
139  this->set(args...);
140  }
then echo Enter input within $TIMEOUT_S seconds echo n User name
Definition: JCookie.sh:42
virtual void set(const std::string &name, argument_type value) const
Set value for a given oscillation parameter.
void JOSCPROB::JOscParametersHelper< double >::set ( const JOscParameters_t parameters) const
inlineinherited

Set oscillation parameters.

Parameters
parametersoscillation parameters

Definition at line 148 of file JOscParametersHelper.hh.

149  {
150  using namespace std;
151  using namespace JPP;
152 
153  const JProperties& properties = parameters.getPropertiesInstance();
154 
155  for (JProperties::const_iterator i = properties.cbegin(); i != properties.cend(); ++i) {
156  const JOscParameter_t& parameter = i->second.getValue<const JOscParameter_t>();
157 
158  this->set(i->first, parameter.getValue());
159  }
160  }
JOscParameters_t::JOscParameter_t JOscParameter_t
Utility class to parse parameter values.
Definition: JProperties.hh:497
*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
virtual void set(const std::string &name, argument_type value) const
Set value for a given oscillation parameter.
bool JOSCPROB::JOscParametersHelper< double >::is_valid ( ) const
inlineinherited

Check validity of oscillation parameters.

Returns
true if all oscillation parameters are valid; else false

Definition at line 168 of file JOscParametersHelper.hh.

169  {
170  return getParameters().is_valid();
171  }
JOscParameters_t & getParameters() const
Get reference to oscillation parameters interface.
bool is_valid() const
Check validity of oscillation parameters.
template<class JClonable_t, class JDerived_t = JNullType>
virtual clone_type JLANG::JClonable< JClonable_t, JDerived_t >::clone ( ) const
inlineoverridevirtualinherited

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