31{
35
38 JLimit& numberOfEvents = inputFile.getLimit();
39 bool logx;
42
43 try {
44
45 JParser<> zap(
"Example program to histogram neutrino effective volume for triggered events."\
46 "\nFor genie/gSeaGen events, use application JEffectiveMass1D.");
47
51 zap[
'X'] =
make_field(logx,
"Use logarithm of energy");
54
55 zap(argc, argv);
56 }
57 catch(const exception &error) {
58 FATAL(error.what() << endl);
59 }
60
62
63 try {
65 }
68 }
69
70 const JHead buffer(head);
71
73 FATAL(
"Use JEffectiveMass1D" << endl);
74 }
75
76 const JVolume volume(head, logx);
77
79
80 TH1D hV(
"hV",
"effective volume in km^3",
numberOfBins, volume.getXmin(), volume.getXmax());
81
82 hV.Sumw2();
83
85
87
89
90 const Evt*
event = ps;
91
93
95 const double E = neutrino.
E;
96
97 hV.Fill(volume.getX(E), volume.getW(hV.GetXaxis(), E));
98 }
99 else {
100 WARNING(
"JVolume1D: cannot find neutrino in triggered event " << inputFile.
getCounter() );
101 }
102 }
104
105 out.Write();
106 out.Close();
107}
#define DEBUG(A)
Message macros.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
int numberOfBins
number of bins for average CDF integral of optical module
Utility class to parse command line options.
counter_type getCounter() const
Get counter.
bool is_genhen(const JHead &header)
Check for generator.
bool has_neutrino(const Evt &evt)
Test whether given event has an incoming neutrino.
const Trk & get_neutrino(const Evt &evt)
Get incoming neutrino.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Head getHeader(const JMultipleFileScanner_t &file_list)
Get Monte Carlo header.
KM3NeT DAQ data structures and auxiliaries.
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
The Head class reflects the header of Monte-Carlo event files, which consists of keys (also referred ...
Auxiliary class for histogramming of effective volume.
General purpose class for multiple pointers.
Auxiliary class for defining the range of iterations of objects.
static counter_type max()
Get maximum counter value.
Auxiliary class to synchronously read DAQ events and Monte Carlo events (and optionally other events)...
virtual bool hasNext() override
Check availability of next element.
virtual const multi_pointer_type & next() override
Get next element.
The Trk class represents a Monte Carlo (MC) particle as well as a reconstructed track/shower.
double E
Energy [GeV] (either MC truth or reconstructed)