Go to the documentation of this file.
68 int main(
int argc,
char **argv)
75 typedef JParallelFileScanner_t::multi_pointer_type multi_pointer_type;
78 JParallelFileScanner_t inputFile;
86 size_t numberOfPrefits;
93 JParser<> zap(
"Program to perform PDF fit of muon trajectory to data.");
98 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
100 zap[
'R'] =
make_field(roadWidth_m) = numeric_limits<double>::max();
110 catch(
const exception& error) {
111 FATAL(error.what() << endl);
137 JRegressor_t::T_ns = T_ns;
140 JRegressor_t fit(pdfFile);
142 if (fit.getRmax() < roadWidth_m) {
143 roadWidth_m = fit.getRmax();
151 while (inputFile.hasNext()) {
153 STATUS(
"event: " << setw(10) << inputFile.getCounter() <<
'\r');
DEBUG(endl);
155 multi_pointer_type ps = inputFile.next();
161 JEvt::iterator __end = evt->end();
167 if (evt->begin() != __end) {
169 copy(evt->begin(), __end, back_inserter(out));
171 if (numberOfPrefits > 0) {
172 advance(__end = evt->begin(), min(numberOfPrefits, out.size()));
175 partial_sort(evt->begin(), __end, evt->end(),
qualitySorter);
177 __end = partition(evt->begin(), __end,
JHistory::is_event(evt->begin()->getHistory()));
182 buildL0(*tev, moduleRouter,
true, back_inserter(dataL0));
185 for (JEvt::iterator track = evt->begin(); track != __end; ++track) {
194 for (JDataL0_t::const_iterator i = dataL0.begin(); i != dataL0.end(); ++i) {
210 for (JDetector::const_iterator module = subdetector.begin(); module != subdetector.end(); ++module) {
212 size_t count = top.count(module->getID());
215 data.push_back(
JNPEHit(fit.getNPE(*module, rates_Hz), count));
223 double npe_total = 0.0;
233 if (track_start == data. end()) { track_start = data. begin(); }
234 if (track_end == data.rend()) { track_end = data.rbegin(); }
236 Zmin = track_start->getZ();
237 Zmax = track_end ->getZ();
241 if (i->getZ() <= 0.0) {
245 npe_total += i->getYA();
252 FIXED(6,4) << i->getY0() <<
' ' <<
253 FIXED(6,4) << i->getYA() <<
' ' <<
254 setw(1) << i->getN() <<
' ' <<
255 FIXED(6,4) << i->getP() << endl);
258 DEBUG(
" --> " <<
FIXED(6,1) << Zmin <<
' ' <<
FIXED(6,1) << Zmax << endl);
267 out.rbegin()->setW(track->getW());
static const int JMUONSTART
Auxiliary class for defining the range of iterations of objects.
Auxiliary data structure for floating point format specification.
counter_type advance(counter_type &counter, const counter_type value, const counter_type limit=std::numeric_limits< counter_type >::max())
Advance counter.
JAxis3D getAxis(const Trk &track)
Get axis.
T & getInstance(const T &object)
Get static instance from temporary object.
bool qualitySorter(const JFIT::JFit &first, const JFIT::JFit &second)
Comparison of fit results.
JFit & add(const int type)
Add event to history.
Auxiliary class for start or end point evaluation.
void load(const JString &file_name, JDetector &detector)
Load detector from input file.
Auxiliary class for simultaneously handling light yields and response of PMT.
static const int JSTART_NPE_MIP_TOTAL
number of photo-electrons along the whole track from JStart.cc
Utility class to parse command line options.
Data structure for set of track fit results.
void copy(const Head &from, JHead &to)
Copy header from from to to.
int main(int argc, char **argv)
JPosition3D & rotate(const JRotation3D &R)
Rotate.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary class for K40 rates.
Regressor function object for JEnergy fit.
static const int JSTART_LENGTH_METRES
distance between first and last hits in metres from JStart.cc
const JDAQModuleIdentifier & getModuleIdentifier() const
Get Module identifier.
static const int JSTART_NPE_MIP
number of photo-electrons up to the barycentre from JStart.cc
Template specialisation of class JModel to match hit with muon trajectory along z-axis.
const JLimit & getLimit() const
Get limit.
Auxiliary class to test history.
Data structure for fit of straight line paralel to z-axis.
Auxiliary class to test history.
Router for direct addressing of module data in detector data structure.
Reduced data structure for L1 hit.
JDirection3D getDirection(const Vec &v)
Get direction.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
General purpose class for parallel reading of objects from a single file or multiple files.
JPosition3D getPosition(const Vec &v)
Get position.
#define DEBUG(A)
Message macros.
KM3NeT DAQ data structures and auxiliaries.
static const int JCOPY_Z_M
true vertex position along track [m] from JCopy.cc
Template specialisation of L0 builder for JHitL0 data type.
JComparator< JResult_t T::*, JComparison::lt > make_comparator(JResult_t T::*member)
Helper method to create comparator between values of data member.
T find(T __begin, T __end) const
Get start or end point of muon trajectory.
Detector subset without binary search functionality.
Object reading from a list of files.
Data structure for track fit results.