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

Dictionary to map distinct event-weight factors to unique identifiers. More...

#include <JEvtWeightFactorDictionary.hh>

Inheritance diagram for JAANET::JEvtWeightFactorDictionary:
std::map< int, JEvtWeightFactorHelper >

Public Types

enum  factors {
  CUSTOM_FACTORS_BEGIN = 100 , CONSTANT = 101 , MUPAGE_TFORMULA = 102 , GSEAGEN_TFORMULA = 103 ,
  MEFF_RATIO = 104 , CUSTOM_FACTORS_END = 199
}
 Indices of event-weight factors in event-weight factor dictionary. More...
 

Public Member Functions

 JEvtWeightFactorDictionary (const JOscProbHelper &oscProb)
 Default constructor.
 
 JEvtWeightFactorDictionary ()
 Default constructor.
 
const JEvtWeightFactor & at (const int identifier) const
 Look-up function.
 
const JEvtWeightFactor & operator[] (const int identifier) const
 Look-up operator.
 

Detailed Description

Dictionary to map distinct event-weight factors to unique identifiers.

The identifiers are provided by the enum factors.

Definition at line 37 of file JEvtWeightFactorDictionary.hh.

Member Enumeration Documentation

◆ factors

Indices of event-weight factors in event-weight factor dictionary.

Enumerator
CUSTOM_FACTORS_BEGIN 

Start of custom event-weight factors.

CONSTANT 

Constant event-weight factor.

MUPAGE_TFORMULA 

MUPAGE TFormula-based event-weight factor.

GSEAGEN_TFORMULA 

gSeaGen TFormula-based event-weight factor

MEFF_RATIO 

Effective mass ratio.

CUSTOM_FACTORS_END 

End of custom event-weight factors.

Definition at line 45 of file JEvtWeightFactorDictionary.hh.

45 {
46 CUSTOM_FACTORS_BEGIN = 100, //!< Start of custom event-weight factors
47
48 CONSTANT = 101, //!< Constant event-weight factor
49 MUPAGE_TFORMULA = 102, //!< MUPAGE TFormula-based event-weight factor
50 GSEAGEN_TFORMULA = 103, //!< gSeaGen TFormula-based event-weight factor
51 MEFF_RATIO = 104, //!< Effective mass ratio
52#ifdef HAVE_LOOPTOOLS
53 RADIATIVE_CORRECTIONS = 105, //!< Radiative correction
54#endif
55
56 CUSTOM_FACTORS_END = 199 //!< End of custom event-weight factors
57 };
@ CUSTOM_FACTORS_BEGIN
Start of custom event-weight factors.
@ CUSTOM_FACTORS_END
End of custom event-weight factors.
@ MUPAGE_TFORMULA
MUPAGE TFormula-based event-weight factor.
@ GSEAGEN_TFORMULA
gSeaGen TFormula-based event-weight factor

Constructor & Destructor Documentation

◆ JEvtWeightFactorDictionary() [1/2]

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

Default constructor.

Parameters
oscProboscillation probability interface

Definition at line 65 of file JEvtWeightFactorDictionary.hh.

66 {
67 using namespace std;
68
69 const JFluxDictionary fluxdict(oscProb);
70
71 for (JFluxDictionary::const_iterator i = fluxdict.cbegin(); i != fluxdict.cend(); ++i) {
72 this->insert(*i);
73 }
74
75 this->insert(make_pair(CONSTANT, make_shared<JEvtWeightFactorConstant<JEvtWeightFactor> >()));
76 this->insert(make_pair(MUPAGE_TFORMULA, make_shared<JEvtWeightFactorMupage>()));
77 this->insert(make_pair(GSEAGEN_TFORMULA, make_shared<JEvtWeightFactorGSeaGen>()));
78 this->insert(make_pair(MEFF_RATIO, make_shared<JEvtWeightFactorTriggerEfficiencyRatio>()));
79#ifdef HAVE_LOOPTOOLS
80 this->insert(make_pair(RADIATIVE_CORRECTIONS, make_shared<JEvtWeightFactorRadiativeCorrections<JEvtWeightFactor> >()));
81#endif
82 }

◆ JEvtWeightFactorDictionary() [2/2]

JAANET::JEvtWeightFactorDictionary::JEvtWeightFactorDictionary ( )
inline

Default constructor.

Definition at line 88 of file JEvtWeightFactorDictionary.hh.

88 :
89 JEvtWeightFactorDictionary(JOscProbHelper())
90 {}

Member Function Documentation

◆ at()

const JEvtWeightFactor & JAANET::JEvtWeightFactorDictionary::at ( const int identifier) const
inline

Look-up function.

Parameters
identifierflux category ID

Definition at line 98 of file JEvtWeightFactorDictionary.hh.

99 {
100 using namespace std;
101 using namespace JPP;
102
103 const_iterator i = this->find(identifier);
104
105 if (i != this->cend()) {
106 return *(i->second);
107 } else {
108 THROW(JValueOutOfRange, "JEvtWeightFactorDictionary::at(): Invalid identifier " << identifier);
109 }
110 }
#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 JEvtWeightFactor & JAANET::JEvtWeightFactorDictionary::operator[] ( const int identifier) const
inline

Look-up operator.

Parameters
identifierflux category ID

Definition at line 118 of file JEvtWeightFactorDictionary.hh.

119 {
120 return this->at(identifier);
121 }
const JEvtWeightFactor & at(const int identifier) const
Look-up function.

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