Jpp 21.0.0
the software that should make you happy
Loading...
Searching...
No Matches
JAANET::JFlux Struct Referenceabstract

Low-level interface for retrieving the flux corresponding to a given event. More...

#include <JFlux.hh>

Inheritance diagram for JAANET::JFlux:
JAANET::JEvtWeightFactor JLANG::JClonable< JClonable_t, JDerived_t > JAANET::JDiffuseFlux

Public Types

typedef JClonable< JClonable_t >::clone_type clone_type
 

Public Member Functions

virtual ~JFlux ()
 Virtual destructor.
 
double getFlux (const Evt &evt) const
 Get flux of given event.
 
virtual double getFactor (const Evt &evt) const =0
 Get event-weight factor of given event.
 
double operator() (const Evt &evt) const
 Get event-weight factor of given event.
 
virtual bool is_valid () const
 Check whether this event-weight factor is valid.
 
void check_validity () const
 Check validity of this event-weight factor.
 
virtual JProperties getProperties (const JEquationParameters &eqpars=JEvtWeightFactor::getEquationParameters())
 Get properties of this class.
 
virtual JProperties getProperties (const JEquationParameters &eqpars=JEvtWeightFactor::getEquationParameters()) const
 Get properties of this class.
 
virtual std::istream & read (std::istream &in)
 Read event-weight factor from input.
 
virtual std::ostream & write (std::ostream &out) const
 Write event-weight factor to output.
 
virtual clone_type clone () const override
 Get clone of this object.
 

Static Public Member Functions

static const char *const getTypeKey ()
 Get type keyword.
 
static JEquationParameters & getEquationParameters ()
 Get equation parameters.
 
static void setEquationParameters (const JEquationParameters &eqpars)
 Set equation parameters.
 

Detailed Description

Low-level interface for retrieving the flux corresponding to a given event.

Definition at line 21 of file JFlux.hh.

Member Typedef Documentation

◆ clone_type

template<class JClonable_t , class JDerived_t >
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

◆ ~JFlux()

virtual JAANET::JFlux::~JFlux ( )
inlinevirtual

Virtual destructor.

Definition at line 27 of file JFlux.hh.

28 {}

Member Function Documentation

◆ getFlux()

double JAANET::JFlux::getFlux ( const Evt & evt) const
inline

Get flux of given event.

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

Definition at line 37 of file JFlux.hh.

38 {
39 return getFactor(evt);
40 }
virtual double getFactor(const Evt &evt) const =0
Get event-weight factor of given event.

◆ getTypeKey()

static const char *const JAANET::JEvtWeightFactor::getTypeKey ( )
inlinestaticinherited

Get type keyword.

Returns
type keyword

Definition at line 43 of file JEvtWeightFactor.hh.

44 {
45 return "type";
46 }

◆ getFactor()

virtual double JAANET::JEvtWeightFactor::getFactor ( const Evt & evt) const
pure virtualinherited

Get event-weight factor of given event.

Parameters
evtevent
Returns
event-weight factor

Implemented in JAANET::JDiffuseFlux.

◆ operator()()

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

Get event-weight factor of given event.

Parameters
evtevent
Returns
event-weight factor

Definition at line 64 of file JEvtWeightFactor.hh.

65 {
66 return getFactor(evt);
67 }

◆ is_valid()

virtual bool JAANET::JEvtWeightFactor::is_valid ( ) const
inlinevirtualinherited

Check whether this event-weight factor is valid.

Returns
true if valid; else false

Reimplemented in JAANET::JEvtWeightFactorTFormula.

Definition at line 75 of file JEvtWeightFactor.hh.

76 {
77 return true;
78 }

◆ check_validity()

void JAANET::JEvtWeightFactor::check_validity ( ) const
inlineinherited

Check validity of this event-weight factor.

Definition at line 84 of file JEvtWeightFactor.hh.

85 {
86 using namespace JPP;
87
88 if (!is_valid()) {
89 THROW(JValueOutOfRange, "JEvtWeightFactor:check_validity(): Invalid event-weight factor " << *this);
90 }
91 }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Exception for accessing a value in a collection that is outside of its range.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
virtual bool is_valid() const
Check whether this event-weight factor is valid.

◆ getEquationParameters()

static JEquationParameters & JAANET::JEvtWeightFactor::getEquationParameters ( )
inlinestaticinherited

Get equation parameters.

Returns
equation parameters

Definition at line 99 of file JEvtWeightFactor.hh.

100 {
101 static JEquationParameters equation("=", ",\n\r,", "./", "#");
102
103 return equation;
104 }
Simple data structure to support I/O of equations (see class JLANG::JEquation).

◆ setEquationParameters()

static void JAANET::JEvtWeightFactor::setEquationParameters ( const JEquationParameters & eqpars)
inlinestaticinherited

Set equation parameters.

Parameters
eqparsequation parameters

Definition at line 112 of file JEvtWeightFactor.hh.

113 {
114 getEquationParameters() = eqpars;
115 }
static JEquationParameters & getEquationParameters()
Get equation parameters.

◆ getProperties() [1/2]

virtual JProperties JAANET::JEvtWeightFactor::getProperties ( const JEquationParameters & eqpars = JEvtWeightFactor::getEquationParameters())
inlinevirtualinherited

Get properties of this class.

Parameters
eqparsequation parameters

Reimplemented in JAANET::JEvtWeightFactorTFormula.

Definition at line 123 of file JEvtWeightFactor.hh.

124 {
125 return JProperties(eqpars,1);
126 }
Utility class to parse parameter values.

◆ getProperties() [2/2]

virtual JProperties JAANET::JEvtWeightFactor::getProperties ( const JEquationParameters & eqpars = JEvtWeightFactor::getEquationParameters()) const
inlinevirtualinherited

Get properties of this class.

Parameters
eqparsequation parameters

Reimplemented in JAANET::JEvtWeightFactorTFormula.

Definition at line 134 of file JEvtWeightFactor.hh.

135 {
136 return JProperties(eqpars,1);
137 }

◆ read()

virtual std::istream & JAANET::JEvtWeightFactor::read ( std::istream & in)
inlinevirtualinherited

Read event-weight factor from input.

Parameters
ininput stream
Returns
input stream

Reimplemented in JAANET::JEvtWeightFactorTFormula.

Definition at line 146 of file JEvtWeightFactor.hh.

147 {
148 using namespace std;
149 using namespace JPP;
150
151 JStringStream is(in);
152
153 JProperties properties = getProperties();
154 is >> properties;
155
157
158 return in;
159 }
Wrapper class around STL stringstream class to facilitate optional loading of data from file.
virtual JProperties getProperties(const JEquationParameters &eqpars=JEvtWeightFactor::getEquationParameters())
Get properties of this class.
void check_validity() const
Check validity of this event-weight factor.

◆ write()

virtual std::ostream & JAANET::JEvtWeightFactor::write ( std::ostream & out) const
inlinevirtualinherited

Write event-weight factor to output.

Parameters
outoutput stream
Returns
output stream

Definition at line 168 of file JEvtWeightFactor.hh.

169 {
170 return out << getProperties();
171 }

◆ clone()

template<class JClonable_t , class JDerived_t >
virtual clone_type JLANG::JClonable< JClonable_t, JDerived_t >::clone ( ) const
inlineoverridevirtualinherited

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