27{
30
33 const double) const;
34
35
37
39
41
42 try {
43
45
49
50 zap(argc, argv);
51 }
52 catch(const exception& error) {
53 FATAL(error.what() << endl);
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 = hMeff.GetNbinsX();
67
68 if (option != (int) JEvtWeightFactorMeffRatio::EVIS_LEADING_LEPTON_CONTR &&
69 option != (int) JEvtWeightFactorMeffRatio::EVIS_HADRONIC_CONTR) {
70
71 pFunction1D mfp;
72
73 switch (option) {
74 case (int) JEvtWeightFactorMeffRatio::ENERGY_INITIAL_STATE :
75 mfp = &JEvtWeightFactorMeffRatio::getMeffRatio1;
76 break;
77 case (int) JEvtWeightFactorMeffRatio::ENERGY_NEUTRINO:
78 mfp = &JEvtWeightFactorMeffRatio::getMeffRatio2;
79 break;
80 case (int) JEvtWeightFactorMeffRatio::EVIS:
81 mfp = &JEvtWeightFactorMeffRatio::getMeffRatio3;
82 break;
83 default:
85 }
86
87 TGraph g(Nbins);
88 g.SetName(hMeff.GetName());
89
90 for (Int_t i = 0; i < Nbins; ++i) {
91
92 const double x = hMeff.GetBinCenter(i+1);
93 const double y = (factor.*mfp)(logE ?
pow(10.0, x) : x);
94
95 if (isfinite(y)) {
96 g.SetPoint(i, x, y);
97 } else {
99 }
100 }
101
102 g.Write();
103
104 } else {
105
106 pFunction2D mfp;
107
108 switch (option) {
109 case (int) JEvtWeightFactorMeffRatio::EVIS_LEADING_LEPTON_CONTR:
110 mfp = &JEvtWeightFactorMeffRatio::getMeffRatio4;
111 break;
112 case (int) JEvtWeightFactorMeffRatio::EVIS_HADRONIC_CONTR:
113 mfp = &JEvtWeightFactorMeffRatio::getMeffRatio5;
114 break;
115 default:
117 }
118
119 const Int_t N = Nbins * Nbins * (Nbins + 1) / 2;
120
121 TGraph2D g(N);
122 g.SetName(hMeff.GetName());
123
124 Int_t k = 0;
125
126 for (Int_t i = 0; i < Nbins; ++i) {
127
128 const double x = hMeff.GetBinCenter(i+1);
129
130 for (Int_t j = 0;
j < i; ++
j, ++k) {
131
132 const double y = hMeff.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 THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
#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.
Exception for accessing a value in a collection that is outside of its range.
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 effective mass ratios.
JProperties getProperties(const JEquationParameters &eqpars=JEvtWeightFactor::getEquationParameters()) override final
Get properties of this class.
const TH1 & getHistogram() const
Retrieve effective mass 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.