48{
52
55 double margin;
56 bool logx;
59 std::string option;
61
62
63 try {
64
65 JParser<> zap(
"Example program to histogram neutrino effective mass for triggered events.");
66
69 zap[
'R'] =
make_field(margin,
"Margin around the volume in which the considered events must reside") = 0.0;
70 zap[
'X'] =
make_field(logx,
"Use logarithm of energy");
73 zap[
'O'] =
make_field(option,
"Result option") = Mass_t, Volume_t;
75
76 zap(argc, argv);
77 }
78 catch(const exception &error) {
79 FATAL(error.what() << endl);
80 }
81
82 try{
83
84 double Xmin = numeric_limits<double>::max();
85 double Xmax = numeric_limits<double>::lowest();
86
88
90
91 const JVolume volume(scanner->getHeader(), logx);
92
93 if (volume.getXmin() < Xmin) { Xmin = volume.getXmin(); }
94 if (volume.getXmax() > Xmax) { Xmax = volume.getXmax(); }
95 }
96
99
101
103
104 NOTICE(
"Scanning file type " << scanner->getName() << endl);
105 DEBUG (header << endl);
106
108
109 if (
can.getVolume() == 0.0) {
111 }
112
113 can.addMargin(margin);
114
115 NOTICE(
"Cylinder, including margin: " <<
can << endl);
116
117
118
119
120
121 size_t N = 0;
122
123 while (scanner->hasNext()) {
124
125 STATUS(
"event: " << setw(10) << scanner->getCounter() <<
'\r');
DEBUG(endl);
126
127 const Evt*
event = scanner->next();
130
131 if (event->mc_hits.empty()) {
132 N += 1;
133 }
134
136
137 if (
can.is_inside(vertex)) {
139 }
140 }
142
143 if (N == 0) {
144 ERROR(
"No events with zero hits -> use application JEffectiveMassOffline1D." << endl);
145 }
146
147
148
149
150
152
153 STATUS(
"event: " << setw(10) << in.getCounter() <<
'\r');
DEBUG(endl);
154
155 const Evt*
event = in.next();
157
160
161 if (option == Mass_t) {
163 } else if (option == Volume_t) {
164 y =
can .getVolume() * 1.0e-9;
165 }
166
168 }
170 }
171
172
173
174
175
177 hM[pdg]->Divide(hNM[pdg]);
178 }
179
181
182 out << hM;
183
184 out.Close();
185 }
187 FATAL(error << endl);
188 }
189}
#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
const JHead & getHeader() const
Get header.
Utility class to parse command line options.
Auxiliary class to manage set of compatible ROOT objects (e.g. histograms) using unique keys.
JCylinder3D getCylinder(const JHead &header)
Get cylinder corresponding to the positions of generated tracks (i.e.
JVertex3D getVertex(const Trk &track)
Get vertex.
const Trk & get_primary(const Evt &evt)
Auxiliary function to retrieve the primary track of an event.
const array_type< JKey_t > & get_keys(const std::map< JKey_t, JValue_t, JComparator_t, JAllocator_t > &data)
Method to create array of keys of map.
static const double DENSITY_SEA_WATER
Fixed environment values.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
KM3NeT DAQ data structures and auxiliaries.
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
Auxiliary class for histogramming of effective volume.
The cylinder used for photon tracking.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Auxiliary class for organising Monte Carlo file scanners associated with event weighters.
std::vector< filescanner_type >::const_iterator const_iterator
std::vector< filescanner_type >::iterator iterator
Auxiliary base class for list of file names.
Auxiliary class to synchronously read DAQ events and Monte Carlo events (and optionally other events)...
virtual bool hasNext() override
Check availability of next element.
The Trk class represents a Monte Carlo (MC) particle as well as a reconstructed track/shower.