Jpp 19.3.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 JEvtWeightFactorat (const int identifier) const
 Look-up function.
 
const JEvtWeightFactoroperator[] (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 33 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 41 of file JEvtWeightFactorDictionary.hh.

41 {
42 CUSTOM_FACTORS_BEGIN = 100, //!< Start of custom event-weight factors
43
44 CONSTANT = 101, //!< Constant event-weight factor
45 MUPAGE_TFORMULA = 102, //!< MUPAGE TFormula-based event-weight factor
46 GSEAGEN_TFORMULA = 103, //!< gSeaGen TFormula-based event-weight factor
47 MEFF_RATIO = 104, //!< Effective mass ratio
48
49 CUSTOM_FACTORS_END = 199 //!< End of custom event-weight factors
50 };
@ 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 58 of file JEvtWeightFactorDictionary.hh.

59 {
60 using namespace std;
61
62 const JFluxDictionary fluxdict(oscProb);
63
64 for (JFluxDictionary::const_iterator i = fluxdict.cbegin(); i != fluxdict.cend(); ++i) {
65 this->insert(*i);
66 }
67
68 this->insert(make_pair(CONSTANT, make_shared<JEvtWeightFactorConstant<JEvtWeightFactor> >()));
69 this->insert(make_pair(MUPAGE_TFORMULA, make_shared<JEvtWeightFactorMupage>()));
70 this->insert(make_pair(GSEAGEN_TFORMULA, make_shared<JEvtWeightFactorGSeaGen>()));
71 this->insert(make_pair(MEFF_RATIO, make_shared<JEvtWeightFactorTriggerEfficiencyRatio>()));
72 }

◆ JEvtWeightFactorDictionary() [2/2]

JAANET::JEvtWeightFactorDictionary::JEvtWeightFactorDictionary ( )
inline

Default constructor.

Definition at line 78 of file JEvtWeightFactorDictionary.hh.

78 :
79 JEvtWeightFactorDictionary(JOscProbHelper())
80 {}

Member Function Documentation

◆ at()

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

Look-up function.

Parameters
identifierflux category ID

Definition at line 88 of file JEvtWeightFactorDictionary.hh.

89 {
90 using namespace std;
91 using namespace JPP;
92
93 const_iterator i = this->find(identifier);
94
95 if (i != this->cend()) {
96 return *(i->second);
97 } else {
98 THROW(JValueOutOfRange, "JEvtWeightFactorDictionary::at(): Invalid identifier " << identifier);
99 }
100 }
#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 108 of file JEvtWeightFactorDictionary.hh.

109 {
110 return this->at(identifier);
111 }
const JEvtWeightFactor & at(const int identifier) const
Look-up function.

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