80{
84
86 typedef JTriggeredFileScanner_t::multi_pointer_type multi_pointer_type;
87
89 JLimit_t& numberOfEvents = inputFile.getLimit();
91 size_t numberOfPrefits;
94 double Emin_GeV;
96 string option;
99
100 try {
101
102 JParser<> zap(
"Example program to histogram fit results.");
103
112 zap[
'O'] =
make_field(option) =
"LINE",
"LOGE",
"LINN",
"LOGN";
115
117 }
118 catch(const exception& error) {
120 }
121
123
124 try {
126 }
127 catch(const exception& error) {
129 }
130
135
137
140
142
144
150
151 TH1D hx(
"hx",
NULL, 70, -3.0, +2.3);
154
157
158 TH1D E_0(
"E_0",
NULL, 100, volume.getXmin(), volume.getXmax());
159 TH1D E_1(
"E_1",
NULL, 100, volume.getXmin(), volume.getXmax());
160 TH1D E_2(
"E_2",
NULL, 100, volume.getXmin(), volume.getXmax());
163 40, volume.getXmin(), volume.getXmax(),
164 40, volume.getXmin(), volume.getXmax());
165
169
171
172 if (option == "LINN") {
173
174 const double xmin = log((double) 3);
175 const double xmax = log((double) 300);
176
177 for (
double x = xmin,
dx = (xmax - xmin) / 20;
x <= xmax;
x +=
dx) {
178 X.push_back((
int)
exp(x));
179 }
180
181 } else if (option == "LOGN") {
182
183 const double xmin =
log10((
double) 3);
184 const double xmax =
log10((
double) 400);
185
186 for (
double x = xmin,
dx = (xmax - xmin) / 20;
x <= xmax;
x +=
dx) {
187 X.push_back(x);
188 }
189
190 } else {
191
192 for (
double x = volume.getXmin(),
dx = (volume.getXmax() - volume.getXmin()) / 20.0;
x < volume.getXmax() + 0.5*
dx;
x +=
dx) {
193 X.push_back(x);
194 }
195 }
196
198
205
208
209
210 while (inputFile.hasNext()) {
211
213
214 multi_pointer_type ps = inputFile.next();
215
219
221
223
224
228
231 }
232
234
236
238
240
244 }
245 }
246 }
247
248 if (muon == event->mc_trks.end()) {
249 continue;
250 }
251
253
254
255
256
258
259 {
260 const double E = event->mc_trks[0].E;
262
263 if (option == "LINN")
265 else if (option == "LOGN")
267 else
269 }
270
271
272 if (!evt->empty()) {
273
275
276 if (evt->begin() == __end) {
277 continue;
278 }
279
281
282 if (numberOfPrefits > 0) {
283
284 JEvt::iterator
__q = __end;
285
286 advance(__end = evt->begin(), min(numberOfPrefits, (
size_t)
distance(evt->begin(),
__q)));
287
289
290 } else {
291
293 }
294
295 double E = 0.0;
297
301 }
else if (
primary == neutrino_t) {
304 }
305
310
311
312
313 bool ok = (
Efit >= Emin_GeV);
314
316
318
323
324
325
329 }
330
331 hx.Fill(max(
log10(
beta), hx.GetXaxis()->GetXmin()));
332
334
337
340
343
344 hd.Fill((
tb.getPosition() -
ta.getPosition()).getLength());
345
347
349
351
353
355
357
359
361
363
366 }
367 }
368
370 ht.Fill(
tb.getT() -
ta.getT());
371
372 E_0.Fill(volume.getX(E,
true));
373 E_1.Fill(volume.getX(
Eraw,
true));
374 E_2.Fill(volume.getX(
Efit,
true));
375 E_E.Fill(volume.getX(
Efit) - volume.getX(E));
376 ExE.Fill(volume.getX(E), volume.getX(
Efit));
377
379 }
380 }
381 }
383
384 NOTICE(
"Number of events input " <<
setw(8) << right <<
job.GetBinContent(1) <<
endl);
385 NOTICE(
"Number of events with muon " <<
setw(8) << right <<
job.GetBinContent(3) <<
endl);
386 NOTICE(
"Number of events with fit " <<
setw(8) << right <<
job.GetBinContent(4) <<
endl);
387 NOTICE(
"Number of events selected " <<
setw(8) << right <<
job.GetBinContent(5) <<
endl);
388 NOTICE(
"Number of events with neutrino " <<
setw(8) << right <<
job.GetBinContent(6) <<
endl);
389 NOTICE(
"Number of events contained " <<
setw(8) << right <<
job.GetBinContent(7) <<
endl);
390
391 if (Q.getCount() != 0) {
392
393 NOTICE(
"Median space angle [deg] " <<
FIXED (6,3) << Q.getQuantile(0.5) <<
endl);
394
395 for (double q : {0.50, 0.90, 0.99}) {
396 NOTICE(
"Space angle " <<
FIXED(5,1) << (100.0 * q) <<
"% quantile [deg] " <<
FIXED(6,3) << Q.getQuantile(q) <<
endl);
397 }
398 }
399
400 out.Write();
401 out.Close();
402}
#define DEBUG(A)
Message macros.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Data structure for vector in two dimensions.
double getLengthSquared() const
Get length squared.
Data structure for position in three dimensions.
Template definition of a multi-dimensional oscillation probability interpolation table.
Auxiliary class to evaluate atmospheric muon hypothesis.
Auxiliary class to compare fit results with respect to a reference direction (e.g....
Auxiliary class to convert DAQ hit time to/from Monte Carlo hit time.
static const int JENERGY_ENERGY
uncorrected energy [GeV] see JRECONSTRUCTION::JMuonEnergy
static const int JSTART_LENGTH_METRES
distance between projected positions on the track of optical modules for which the response does not ...
Vec getOrigin(const JHead &header)
Get origin.
JDirection3D getDirection(const Vec &dir)
Get direction.
JTrack3E getTrack(const Trk &track)
Get track.
JCylinder3D getCylinder(const JHead &header)
Get cylinder corresponding to the positions of generated tracks (i.e.
bool has_neutrino(const Evt &evt)
Test whether given event has an incoming neutrino.
JPosition3D getPosition(const Vec &pos)
Get position.
bool is_muon(const Trk &track)
Test whether given track is a (anti-)muon.
Vec getOffset(const JHead &header)
Get offset.
const Trk & get_neutrino(const Evt &evt)
Get incoming neutrino.
size_t getCount(const array_type< T > &buffer, const JCompare_t &compare)
Count number of unique values.
const double getSpeedOfLight()
Get speed of light.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
counter_type advance(counter_type &counter, const counter_type value, const counter_type limit=std::numeric_limits< counter_type >::max())
Advance counter.
Head getCommonHeader(const JMultipleFileScanner_t &file_list)
Get common Monte Carlo header.
KM3NeT DAQ data structures and auxiliaries.
const char *const neutrino_t
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
Auxiliary data structure for floating point format specification.
Auxiliary class for histogramming of effective volume.
Auxiliary class to test history.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
General purpose sorter of fit results.
Auxiliary class for defining the range of iterations of objects.
static counter_type max()
Get maximum counter value.
The Trk class represents a Monte Carlo (MC) particle as well as a reconstructed track/shower.
Reconstruction type dependent comparison of track quality.