268{
271
273 typedef JTriggeredFileScanner_t::multi_pointer_type multi_pointer_type;
274
275 JTriggeredFileScanner_t inputFileA;
276 JTriggeredFileScanner_t inputFileB;
279 double angle_Deg;
281
282 try {
283
284 JParser<> zap(
"Example program to compare fit results from two files.");
285
292
293 zap(argc, argv);
294 }
295 catch(const exception& error) {
296 FATAL(error.what() << endl);
297 }
298
300
301 try {
303 }
306 }
309
310 inputFileA.setLimit(numberOfEvents);
311 inputFileB.setLimit(numberOfEvents);
312
313
315
317
318 manager.insert(
make_key(JQUALITY), 501, 0.0, 1.0e3);
327
328 TH1D hA("h[A]", NULL, 100, -3.0, +2.3);
329 TH1D hB("h[B]", NULL, 100, -3.0, +2.3);
330 TH2D hA_angle_E("hA_angle_E", NULL, 20, E_nu_min, E_nu_max, 100, 0,90);
331 TH2D hB_angle_E("hB_angle_E", NULL, 20, E_nu_min, E_nu_max, 100, 0,90);
332 TH2D h2("h2", NULL,
333 100, -100.0, +100.0,
334 360, -180.0, +180.0);
335
336 while (inputFileA.hasNext() && inputFileB.hasNext()) {
337
338 STATUS(
"event: " << setw(10) << inputFileA.getCounter() <<
'\r');
DEBUG(endl);
339
340 multi_pointer_type psA = inputFileA.next();
341 multi_pointer_type psB = inputFileB.next();
342
343
344
345 while (psA.get<
Evt>()->
mc_id < psB.get<
Evt>()->
mc_id && inputFileA.hasNext()) { psA = inputFileA.next(); }
346 while (psB.get<
Evt>()->
mc_id < psA.get<
Evt>()->
mc_id && inputFileB.hasNext()) { psB = inputFileB.next(); }
347
348 if (!psA.is_valid()) { continue; }
349 if (!psB.is_valid()) { continue; }
350
352
356
358
359 vector<Trk>::const_iterator muon = find_if(event->mc_trks.begin(), event->mc_trks.end(),
is_muon);
360
361 if (muon == event->mc_trks.end()) { continue; }
362
363 if (evtA->empty()) { continue; }
364 if (evtB->empty()) { continue; }
365
366 JEvt::const_iterator fitA = evtA->begin();
367 JEvt::const_iterator fitB = evtB->begin();
368
371
372 hA.Fill(log10(angleA));
373 hB.Fill(log10(angleB));
374
375 h2.Fill(fitB->getQ() - fitA->getQ(), angleB - angleA);
376
377 const double Enu = neutrino.
E;
378 hA_angle_E.Fill(Enu, angleA);
379 hB_angle_E.Fill(Enu, angleB);
380
381 if (angleA >= angle_Deg) {
382 manager.Fill(*fitA, *fitB, angleB < angle_Deg);
383 }
384 }
385 }
387
388 out.Write();
389 out.Close();
390}
#define DEBUG(A)
Message macros.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
#define make_key(PARAMETER)
Make key.
Utility class to parse command line options.
Auxiliary class to manage set of compatible ROOT objects (e.g. histograms) using unique keys.
static const int JENERGY_ENERGY
uncorrected energy [GeV] from JEnergy.cc
static const int JENERGY_CHI2
chi2 from JEnergy.cc
static const int JSTART_NPE_MIP_TOTAL
number of photo-electrons along the whole track from JStart.cc
static const int JSTART_LENGTH_METRES
distance between projected positions on the track of optical modules for which the response does not ...
static const int JGANDALF_BETA0_RAD
KM3NeT Data Definitions v3.6.0 https://git.km3net.de/common/km3net-dataformat.
static const int JGANDALF_BETA1_RAD
angular resolution [rad] from JGandalf.cc
static const int JSTART_NPE_MIP
number of photo-electrons up to the barycentre from JStart.cc
static const int JGANDALF_NUMBER_OF_HITS
number of hits from JGandalf.cc
JDirection3D getDirection(const Vec &dir)
Get direction.
bool is_muon(const Trk &track)
Test whether given track is a (anti-)muon.
const Trk & get_neutrino(const Evt &evt)
Get incoming neutrino.
double getAngle(const JQuaternion3D &first, const JQuaternion3D &second)
Get space angle between quanternions.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Head getHeader(const JMultipleFileScanner_t &file_list)
Get Monte Carlo header.
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
int mc_id
identifier of the MC event (as found in ascii or antcc file).
JRange_t E
Energy range [GeV].
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)...
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)