Jpp 20.0.0-27-g39925593c-D
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
12
14
16
17
18/**
19 * \author bjung
20 */
21namespace JAANET {}
22namespace JPP { using namespace JAANET; }
23
24namespace JAANET {
25
27
28
29 /**
30 * Dictionary to map distinct event-weight factors to unique identifiers.
31 * The identifiers are provided by the enum `factors`.
32 */
34 public std::map<int, JEvtWeightFactorHelper>
35 {
36 public:
37
38 /**
39 * Indices of event-weight factors in event-weight factor dictionary.
40 */
41 enum factors {
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 };
51
52
53 /**
54 * Default constructor.
55 *
56 * \param oscProb oscillation probability interface
57 */
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
72 }
73
74
75 /**
76 * Default constructor.
77 */
81
82
83 /**
84 * Look-up function.
85 *
86 * \param identifier flux category ID
87 */
88 const JEvtWeightFactor& at(const int identifier) const
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 }
101
102
103 /**
104 * Look-up operator.
105 *
106 * \param identifier flux category ID
107 */
108 const JEvtWeightFactor& operator[](const int identifier) const
109 {
110 return this->at(identifier);
111 }
112 };
113}
114
115#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.
Template definition of a multi-dimensional oscillation probability interpolation table.
Extensions to Evt data format.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Abstract base class for specifiable event-weight factors.
Helper class for oscillation probability calculators.