27{
30
34
35
37
39
41
42 try {
43
45
49
51 }
52 catch(const exception& error) {
54 }
55
56
58
60
61 const bool logE = properties.
getValue<
bool>(
"logE");
62 const int option = properties.
getValue<
int> (
"option");
63
65
66 const int Nbins = hTE.GetNbinsX();
67
68 if (option != (int) JEvtWeightFactorTriggerEfficiencyRatio::EVIS_LEADING_LEPTON_CONTR &&
69 option != (
int) JEvtWeightFactorTriggerEfficiencyRatio::EVIS_HADRONIC_CONTR) {
70
72
73 switch (option) {
74 case (int) JEvtWeightFactorTriggerEfficiencyRatio::ENERGY_INITIAL_STATE :
75 mfp = &JEvtWeightFactorTriggerEfficiencyRatio::getTriggerEfficiencyRatio1;
76 break;
77 case (int) JEvtWeightFactorTriggerEfficiencyRatio::ENERGY_NEUTRINO:
78 mfp = &JEvtWeightFactorTriggerEfficiencyRatio::getTriggerEfficiencyRatio2;
79 break;
80 case (int) JEvtWeightFactorTriggerEfficiencyRatio::EVIS:
81 mfp = &JEvtWeightFactorTriggerEfficiencyRatio::getTriggerEfficiencyRatio3;
82 break;
83 default:
84 FATAL(
"Invalid 1D option " << option);
85 }
86
88 g.SetName(hTE.GetName());
89
91
92 const double x = hTE.GetBinCenter(i+1);
93 const double y = (factor.*mfp)(logE ?
pow(10.0, x) :
x);
94
96 g.SetPoint(i, x, y);
97 } else {
99 }
100 }
101
102 g.Write();
103
104 } else {
105
107
108 switch (option) {
109 case (int) JEvtWeightFactorTriggerEfficiencyRatio::EVIS_LEADING_LEPTON_CONTR:
110 mfp = &JEvtWeightFactorTriggerEfficiencyRatio::getTriggerEfficiencyRatio4;
111 break;
112 case (int) JEvtWeightFactorTriggerEfficiencyRatio::EVIS_HADRONIC_CONTR:
113 mfp = &JEvtWeightFactorTriggerEfficiencyRatio::getTriggerEfficiencyRatio5;
114 break;
115 default:
116 FATAL(
"Invalid 2D option " << option);
117 }
118
120
121 TGraph2D g(N);
122 g.SetName(hTE.GetName());
123
125
127
128 const double x = hTE.GetBinCenter(i+1);
129
130 for (
Int_t j = 0;
j < i; ++
j, ++k) {
131
132 const double y = hTE.GetBinCenter(j+1);
133 const double z = (logE ?
134 (factor.*mfp)(
pow(10.0, x),
pow(10.0, y)) :
135 (factor.*mfp)(
x,
y));
136
137 g.SetPoint(k, x, y, z);
138 }
139 }
140
141 g.Write();
142 }
143
144 out.Write();
145 out.Close();
146
147 return 0;
148}
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Utility class to parse parameter values.
const T & getValue(const std::string &key) const
Get value.
Template definition of a multi-dimensional oscillation probability interpolation table.
Utility class to parse command line options.
T pow(const T &x, const double y)
Power .
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Implementation of reweighting factor for trigger efficiency ratios.
JProperties getProperties(const JEquationParameters &eqpars=JEvtWeightFactor::getEquationParameters()) override final
Get properties of this class.
const TH1 & getHistogram() const
Retrieve trigger efficiency histogram.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Auxiliary data structure for floating point format specification.