Jpp 19.3.0
the software that should make you happy
Loading...
Searching...
No Matches
JAANET::JFluxDictionary Class Reference

Dictionary to map distinct flux function categories to unique identifiers. More...

#include <JFluxDictionary.hh>

Inheritance diagram for JAANET::JFluxDictionary:
std::map< int, JFluxHelper >

Public Types

enum  fluxes {
  FLUX_FUNCTIONS_BEGIN = 0 , FLAT_FLUX = 1 , POWER_LAW_FLUX = 2 , ATMOSPHERIC_NEUTRINO_FLUX = 3 ,
  HONDA_FLUX = 4 , FLUX_FUNCTIONS_END = 99
}
 Indices of flux factors in flux factor dictionary. More...
 

Public Member Functions

 JFluxDictionary (const JOscProbHelper &oscProb)
 Constructor.
 
 JFluxDictionary ()
 Default constructor.
 
const JFluxat (const int identifier) const
 Look-up function.
 
const JFluxoperator[] (const int identifier) const
 Look-up operator.
 

Private Attributes

JOscProbHelper oscProb
 Oscillation probability calculator.
 

Detailed Description

Dictionary to map distinct flux function categories to unique identifiers.

The identifiers are provided by the enum fluxes.

Definition at line 31 of file JFluxDictionary.hh.

Member Enumeration Documentation

◆ fluxes

Indices of flux factors in flux factor dictionary.

Enumerator
FLUX_FUNCTIONS_BEGIN 

Start of flux functions.

FLAT_FLUX 

Flat flux.

POWER_LAW_FLUX 

Power-law flux.

ATMOSPHERIC_NEUTRINO_FLUX 

Atmospheric neutrino flux (c.f. Flux_Atmospheric in <jpp>/externals/flux/Flux.hh)

HONDA_FLUX 

Interpolated azimuth-averaged Honda flux.

FLUX_FUNCTIONS_END 

End of flux functions.

Definition at line 39 of file JFluxDictionary.hh.

39 {
40 FLUX_FUNCTIONS_BEGIN = 0, //!< Start of flux functions
41
42 FLAT_FLUX = 1, //!< Flat flux
43 POWER_LAW_FLUX = 2, //!< Power-law flux
44 ATMOSPHERIC_NEUTRINO_FLUX = 3, //!< Atmospheric neutrino flux (c.f. `Flux_Atmospheric` in `<jpp>/externals/flux/Flux.hh`)
45 HONDA_FLUX = 4, //!< Interpolated azimuth-averaged Honda flux
46
47 FLUX_FUNCTIONS_END = 99 //!< End of flux functions
48 };
@ HONDA_FLUX
Interpolated azimuth-averaged Honda flux.
@ FLUX_FUNCTIONS_END
End of flux functions.
@ POWER_LAW_FLUX
Power-law flux.
@ ATMOSPHERIC_NEUTRINO_FLUX
Atmospheric neutrino flux (c.f. Flux_Atmospheric in <jpp>/externals/flux/Flux.hh)
@ FLUX_FUNCTIONS_BEGIN
Start of flux functions.

Constructor & Destructor Documentation

◆ JFluxDictionary() [1/2]

JAANET::JFluxDictionary::JFluxDictionary ( const JOscProbHelper & oscProb)
inline

Constructor.

Parameters
oscProboscillation probability calculator

Definition at line 56 of file JFluxDictionary.hh.

56 :
58 {
59 using namespace std;
60
61 const JHondaFluxInterpolator2D<> interpolator;
62
63 this->insert(make_pair(FLAT_FLUX, make_shared<JConstantFlux>()));
64 this->insert(make_pair(POWER_LAW_FLUX, make_shared<JPowerLawFlux>()));
65 this->insert(make_pair(ATMOSPHERIC_NEUTRINO_FLUX, make_shared<JAtmosphericNeutrinoFlux>(oscProb)));
66 this->insert(make_pair(HONDA_FLUX, make_shared<JOscFlux>(interpolator, oscProb)));
67 }
JOscProbHelper oscProb
Oscillation probability calculator.
JHondaFluxInterpolator< JConstantFunction1D< double, JArray< 4, double > >, JCoszFunctionalMap_t, JEnergyFunctionalMap_t > JHondaFluxInterpolator2D
Alias template definition for 2-dimensional Honda flux interpolator.

◆ JFluxDictionary() [2/2]

JAANET::JFluxDictionary::JFluxDictionary ( )
inline

Default constructor.

Definition at line 73 of file JFluxDictionary.hh.

73 :
74 JFluxDictionary(JOscProbHelper())
75 {}
JFluxDictionary()
Default constructor.

Member Function Documentation

◆ at()

const JFlux & JAANET::JFluxDictionary::at ( const int identifier) const
inline

Look-up function.

Parameters
identifierflux category ID

Definition at line 83 of file JFluxDictionary.hh.

84 {
85 using namespace std;
86 using namespace JPP;
87
88 const_iterator i = this->find(identifier);
89
90 if (i != this->cend()) {
91 return i->second.getFlux();
92 } else {
93 THROW(JValueOutOfRange, "JFluxDictionary::at(): Invalid identifier " << identifier);
94 }
95 }
#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).

◆ operator[]()

const JFlux & JAANET::JFluxDictionary::operator[] ( const int identifier) const
inline

Look-up operator.

Parameters
identifierflux category ID

Definition at line 103 of file JFluxDictionary.hh.

104 {
105 return this->at(identifier);
106 }
const JFlux & at(const int identifier) const
Look-up function.

Member Data Documentation

◆ oscProb

JOscProbHelper JAANET::JFluxDictionary::oscProb
private

Oscillation probability calculator.

Definition at line 111 of file JFluxDictionary.hh.


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