45 using namespace KM3NETDAQ;
47 typedef JTriggeredFileScanner<JEvt> JTriggeredFileScanner_t;
48 typedef JTriggeredFileScanner_t::multi_pointer_type multi_pointer_type;
50 JTriggeredFileScanner_t inputFile;
54 size_t numberOfPrefits;
63 JParser<> zap(
"Example program to histogram fit results.");
68 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
70 zap[
'E'] =
make_field(E_GeV) = JRange<double>(1.0, -1.0);
71 zap[
'Q'] =
make_field(quality) = numeric_limits<double>::min();
78 catch(
const exception& error) {
79 FATAL(error.what() << endl);
90 catch(
const JException& error) {
95 JVolume volume(head, logx);
97 const double Xmax = E_GeV.is_valid() ? volume.getX(E_GeV.getMaximum()) : volume.getXmax();
98 const double Xmin = E_GeV.is_valid() ? volume.getX(E_GeV.getMinimum()) : volume.getXmin();
102 TH1D* hN =
new TH1D(
"hN", NULL, 25, Xmin, Xmax);
103 TH1D* he =
new TH1D(
"he", NULL, 25, Xmin, Xmax);
111 load(detectorFile, detector);
113 catch(
const JException& error) {
117 JCylinder3D cylinder(detector.begin(), detector.end());
119 STATUS(
"Detector Geometry:" << endl);
120 STATUS(
"Zmin: " << cylinder.getZmin() << endl);
121 STATUS(
"Zmax: " << cylinder.getZmax() << endl);
122 STATUS(
"Z origin: " << 0.5 * (cylinder.getZmax() + cylinder.getZmin()) << endl);
123 STATUS(
"Radius: " << cylinder.getRadius() << endl);
125 while (inputFile.hasNext()) {
127 STATUS(
"event: " << setw(10) << inputFile.getCounter() <<
'\r');
DEBUG(endl);
129 multi_pointer_type ps = inputFile.next();
138 const double X = volume.getX(neutrino.E);
144 JEvt::iterator __end = evt->end();
146 if (numberOfPrefits > 0) {
148 advance(__end = evt->begin(), min(numberOfPrefits, evt->size()));
150 partial_sort(evt->begin(), __end, evt->end(),
qualitySorter);
154 for(JEvt::const_iterator track = evt->begin(); track != __end; ++track) {
158 const double R = sqrt(pos.getX() * pos.getX() + pos.getY() * pos.getY());
160 if ((pos.getZ() > cylinder.getZmin()
161 && pos.getZ() < cylinder.getZmax()
162 && R < cylinder.getRadius())
182 WARNING(
"No neutrino." << endl);
Utility class to parse command line options.
bool has_neutrino(const Evt &evt)
Test whether given event has an incoming neutrino.
Structure to store the ToT mean and standard deviation of the hits produced by a nanobeacon in a sour...
Head getHeader(const JMultipleFileScanner_t &file_list)
Get Monte Carlo header.
JLimit JLimit_t
Type definition of limit.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
void load(const JString &file_name, JDetector &detector)
Load detector from input file.
counter_type advance(counter_type &counter, const counter_type value, const counter_type limit=std::numeric_limits< counter_type >::max())
Advance counter.
number of hits from JGandalf.cc
bool qualitySorter(const JFIT::JFit &first, const JFIT::JFit &second)
Comparison of fit results.
const JLimit & getLimit() const
Get limit.
const Trk & get_neutrino(const Evt &evt)
Get incoming neutrino.
#define DEBUG(A)
Message macros.
JPosition3D getPosition(const Vec &v)
Get position.