Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
JAANET::JDiffuseFluxHelper Struct Reference

Helper class for diffuse flux factor. More...

#include <JDiffuseFluxHelper.hh>

Inheritance diagram for JAANET::JDiffuseFluxHelper:
JAANET::JFluxHelper JAANET::JEvtWeightFactorHelper

Public Types

typedef JFluxHelper::pointer_type pointer_type
 

Public Member Functions

 JDiffuseFluxHelper ()
 Default constructor.
 
 JDiffuseFluxHelper (const pointer_type &flux)
 Constructor.
 
 JDiffuseFluxHelper (const JDiffuseFlux &flux)
 Constructor.
 
JDiffuseFluxgetDiffuseFlux () const
 Get reference to diffuse flux function.
 
double getFactor (const int type, const double log10E, const double costh) const
 Get flux for given particle PDG-identifier, energy and zenith-angle.
 
double getFlux (const int type, const double log10E, const double costh) const
 Get flux for given particle PDG-identifier, energy and zenith-angle.
 
double operator() (const int type, const double log10E, const double costh) const
 Get flux for given particle PDG-identifier, energy and zenith-angle.
 
JFluxgetFlux () const
 Get reference to flux function.
 
double getFlux (const Evt &evt) const
 Get flux of given event.
 
void configure (const pointer_type &p)
 Configure event-weight factor.
 
void configure (const JEvtWeightFactor &factor)
 Configure event-weight factor.
 
JEvtWeightFactorgetFactor () const
 Get reference to event-weight factor.
 
double getFactor (const Evt &evt) const
 Get weight-factor of given event.
 
bool is_valid () const
 Check whether this event-weight factor is valid.
 
double operator() (const Evt &evt) const
 Get weight-factor of given event.
 
JProperties getProperties (const JEquationParameters &eqpars=JEvtWeightFactor::getEquationParameters())
 Get properties of this class.
 
JProperties getProperties (const JEquationParameters &eqpars=JEvtWeightFactor::getEquationParameters()) const
 Get properties of this class.
 

Detailed Description

Helper class for diffuse flux factor.

Definition at line 24 of file JDiffuseFluxHelper.hh.

Member Typedef Documentation

◆ pointer_type

Constructor & Destructor Documentation

◆ JDiffuseFluxHelper() [1/3]

JAANET::JDiffuseFluxHelper::JDiffuseFluxHelper ( )
inline

Default constructor.

Definition at line 33 of file JDiffuseFluxHelper.hh.

34 {}

◆ JDiffuseFluxHelper() [2/3]

JAANET::JDiffuseFluxHelper::JDiffuseFluxHelper ( const pointer_type & flux)
inline

Constructor.

Parameters
fluxdiffuse flux

Definition at line 42 of file JDiffuseFluxHelper.hh.

42 :
43 JFluxHelper(flux)
44 {}
JFluxHelper()
Default constructor.

◆ JDiffuseFluxHelper() [3/3]

JAANET::JDiffuseFluxHelper::JDiffuseFluxHelper ( const JDiffuseFlux & flux)
inline

Constructor.

Parameters
fluxdiffuse flux

Definition at line 52 of file JDiffuseFluxHelper.hh.

53 {
54 configure(flux);
55 }
void configure(const pointer_type &p)
Configure event-weight factor.

Member Function Documentation

◆ getDiffuseFlux()

JDiffuseFlux & JAANET::JDiffuseFluxHelper::getDiffuseFlux ( ) const
inline

Get reference to diffuse flux function.

Returns
reference to diffuse flux function.

Definition at line 63 of file JDiffuseFluxHelper.hh.

64 {
65 using namespace JPP;
66
67 JEvtWeightFactor& factor = JEvtWeightFactorHelper::getFactor();
68
69 JDiffuseFlux* p = dynamic_cast<JDiffuseFlux*>(&factor);
70
71 if (p != NULL) {
72 return *p;
73 } else {
74 THROW(JNullPointerException, "JDiffuseFluxHelper::getDiffuseFlux(): Cannot convert event-weight factor to diffuse flux function.");
75 }
76 }
#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).
JEvtWeightFactor & getFactor() const
Get reference to event-weight factor.

◆ getFactor() [1/3]

double JAANET::JDiffuseFluxHelper::getFactor ( const int type,
const double log10E,
const double costh ) const
inline

Get flux for given particle PDG-identifier, energy and zenith-angle.

Parameters
typePDG particle type
log10Elogarithmic neutrino energy [GeV]
costhcosine zenith angle
Returns
diffuse flux [GeV^-1 * m^-2 * sr^-1 * s^-1]

Definition at line 87 of file JDiffuseFluxHelper.hh.

90 {
91 const JDiffuseFlux& flux = getDiffuseFlux();
92
93 return flux(type, log10E, costh);
94 }
JDiffuseFlux & getDiffuseFlux() const
Get reference to diffuse flux function.

◆ getFlux() [1/3]

double JAANET::JDiffuseFluxHelper::getFlux ( const int type,
const double log10E,
const double costh ) const
inline

Get flux for given particle PDG-identifier, energy and zenith-angle.

Parameters
typePDG particle type
log10Elogarithmic neutrino energy [GeV]
costhcosine zenith angle
Returns
diffuse flux [GeV^-1 * m^-2 * sr^-1 * s^-1]

Definition at line 105 of file JDiffuseFluxHelper.hh.

108 {
109 return getFactor(type, log10E, costh);
110 }

◆ operator()() [1/2]

