Jpp master_rocky-44-g75b7c4f75
the software that should make you happy
Loading...
Searching...
No Matches
JOSCPROB::JOscProbHelper Struct Reference

Helper class for oscillation probabilities. More...

#include <JOscProbHelper.hh>

Inheritance diagram for JOSCPROB::JOscProbHelper:
JOSCPROB::JOscillogram

Public Types

typedef JOscProbInterface::JOscParameters_t JOscParameters_t
 
typedef JOscProbInterface::JOscParameterReferences_t JOscParameterReferences_t
 
typedef JOscProbInterface::JParameter_t JParameter_t
 
typedef JOscProbInterface::argument_type argument_type
 
typedef JOscProbInterface::value_type value_type
 
typedef std::shared_ptr< JOscProbInterfacepointer_type
 

Public Member Functions

 JOscProbHelper ()
 Default constructor.
 
 JOscProbHelper (const pointer_type &pOscProb)
 Constructor.
 
 JOscProbHelper (const JOscProbInterface &oscProb)
 Constructor.
 
void configure (const pointer_type &pOscProb)
 Configure oscillation probability function.
 
void configure (const JOscProbInterface &oscProb)
 Configure oscillation probability function.
 
JOscProbInterfacegetOscProbInterface () const
 Get reference to oscillation probability interface.
 
JOscParameterReferences_tgetParameters () const
 Get reference to oscillation parameters interface.
 
void set (const JOscParameters_t &parameters) const
 Set oscillation parameters.
 
void set (const std::string &name, const value_type &value) const
 Set value for a given oscillation parameter.
 
template<class ... Args>
void set (const std::string &name, const value_type &value, const Args &...args) const
 Set value for given list of oscillation parameters.
 
double getP (const JOscChannel &channel, const double energy, const double costh) const
 Get oscillation probability corresponding to given oscillation channel, neutrino energy and zenith angle.
 
