45{
49
52 typedef JParallelFileScanner_t::multi_pointer_type multi_pointer_type;
56
57 JParallelFileScanner_t inputFile;
60 string detectorFile;
61 JCalibration_t calibrationFile;
62 double Tmax_s;
63 string pdfFile;
65 size_t threads;
67
68 try {
69
70 JParser<> zap(
"Program to perform PDF fit of muon trajectory to data.");
71
80 zap[
'N'] =
make_field(threads,
"number of threads") = 0;
82
83 zap(argc, argv);
84 }
85 catch(const exception& error) {
86 FATAL(error.what() << endl);
87 }
88
89
91
93
94 try {
96 }
99 }
100
101 unique_ptr<JDynamics> dynamics;
102
103 if (!calibrationFile.empty()) {
104
105 try {
106
108
109 dynamics->load(calibrationFile);
110 }
111 catch(const exception& error) {
113 }
114 }
115
118
119 {
121
123
125
127
129
130 while (inputFile.hasNext()) {
131
132 STATUS(
"event: " << setw(10) << inputFile.getCounter() <<
'\r');
DEBUG(endl);
133
134 multi_pointer_type ps = inputFile.next();
135
138
139 summary.update(*tev);
140
141 if (dynamics) {
142 dynamics->update(*tev);
143 }
144
145 auto input = fit.getInput(router, summary, *tev, *in, dynamics ? dynamics->getCoverage() :
coverage_type());
146
147 if (threads > 0)
148 fits.enqueue(input);
149 else
151 }
153 }
154
156
158
160}
#define DEBUG(A)
Message macros.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Router for direct addressing of module data in detector data structure.
Data structure for set of track fit results.
Utility class to parse command line options.
Thread pool for event-by-event reconstruction.
void setSplitLevel(int value)
Set split level.
General purpose class for object reading from a list of file names.
General purpose class for parallel reading of objects from a single file or multiple files.
Object reading from a list of files.
File router for fast addressing of summary data.
JTOOLS::JRange< double > JTimeRange
Type definition for time range (unit [s]).
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).
JTreeParameters & getTreeParameters()
Template definition for method returning TTree parameters.
KM3NeT DAQ data structures and auxiliaries.
Dynamic detector calibration.
Data structure for coverage of detector by dynamical calibrations.
Auxiliary class for recursive type list generation.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Data structure for fit parameters.
double TTS_ns
transition-time spread [ns]
double TMin_ns
minimal time w.r.t. Cherenkov hypothesis [ns]
double TMax_ns
maximal time w.r.t. Cherenkov hypothesis [ns]
Wrapper class to make final fit of muon trajectory.
Auxiliary class for defining the range of iterations of objects.
const JLimit & getLimit() const
Get limit.
static counter_type max()
Get maximum counter value.