46 typedef JTriggeredFileScanner_t::multi_pointer_type multi_pointer_type;
48 JTriggeredFileScanner_t inputFile;
52 size_t numberOfPrefits;
61 JParser<> zap(
"Example program to histogram fit results.");
66 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
69 zap[
'Q'] =
make_field(quality) = numeric_limits<double>::min();
76 catch(
const exception& error) {
77 FATAL(error.what() << endl);
93 const double Xmax = E_GeV.
is_valid() ? volume.getX(E_GeV.
getMaximum()) : volume.getXmax();
94 const double Xmin = E_GeV.
is_valid() ? volume.getX(E_GeV.
getMinimum()) : volume.getXmin();
98 TH1D* hN =
new TH1D(
"hN", NULL, 25, Xmin, Xmax);
99 TH1D* he =
new TH1D(
"he", NULL, 25, Xmin, Xmax);
115 STATUS(
"Detector Geometry:" << endl);
116 STATUS(
"Zmin: " << cylinder.getZmin() << endl);
117 STATUS(
"Zmax: " << cylinder.getZmax() << endl);
118 STATUS(
"Z origin: " << 0.5 * (cylinder.getZmax() + cylinder.getZmin()) << endl);
119 STATUS(
"Radius: " << cylinder.getRadius() << endl);
121 while (inputFile.hasNext()) {
123 STATUS(
"event: " << setw(10) << inputFile.getCounter() <<
'\r');
DEBUG(endl);
125 multi_pointer_type ps = inputFile.next();
134 const double X = volume.getX(neutrino.
E);
140 JEvt::iterator __end = evt->end();
142 if (numberOfPrefits > 0) {
144 advance(__end = evt->begin(), min(numberOfPrefits, evt->size()));
146 partial_sort(evt->begin(), __end, evt->end(),
qualitySorter);
150 for(JEvt::const_iterator track = evt->begin(); track != __end; ++track) {
156 if ((pos.
getZ() > cylinder.getZmin()
157 && pos.
getZ() < cylinder.getZmax()
158 && R < cylinder.getRadius())
178 WARNING(
"No neutrino." << endl);
#define DEBUG(A)
Message macros.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Data structure for position in three dimensions.
double getY() const
Get y position.
double getZ() const
Get z position.
double getX() const
Get x position.
Utility class to parse command line options.
static const int JGANDALF_NUMBER_OF_HITS
number of hits from JGandalf.cc
static const int JGANDALF_CHI2
chi2 from JGandalf.cc
const Trk & get_neutrino(const Evt &evt)
Get incoming neutrino.
bool has_neutrino(const Evt &evt)
Test whether given event has an incoming neutrino.
JPosition3D getPosition(const Vec &pos)
Get position.
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
bool qualitySorter(const JFit &first, const JFit &second)
Comparison of fit results.
counter_type advance(counter_type &counter, const counter_type value, const counter_type limit=std::numeric_limits< counter_type >::max())
Advance counter.
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.
Auxiliary class for defining the range of iterations of objects.
const JLimit & getLimit() const
Get limit.
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)