double getP (const JOscParameters_t &parameters, 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.
 
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.
 
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.
 
double getCosth (const double L) const
 Get cosine zenith angle for a given baseline.
 
double getBaseline (const double costh) const
 Get baseline for a given cosine zenith angle.
 

Detailed Description

Helper class for oscillation probabilities.

Definition at line 25 of file JOscProbHelper.hh.

Member Typedef Documentation

◆ JOscParameters_t

◆ JOscParameterReferences_t

◆ JParameter_t

◆ argument_type

◆ value_type

◆ pointer_type

Definition at line 35 of file JOscProbHelper.hh.

Constructor & Destructor Documentation

◆ JOscProbHelper() [1/3]

JOSCPROB::JOscProbHelper::JOscProbHelper ( )
inline

Default constructor.

Definition at line 41 of file JOscProbHelper.hh.

42 {}

◆ JOscProbHelper() [2/3]

JOSCPROB::JOscProbHelper::JOscProbHelper ( const pointer_type & pOscProb)
inline

Constructor.

Parameters
pOscProbshared pointer to oscillation probability function

Definition at line 50 of file JOscProbHelper.hh.

50 :
51 pointer_type(pOscProb)
52 {}
std::shared_ptr< JOscProbInterface > pointer_type

◆ JOscProbHelper() [3/3]

JOSCPROB::JOscProbHelper::JOscProbHelper ( const JOscProbInterface & oscProb)
inline

Constructor.

Parameters
oscProboscillation probability function

Definition at line 60 of file JOscProbHelper.hh.

61 {
62 configure(oscProb);
63 }
void configure(const pointer_type &pOscProb)
Configure oscillation probability function.

Member Function Documentation

◆ configure() [1/2]

void JOSCPROB::JOscProbHelper::configure ( const pointer_type & pOscProb)
inline

Configure oscillation probability function.

Parameters
oscProboscillation probability function

Definition at line 71 of file JOscProbHelper.hh.

72 {
73 static_cast<pointer_type&>(*this) = pOscProb;
74 }

◆ configure() [2/2]

void JOSCPROB::JOscProbHelper::configure ( const JOscProbInterface & oscProb)
inline

Configure oscillation probability function.

Parameters
oscProboscillation probability function

Definition at line 82 of file JOscProbHelper.hh.

83 {
84 this->reset(oscProb.clone());
85 }
void reset(T &value)
Reset value.

◆ getOscProbInterface()

JOscProbInterface & JOSCPROB::JOscProbHelper::getOscProbInterface ( ) const
inline

Get reference to oscillation probability interface.

Returns
oscillation parameters

Definition at line 93 of file JOscProbHelper.hh.

94 {
95 using namespace JPP;
96
97 if (static_cast<const JOscProbHelper&>(*this)) {
98 return *(this->get());
99 } else {
100 THROW(JNullPointerException, "JOscProbHelper::getOscProbInterface(): Oscillation probability interface is not set.");
101 }
102 }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Exception for null pointer operation.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Helper class for oscillation probabilities.

◆ getParameters()

JOscParameterReferences_t & JOSCPROB::JOscProbHelper::getParameters ( ) const
inline

Get reference to oscillation parameters interface.

Returns
reference to oscillation parameters interface

Definition at line 110 of file JOscProbHelper.hh.

111 {
113 }
JOscParameters_t & getParameters() const
Get reference to oscillation parameters interface.
JOscProbInterface & getOscProbInterface() const
Get reference to oscillation probability interface.

◆ set() [1/3]

void JOSCPROB::JOscProbHelper::set ( const JOscParameters_t & parameters) const
inline

Set oscillation parameters.

Parameters
parametersoscillation parameters

Definition at line 121 of file JOscProbHelper.hh.

122 {
123 return getParameters().set(parameters);
124 }
void set(const std::string &name, const value_type &value)
Set value for a given oscillation parameter.
JOscParameterReferences_t & getParameters() const
Get reference to oscillation parameters interface.

◆ set() [2/3]

void JOSCPROB::JOscProbHelper::set ( const std::string & name,
const value_type & value ) const
inline

Set value for a given oscillation parameter.

Parameters
nameparameter name
valueparameter value

Definition at line 133 of file JOscProbHelper.hh.

135 {
136 getParameters().set(name, value);
137 }

◆ set() [3/3]

template<class ... Args>
void JOSCPROB::JOscProbHelper::set ( const std::string & name,
const value_type & value,
const Args &... args ) const
inline

Set value for given list of oscillation parameters.

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

Definition at line 148 of file JOscProbHelper.hh.

151 {
152 getParameters().set(name, value, args...);
153 }

◆ getP() [1/4]

double JOSCPROB::JOscProbHelper::getP ( const JOscChannel & channel,
const double energy,
const double costh ) const
inline

Get oscillation probability corresponding to given oscillation channel, neutrino energy and zenith angle.

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

Definition at line 165 of file JOscProbHelper.hh.

168 {
169 return getOscProbInterface().getP(channel, energy, costh);
170 }
virtual double getP(const JOscChannel &channel, const double E, const double costh) const =0
Get oscillation probability for a given oscillation channel.

◆ getP() [2/4]

double JOSCPROB::JOscProbHelper::getP ( const JOscParameters_t & parameters,
const JOscChannel & channel,
const double energy,
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
energyneutrino energy [GeV]
costhcosine zenith angle
Returns
oscillation probability

Definition at line 183 of file JOscProbHelper.hh.

187 {
188 return getOscProbInterface().getP(parameters, channel, energy, costh);
189 }

◆ getP() [3/4]

double JOSCPROB::JOscProbHelper::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 203 of file JOscProbHelper.hh.

208 {
209 return getOscProbInterface().getP(name, value, channel, E, costh);
210 }

◆ getP() [4/4]

template<class ... Args>
double JOSCPROB::JOscProbHelper::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 222 of file JOscProbHelper.hh.

225 {
226 return getOscProbInterface().getP(name, value, args...);
227 }

◆ getCosth()

double JOSCPROB::JOscProbHelper::getCosth ( const double L) const
inline

Get cosine zenith angle for a given baseline.

Parameters
Lbaseline [km]
Returns
cosine zenith angle

Definition at line 236 of file JOscProbHelper.hh.

237 {
238 return getOscProbInterface().getCosth(L);
239 }
double getCosth(const double L) const
Get cosine zenith angle for a given baseline.

◆ getBaseline()

double JOSCPROB::JOscProbHelper::getBaseline ( const double costh) const
inline

Get baseline for a given cosine zenith angle.

Parameters
costhcosine zenith angle
Returns
baseline [km]

Definition at line 248 of file JOscProbHelper.hh.

249 {
250 return getOscProbInterface().getBaseline(costh);
251 }
double getBaseline(const double costh) const
Get baseline for a given cosine zenith angle.

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