double JAANET::JDiffuseFluxHelper::operator() ( const int type,
const double log10E,
const double costh ) const
inline

Get flux for given particle PDG-identifier, energy and zenith-angle.

Parameters
typePDG particle type
log10Elogarithmic neutrino energy [GeV]
costhcosine zenith angle
Returns
diffuse flux [GeV^-1 * m^-2 * sr^-1 * s^-1]

Definition at line 121 of file JDiffuseFluxHelper.hh.

124 {
125 return getFactor(type, log10E, costh);
126 }

◆ getFlux() [2/3]

JFlux & JAANET::JFluxHelper::getFlux ( ) const
inlineinherited

Get reference to flux function.

Returns
reference to flux function

Definition at line 62 of file JFluxHelper.hh.

63 {
64 using namespace JPP;
65
66 JEvtWeightFactor& factor = this->getFactor();
67
68 JFlux* p = dynamic_cast<JFlux*>(&factor);
69
70 if (p != NULL) {
71 return *p;
72 } else {
73 THROW(JNullPointerException, "JFluxHelper::getFlux(): Cannot convert event-weight factor to flux function.");
74 }
75 }

◆ getFlux() [3/3]

double JAANET::JFluxHelper::getFlux ( const Evt & evt) const
inlineinherited

Get flux of given event.

Parameters
evtevent
Returns
flux [GeV^-1 * m^-2 * sr^-1 * s^-1]

Definition at line 84 of file JFluxHelper.hh.

85 {
86 return getFactor(evt);
87 }

◆ configure() [1/2]

void JAANET::JEvtWeightFactorHelper::configure ( const pointer_type & p)
inlineinherited

Configure event-weight factor.

Parameters
ppointer to event-weight factor

Definition at line 68 of file JEvtWeightFactorHelper.hh.

69 {
70 static_cast<pointer_type&>(*this) = p;
71 }
std::shared_ptr< JEvtWeightFactor > pointer_type

◆ configure() [2/2]

void JAANET::JEvtWeightFactorHelper::configure ( const JEvtWeightFactor & factor)
inlineinherited

Configure event-weight factor.

Parameters
factorevent-weight factor

Definition at line 79 of file JEvtWeightFactorHelper.hh.

80 {
81 using namespace JPP;
82
83 JEvtWeightFactor* p = dynamic_cast<JEvtWeightFactor*>(factor.clone());
84
85 if (p != NULL) {
86 this->reset(p);
87 } else {
88 THROW(JNullPointerException, "JEvtWeightFactorHelper::configure(): Could not retrieve event-weight factor interface.");
89 }
90 }
void reset(T &value)
Reset value.

◆ getFactor() [2/3]

JEvtWeightFactor & JAANET::JEvtWeightFactorHelper::getFactor ( ) const
inlineinherited

Get reference to event-weight factor.

Returns
reference to event-weight factor

Definition at line 98 of file JEvtWeightFactorHelper.hh.

99 {
100 using namespace JPP;
101
102 if (static_cast<const JEvtWeightFactorHelper&>(*this)) {
103 return *(this->get());
104 } else {
105 THROW(JNullPointerException, "JEvtWeightFactorHelper::getFactor(): Event-weight factor is not set.");
106 }
107 }
Helper class for event-weight factor.

◆ getFactor() [3/3]

double JAANET::JEvtWeightFactorHelper::getFactor ( const Evt & evt) const
inlineinherited

Get weight-factor of given event.

Parameters
evtevent
Returns
event-weight factor

Definition at line 129 of file JEvtWeightFactorHelper.hh.

130 {
131 const JEvtWeightFactor& weightFactor = getFactor();
132
133 return weightFactor.getFactor(evt);
134 }

◆ is_valid()

bool JAANET::JEvtWeightFactorHelper::is_valid ( ) const
inlineinherited

Check whether this event-weight factor is valid.

Returns
true if valid; else false

Definition at line 115 of file JEvtWeightFactorHelper.hh.

116 {
117 const JEvtWeightFactorHelper& helper = static_cast<const JEvtWeightFactorHelper&>(*this);
118
119 return (helper && helper->is_valid());
120 }
JEvtWeightFactorHelper()
Default constructor.

◆ operator()() [2/2]

double JAANET::JEvtWeightFactorHelper::operator() ( const Evt & evt) const
inlineinherited

Get weight-factor of given event.

Parameters
evtevent
Returns
event-weight factor

Definition at line 143 of file JEvtWeightFactorHelper.hh.

144 {
145 return getFactor(evt);
146 }

◆ getProperties() [1/2]

JProperties JAANET::JEvtWeightFactorHelper::getProperties ( const JEquationParameters & eqpars = JEvtWeightFactor::getEquationParameters())
inlineinherited

Get properties of this class.

Parameters
eqparsequation parameters

Definition at line 154 of file JEvtWeightFactorHelper.hh.

155 {
156 return getFactor().getProperties(eqpars);
157 }
virtual JProperties getProperties(const JEquationParameters &eqpars=JEvtWeightFactor::getEquationParameters())
Get properties of this class.

◆ getProperties() [2/2]

JProperties JAANET::JEvtWeightFactorHelper::getProperties ( const JEquationParameters & eqpars = JEvtWeightFactor::getEquationParameters()) const
inlineinherited

Get properties of this class.

Parameters
eqparsequation parameters

Definition at line 165 of file JEvtWeightFactorHelper.hh.

166 {
167 return getFactor().getProperties(eqpars);
168 }

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