84int main(
int argc,
char **argv)
99 JAbstractHistogram_t X;
105 JParser<> zap(
"Example program to histogram neutrino effective mass and trigger effifiency for triggered events with offline files. Visible energy will be computed inside the user cylinder.");
111 zap[
'm'] =
make_field(margin,
"Margin around the volume in which the considered events must reside")
113 zap[
'e'] =
make_field(epsilon,
"Minimal amount of visible energy assigned to events") = 1e-8;
114 zap[
'X'] =
make_field(logx,
"Use logarithm of energy");
116 = JAbstractHistogram_t(100, 1.0, 100.0);
117 zap[
'C'] =
make_field(cylinder,
"User cylinder");
118 zap[
'O'] =
make_field(option,
"Result option")
125 catch(
const exception &error) {
126 FATAL(error.what() << endl);
137 double Xmin = numeric_limits<double>::max();
138 double Xmax = numeric_limits<double>::lowest();
143 Xmin = X.getLowerLimit();
144 Xmax = X.getUpperLimit();
167 can.addMargin(margin);
169 NOTICE(
"Cylinder, including margin: " <<
can << endl);
178 NOTICE(
"Scanning file type " << scanner->getName() <<
": " << endl << header << endl);
184 STATUS(
"event: " << setw(10) << in.getCounter() <<
'\r');
DEBUG(endl);
186 Evt*
event = in.next();
189 WARNING(endl <<
"Could not find primary for the following event:" << endl << *event << endl);
206 double EvisHad = Evis - EvisLL;
208 if (Evis == 0) Evis = epsilon;
209 if (EvisLL == 0) EvisLL = epsilon;
210 if (EvisHad == 0) EvisHad = epsilon;
213 const double x1 = logx ? log10(Evis) : Evis;
214 const double x2 = logx ? log10(EvisLL) : EvisLL;
215 const double x3 = logx ? log10(EvisHad) : EvisHad;
220 hnT0[interactionID0]->Fill(x0);
221 hnT1[interactionID0]->Fill(x1);
222 hnT2[interactionID0]->Fill(x2);
223 hnT3[interactionID0]->Fill(x3);
225 hnT0[interactionID1]->Fill(x0);
226 hnT1[interactionID1]->Fill(x1);
227 hnT2[interactionID1]->Fill(x2);
228 hnT3[interactionID1]->Fill(x3);
230 if (
can.is_inside(vertex)) {
231 hNM0[interactionID0]->Fill(x0);
232 hNM1[interactionID0]->Fill(x1);
233 hNM2[interactionID0]->Fill(x2);
234 hNM3[interactionID0]->Fill(x3);
236 hNM0[interactionID1]->Fill(x0);
237 hNM1[interactionID1]->Fill(x1);
238 hNM2[interactionID1]->Fill(x2);
239 hNM3[interactionID1]->Fill(x3);
246 hnT0[interactionID2]->Fill(x0);
247 hnT1[interactionID2]->Fill(x1);
248 hnT2[interactionID2]->Fill(x2);
249 hnT3[interactionID2]->Fill(x3);
251 hnT0[interactionID3]->Fill(x0);
252 hnT1[interactionID3]->Fill(x1);
253 hnT2[interactionID3]->Fill(x2);
254 hnT3[interactionID3]->Fill(x3);
256 if(
can.is_inside(vertex)){
257 hNM0[interactionID2]->Fill(x0);
258 hNM1[interactionID2]->Fill(x1);
259 hNM2[interactionID2]->Fill(x2);
260 hNM3[interactionID2]->Fill(x3);
262 hNM0[interactionID3]->Fill(x0);
263 hNM1[interactionID3]->Fill(x1);
264 hNM2[interactionID3]->Fill(x2);
265 hNM3[interactionID3]->Fill(x3);
282 NOTICE(
"Scanning file type " << scanner->getName() <<
": " << endl << header << endl);
286 STATUS(
"event: " << setw(10) << in.getCounter() <<
'\r');
DEBUG(endl);
288 Evt*
event = in.next();
291 WARNING(endl <<
"Could not find primary for the following event:" << endl << *event << endl);
305 double EvisHad = Evis - EvisLL;
307 if (Evis == 0) Evis = epsilon;
308 if (EvisLL == 0) EvisLL = epsilon;
309 if (EvisHad == 0) EvisHad = epsilon;
312 const double x1 = logx ? log10(Evis) : Evis;
313 const double x2 = logx ? log10(EvisLL) : EvisLL;
314 const double x3 = logx ? log10(EvisHad) : EvisHad;
319 hM0[interactionID0]->Fill(x0);
320 hM1[interactionID0]->Fill(x1);
321 hM2[interactionID0]->Fill(x2);
322 hM3[interactionID0]->Fill(x3);
324 hM0[interactionID1]->Fill(x0);
325 hM1[interactionID1]->Fill(x1);
326 hM2[interactionID1]->Fill(x2);
327 hM3[interactionID1]->Fill(x3);
334 hM0[interactionID2]->Fill(x0);
335 hM1[interactionID2]->Fill(x1);
336 hM2[interactionID2]->Fill(x2);
337 hM3[interactionID2]->Fill(x3);
339 hM0[interactionID3]->Fill(x0);
340 hM1[interactionID3]->Fill(x1);
341 hM2[interactionID3]->Fill(x2);
342 hM3[interactionID3]->Fill(x3);
354 if (option == Mass_t) {
356 }
else if (option == Volume_t) {
362 hT0.insert(make_pair(type, (TH1D*) divide(*hM0[type], *hnT0[type],
MAKE_STRING(
"hT0[" << type <<
"]"))));
363 hT1.insert(make_pair(type, (TH1D*) divide(*hM1[type], *hnT1[type],
MAKE_STRING(
"hT1[" << type <<
"]"))));
364 hT2.insert(make_pair(type, (TH1D*) divide(*hM2[type], *hnT2[type],
MAKE_STRING(
"hT2[" << type <<
"]"))));
365 hT3.insert(make_pair(type, (TH1D*) divide(*hM3[type], *hnT3[type],
MAKE_STRING(
"hT3[" << type <<
"]"))));
368 hM0[type]->Scale(
scale);
369 hM1[type]->Scale(
scale);
370 hM2[type]->Scale(
scale);
371 hM3[type]->Scale(
scale);
373 hM0[type]->Divide(hNM0[type]);
374 hM1[type]->Divide(hNM1[type]);
375 hM2[type]->Divide(hNM2[type]);
376 hM3[type]->Divide(hNM3[type]);
382 out << hM0 << hM1 << hM2 << hM3 << hT0 << hT1 << hT2 << hT3;
387 FATAL(error << endl);
Definition of particle types.