Jpp  19.1.0
the software that should make you happy
Public Types | Public Member Functions | Private Attributes | List of all members
JAANET::JConstantFlux Struct Referencefinal

Function object for constant fluxes. More...

#include <JConstantFlux.hh>

Inheritance diagram for JAANET::JConstantFlux:
JAANET::JEvtWeightFactorConstant< JFlux > JLANG::JComparable< JFirst_t, JSecond_t > JLANG::JClonable< JClonable_t, JDerived_t >

Public Types

typedef JEvtWeightFactorConstant< JFluxJEvtWeightFactorConstant_t
 
typedef JClonable< JClonable_t >::clone_type clone_type
 

Public Member Functions

 JConstantFlux ()
 Default constructor. More...
 
 JConstantFlux (const double flux)
 Constructor. More...
 
bool is_valid () const override final
 Check whether this constant event-weight factor is valid. More...
 
double getFactor (const Evt &evt) const override final
 Get event-weight factor of given event. More...
 
bool less (const JEvtWeightFactorConstant_t &object) const
 Check if this event-weight constant is less than given event-weight constant. More...
 
JProperties getProperties (const JEquationParameters &eqpars=JEvtWeightFactor::getEquationParameters()) override final
 Get properties of this class. More...
 
JProperties getProperties (const JEquationParameters &eqpars=JEvtWeightFactor::getEquationParameters()) const override final
 Get properties of this class. More...
 
std::istream & read (std::istream &in) override final
 Stream input. More...
 
std::ostream & write (std::ostream &out) const override final
 Write event-weight factor to output. More...
 
virtual clone_type clone () const override
 Get clone of this object. More...
 

Private Attributes

double constant
 constant value More...
 

Detailed Description

Function object for constant fluxes.

Definition at line 21 of file JConstantFlux.hh.

Member Typedef Documentation

◆ JEvtWeightFactorConstant_t

Definition at line 38 of file JEvtWeightFactorConstant.hh.

◆ clone_type

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

◆ JConstantFlux() [1/2]

JAANET::JConstantFlux::JConstantFlux ( )
inline

Default constructor.

Definition at line 27 of file JConstantFlux.hh.

27  :
29  {}

◆ JConstantFlux() [2/2]

JAANET::JConstantFlux::JConstantFlux ( const double  flux)
inline

Constructor.

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

Definition at line 37 of file JConstantFlux.hh.

37  :
39  {}
Neutrino flux.
Definition: JHead.hh:906

Member Function Documentation

◆ is_valid()

bool JAANET::JEvtWeightFactorConstant< JFlux >::is_valid ( ) const
inlinefinaloverrideinherited

Check whether this constant event-weight factor is valid.

Returns
true if valid; else false

Definition at line 66 of file JEvtWeightFactorConstant.hh.

67  {
68  return constant > 0.0;
69  }

◆ getFactor()

double JAANET::JEvtWeightFactorConstant< JFlux >::getFactor ( const Evt evt) const
inlinefinaloverrideinherited

Get event-weight factor of given event.

Parameters
evtevent
Returns
event-weight factor

Definition at line 78 of file JEvtWeightFactorConstant.hh.

79  {
80  return constant;
81  }

◆ less()

bool JAANET::JEvtWeightFactorConstant< JFlux >::less ( const JEvtWeightFactorConstant_t object) const
inlineinherited

Check if this event-weight constant is less than given event-weight constant.

Parameters
objectevent-weight constant
Returns
true if this event-weight constant is less than given event-weight constant; else false

Definition at line 90 of file JEvtWeightFactorConstant.hh.

91  {
92  return this->constant < object.constant;
93  }

◆ getProperties() [1/2]

JProperties JAANET::JEvtWeightFactorConstant< JFlux >::getProperties ( const JEquationParameters eqpars = JEvtWeightFactor::getEquationParameters())
inlinefinaloverrideinherited

Get properties of this class.

Parameters
eqparsequation parameters

Definition at line 101 of file JEvtWeightFactorConstant.hh.

102  {
103  return JEvtWeightFactorConstantHelper(*this, eqpars);
104  }

◆ getProperties() [2/2]

JProperties JAANET::JEvtWeightFactorConstant< JFlux >::getProperties ( const JEquationParameters eqpars = JEvtWeightFactor::getEquationParameters()) const
inlinefinaloverrideinherited

Get properties of this class.

Parameters
eqparsequation parameters

Definition at line 112 of file JEvtWeightFactorConstant.hh.

113  {
114  return JEvtWeightFactorConstantHelper(*this, eqpars);
115  }

◆ read()

std::istream& JAANET::JEvtWeightFactorConstant< JFlux >::read ( std::istream &  in)
inlinefinaloverrideinherited

Stream input.

Parameters
ininput stream
Returns
input stream

Definition at line 124 of file JEvtWeightFactorConstant.hh.

125  {
126  using namespace std;
127 
128  streampos pos = in.tellg();
129 
130  if (!(in >> constant)) {
131 
132  in.clear();
133  in.seekg(pos);
134 
135  JProperties properties = getProperties();
136 
137  in >> properties;
138  }
139 
140  this->check_validity();
141 
142  return in;
143  }
Utility class to parse parameter values.
Definition: JProperties.hh:501
Definition: JSTDTypes.hh:14
JProperties getProperties(const JEquationParameters &eqpars=JEvtWeightFactor::getEquationParameters()) override final
Get properties of this class.

◆ write()

std::ostream& JAANET::JEvtWeightFactorConstant< JFlux >::write ( std::ostream &  out) const
inlinefinaloverrideinherited

Write event-weight factor to output.

Parameters
outoutput stream
Returns
output stream

Definition at line 152 of file JEvtWeightFactorConstant.hh.

153  {
154  using namespace JPP;
155 
156  return out << FIXED(10,3) << constant;
157  }
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary data structure for floating point format specification.
Definition: JManip.hh:448

◆ clone()

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

Member Data Documentation

◆ constant

double JAANET::JEvtWeightFactorConstant< JFlux >::constant
privateinherited

constant value

Definition at line 186 of file JEvtWeightFactorConstant.hh.


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