Jpp  19.0.0
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
JOscParametersInterface
< double > 
JOscParameters_t
 
typedef
JOscParametersInterface
< double & > 
JOscParameterReferences_t
 
typedef
JOscParameters_t::JOscParameter_t 
JOscParameter_t
 
typedef
JOscParameters_t::JParameter_t 
JParameter_t
 
typedef
JOscParameters_t::argument_type 
argument_type
 
typedef
JOscParameters_t::value_type 
value_type
 
typedef std::shared_ptr
< JOscParameters_t
pointer_type
 
typedef JClonable< JClonable_t >
::clone_type 
clone_type
 

Public Member Functions

 JOscProbInterface ()
 Default constructor. More...
 
 JOscProbInterface (const JOscParameterReferences_t &parameters)
 Constructor. More...
 
template<class... Args>
 JOscProbInterface (const JOscParameterReferences_t &parameters, const std::string &name, double &value, const Args &...args)
 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, const value_type &value) const
 Set value for a given oscillation parameter. More...
 
void set (const std::string &name, const value_type &value, const Args &...args) const
 Set value for given list of oscillation parameters. More...
 
void set (const JOscParametersInterface< value_type > &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 41 of file JOscProbInterface.hh.

Definition at line 42 of file JOscProbInterface.hh.

Definition at line 33 of file JOscParametersHelper.hh.

Definition at line 34 of file JOscParametersHelper.hh.

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

Definition at line 36 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 48 of file JOscProbInterface.hh.

49  {}
JOSCPROB::JOscProbInterface::JOscProbInterface ( const JOscParameterReferences_t parameters)
inline

Constructor.

Parameters
parametersoscillation parameters

Definition at line 57 of file JOscProbInterface.hh.

57  :
59  {}
*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
JOscParametersHelper< double & > JOscParametersHelper_t
template<class... Args>
JOSCPROB::JOscProbInterface::JOscProbInterface ( const JOscParameterReferences_t parameters,
const std::string &  name,
double &  value,
const Args &...  args 
)
inline

Constructor.

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

Definition at line 71 of file JOscProbInterface.hh.

74  :
76  {}
*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
JOscParametersHelper< double & > JOscParametersHelper_t
then fatal The output file must have the wildcard in the name
Definition: JCanberra.sh:31
virtual JOSCPROB::JOscProbInterface::~JOscProbInterface ( )
inlinevirtual

Virtual destructor.

Definition at line 82 of file JOscProbInterface.hh.

83  {}

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 109 of file JOscProbInterface.hh.

113  {
114  this->set(parameters);
115 
116  return getP(channel, E, costh);
117  }
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
virtual void set(const std::string &name, const value_type &value) const
Set value for a given oscillation parameter.
*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::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 131 of file JOscProbInterface.hh.

136  {
137  this->set(name, value);
138 
139  return getP(channel, E, costh);
140  }
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
virtual void set(const std::string &name, const value_type &value) const
Set value for a given oscillation parameter.
then fatal The output file must have the wildcard in the name
Definition: JCanberra.sh:31
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 152 of file JOscProbInterface.hh.

155  {
156  this->set(name, value);
157 
158  return getP(args...);
159  }
virtual double getP(const JOscChannel &channel, const double E, const double costh) const =0
Get oscillation probability for a given oscillation channel.
virtual void set(const std::string &name, const value_type &value) const
Set value for a given oscillation parameter.
then fatal The output file must have the wildcard in the name
Definition: JCanberra.sh:31
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 170 of file JOscProbInterface.hh.

173  {
174  return getP(channel, E, costh);
175  }
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 188 of file JOscProbInterface.hh.

192  {
193  return getP(parameters, channel, E, costh);
194  }
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 208 of file JOscProbInterface.hh.

213  {
214  return getP(name, value, channel, E, costh);
215  }
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 fatal The output file must have the wildcard in the name
Definition: JCanberra.sh:31
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 227 of file JOscProbInterface.hh.

230  {
231  return getP(name, value, args...);
232  }
virtual double getP(const JOscChannel &channel, const double E, const double costh) const =0
Get oscillation probability for a given oscillation channel.
then fatal The output file must have the wildcard in the name
Definition: JCanberra.sh:31
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 83 of file JOscParametersHelper.hh.

84  {
85  using namespace std;
86  using namespace JPP;
87 
88  JOscParameters_t* p = dynamic_cast<JOscParameters_t*>(parameters.clone());
89 
90  if (p != NULL) {
91  reset(p);
92  } else {
93  THROW(JNullPointerException, "JOscParametersHelper::configure(): Unable to retrieve oscillation parameters interface.");
94  }
95  }
#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 103 of file JOscParametersHelper.hh.

104  {
105  using namespace JPP;
106 
107  if (static_cast<const JOscParametersHelper_t&>(*this)) {
108  return *(this->get());
109  } else {
110  THROW(JNullPointerException, "JOscParametersHelper::getParameters(): Oscillation parameters interface is not set.");
111  }
112  }
#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,
const value_type value 
) const
inlinevirtualinherited

Set value for a given oscillation parameter.

Parameters
nameparameter name
valueparameter value

Definition at line 121 of file JOscParametersHelper.hh.

123  {
124  getParameters().set(name, value);
125  }
JOscParameters_t & getParameters() const
Get reference to oscillation parameters interface.
void set(const std::string &name, const value_type &value)
Set value for a given oscillation parameter.
then fatal The output file must have the wildcard in the name
Definition: JCanberra.sh:31
void JOSCPROB::JOscParametersHelper< double & >::set ( const std::string &  name,
const value_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 136 of file JOscParametersHelper.hh.

139  {
140  this->set(name, value);
141  this->set(args...);
142  }
virtual void set(const std::string &name, const value_type &value) const
Set value for a given oscillation parameter.
then fatal The output file must have the wildcard in the name
Definition: JCanberra.sh:31
void JOSCPROB::JOscParametersHelper< double & >::set ( const JOscParametersInterface< value_type > &  parameters) const
inlineinherited

Set oscillation parameters.

Parameters
parametersoscillation parameters

Definition at line 150 of file JOscParametersHelper.hh.

151  {
152  using namespace std;
153  using namespace JPP;
154 
155  const JProperties properties = parameters.getProperties();
156 
157  for (JProperties::const_iterator i = properties.cbegin(); i != properties.cend(); ++i) {
158  const JOscParameter<value_type>& parameter = i->second.getValue<const JOscParameter<value_type> >();
159 
160  this->set(i->first, parameter.getValue());
161  }
162  }
Abstract base class for oscillation parameter.
virtual void set(const std::string &name, const value_type &value) const
Set value for a given oscillation parameter.
Utility class to parse parameter values.
Definition: JProperties.hh:497
virtual JProperties getProperties(const JEquationParameters &equation=JOscParametersInterface_t::getEquationParameters())=0
Get properties of this class.
const value_type getValue() const
Get value of parameter.
Definition: JParameter.hh:82
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 170 of file JOscParametersHelper.hh.

171  {
172  return getParameters().is_valid();
173  }
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: