Jpp 21.0.0
the software that should make you happy
Loading...
Searching...
No Matches
JEvtWeightFactorDictionary.hh
Go to the documentation of this file.
1#ifndef __JAANET__JEVTWEIGHTFACTORDICTIONARY__
2#define __JAANET__JEVTWEIGHTFACTORDICTIONARY__
3
4#include <map>
5
10
11#ifdef HAVE_LOOPTOOLS
13#endif
14
16
18
20
21
22/**
23 * \author bjung
24 */
25namespace JAANET {}
26namespace JPP { using namespace JAANET; }
27
28namespace JAANET {
29
31
32
33 /**
34 * Dictionary to map distinct event-weight factors to unique identifiers.
35 * The identifiers are provided by the enum `factors`.
36 */
38 public std::map<int, JEvtWeightFactorHelper>
39 {
40 public:
41
42 /**
43 * Indices of event-weight factors in event-weight factor dictionary.
44 */
45 enum factors {
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 };
58
59
60 /**
61 * Default constructor.
62 *
63 * \param oscProb oscillation probability interface
64 */
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 }
83
84
85 /**
86 * Default constructor.
87 */
91
92
93 /**
94 * Look-up function.
95 *
96 * \param identifier flux category ID
97 */
98 const JEvtWeightFactor& at(const int identifier) const
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 }
111
112
113 /**
114 * Look-up operator.
115 *
116 * \param identifier flux category ID
117 */
118 const JEvtWeightFactor& operator[](const int identifier) const
119 {
120 return this->at(identifier);
121 }
122 };
123}
124
125#endif
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Dictionary to map distinct event-weight factors to unique identifiers.
JEvtWeightFactorDictionary(const JOscProbHelper &oscProb)
Default constructor.
const JEvtWeightFactor & at(const int identifier) const
Look-up function.
const JEvtWeightFactor & operator[](const int identifier) const
Look-up operator.
factors
Indices of event-weight factors in event-weight factor dictionary.
@ 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
Dictionary to map distinct flux function categories to unique identifiers.
Exception for accessing a value in a collection that is outside of its range.
Extensions to Evt data format.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Class for constant event-weight factors.
Class for radiative corrections to the neutrino CC-DIS weights, based on references:
Abstract base class for specifiable event-weight factors.
Helper class for oscillation probability calculators.