Go to the source code of this file.
|
int | main (int argc, char **argv) |
|
Example program to histogram fit efficiency.
- Author
- lquinn
Definition in file JFitEfficiency.cc.
◆ main()
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 40 of file JFitEfficiency.cc.
47 typedef JTriggeredFileScanner_t::multi_pointer_type multi_pointer_type;
49 JTriggeredFileScanner_t inputFile;
53 size_t numberOfPrefits;
62 JParser<> zap(
"Example program to histogram fit results.");
67 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
70 zap[
'Q'] =
make_field(quality) = numeric_limits<double>::min();
77 catch(
const exception& error) {
78 FATAL(error.what() << endl);
96 const double Xmax = E_GeV.
is_valid() ? volume.getX(E_GeV.
getMaximum()) : volume.getXmax();
97 const double Xmin = E_GeV.
is_valid() ? volume.getX(E_GeV.
getMinimum()) : volume.getXmin();
101 TH1D* hN =
new TH1D(
"hN", NULL, 25, Xmin, Xmax);
102 TH1D* he =
new TH1D(
"he", NULL, 25, Xmin, Xmax);
118 STATUS(
"Detector Geometry:" << endl);
119 STATUS(
"Zmin: " << cylinder.getZmin() << endl);
120 STATUS(
"Zmax: " << cylinder.getZmax() << endl);
121 STATUS(
"Z origin: " << 0.5 * (cylinder.getZmax() + cylinder.getZmin()) << endl);
122 STATUS(
"Radius: " << cylinder.getRadius() << endl);
124 while (inputFile.hasNext()) {
126 STATUS(
"event: " << setw(10) << inputFile.getCounter() <<
'\r');
DEBUG(endl);
128 multi_pointer_type ps = inputFile.next();
137 const double X = volume.getX(neutrino.
E);
143 JEvt::iterator __end = evt->end();
145 if (numberOfPrefits > 0) {
147 advance(__end = evt->begin(), min(numberOfPrefits, evt->size()));
149 partial_sort(evt->begin(), __end, evt->end(),
qualitySorter);
153 for(JEvt::const_iterator track = evt->begin(); track != __end; ++track) {
159 if ((pos.
getZ() > cylinder.getZmin()
160 && pos.
getZ() < cylinder.getZmax()
161 && R < cylinder.getRadius())
181 WARNING(
"No neutrino." << endl);
Auxiliary class for defining the range of iterations of objects.
counter_type advance(counter_type &counter, const counter_type value, const counter_type limit=std::numeric_limits< counter_type >::max())
Advance counter.
static const int JGANDALF_CHI2
chi2 from JGandalf.cc
bool qualitySorter(const JFIT::JFit &first, const JFIT::JFit &second)
Comparison of fit results.
double getZ() const
Get z position.
void load(const JString &file_name, JDetector &detector)
Load detector from input file.
double E
Energy (either MC truth or reconstructed)
The Trk class represents a Monte Carlo (MC) particle as well as a reconstructed track/shower.
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
Utility class to parse command line options.
Data structure for set of track fit results.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Head getHeader(const JMultipleFileScanner_t &file_list)
Get Monte Carlo header.
Data structure for position in three dimensions.
The Head class reflects the header of Monte-Carlo event files, which consists of keys (also referred ...
const Trk & get_neutrino(const Evt &evt)
Get incoming neutrino.
const JLimit & getLimit() const
Get limit.
bool has_neutrino(const Evt &evt)
Test whether given event has an incoming neutrino.
Auxiliary class for histogramming of effective volume.
Auxiliary class to synchronously read DAQ events and Monte Carlo events (and optionally other events)...
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
JPosition3D getPosition(const Vec &v)
Get position.
#define DEBUG(A)
Message macros.
double getY() const
Get y position.
KM3NeT DAQ data structures and auxiliaries.
double getX() const
Get x position.
static const int JGANDALF_NUMBER_OF_HITS
number of hits from JGandalf.cc