69 typedef JParallelFileScanner_t::multi_pointer_type multi_pointer_type;
72 JParallelFileScanner_t inputFile;
79 size_t numberOfPrefits;
86 JParser<> zap(
"Program to perform fit of muon path to data.");
91 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
93 zap[
'R'] =
make_field(roadWidth_m) = numeric_limits<double>::max();
102 catch(
const exception& error) {
103 FATAL(error.what() << endl);
126 JRegressor_t::T_ns.setRange(-50.0, +50.0);
127 JRegressor_t::Vmax_npe = 10.0;
128 JRegressor_t::MAXIMUM_ITERATIONS = 10000;
132 fit.transform(JRegressor_t::transformer_type::getDefaultTransformer());
136 fit.parameters.resize(4);
139 fit.parameters[1] = JLine3Z::pY();
140 fit.parameters[2] = JLine3Z::pDX();
141 fit.parameters[3] = JLine3Z::pDY();
143 if (fit.getRmax() < roadWidth_m) {
145 roadWidth_m = fit.getRmax();
147 WARNING(
"Set road width to [m] " << roadWidth_m << endl);
150 const double Rmax_m = 100.0;
151 const double Tmax_ns = 10.0;
158 while (inputFile.hasNext()) {
160 STATUS(
"event: " << setw(10) << inputFile.getCounter() <<
'\r');
DEBUG(endl);
162 multi_pointer_type ps = inputFile.next();
175 buildL0(*tev, router,
true, back_inserter(dataL0));
178 for (JEvt::const_iterator track = cp.begin(); track != cp.end(); ++track) {
190 for (JDataL0_t::const_iterator i = dataL0.begin(); i != dataL0.end(); ++i) {
198 top.insert(hit.getPMTIdentifier());
200 const double t1 = hit.getT() - tz.getT(hit);
202 if (tz.getDistance(hit) <= Rmax_m && t1 >= -Tmax_ns && t1 <= +Tmax_ns) {
211 for (JDetector::const_iterator module =
detector.begin(); module !=
detector.end(); ++module) {
217 if (tz.getDistance(pos) <= roadWidth_m && Z(pos.getZ() - tz.getDistance(pos) /
getTanThetaC())) {
219 for (
unsigned int i = 0; i != module->size(); ++i) {
223 JPMT pmt(module->getPMT(i));
227 buffer.push_back(
JPMTW0(pmt, R_Hz, top.count(
id)));
233 const int NDF = buffer.size() - fit.parameters.size();
239 if (track->getE() > 0.1)
240 fit.E_GeV = track->getE();
244 const double chi2 = fit(
JLine3Z(tz), buffer.begin(), buffer.end());
252 out.rbegin()->setW(track->getW());
#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 PMT geometry, calibration and status.
Data structure for fit of straight line paralel to z-axis.
Data structure for fit of straight line in positive z-direction.
Data structure for position in three dimensions.
JPosition3D & rotate(const JRotation3D &R)
Rotate.
Utility class to parse command line options.
Auxiliary class for a hit with background rate value.
General purpose class for parallel reading of objects from a single file or multiple files.
Object reading from a list of files.
Template specialisation of L0 builder for JHitL0 data type.
static const int JMUONPATH
JDirection3D getDirection(const Vec &dir)
Get direction.
JPosition3D getPosition(const Vec &pos)
Get position.
double getQuality(const double chi2, const int NDF)
Get quality of fit.
JFit getFit(const int id, const JMODEL::JString &string)
Get fit parameters of string.
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
double getTanThetaC()
Get average tangent of Cherenkov angle of water corresponding to group velocity.
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.
JFIT::JRegressor< JFIT::JLine3Z, JFIT::JGandalf > JRegressor_t
KM3NeT DAQ data structures and auxiliaries.
Template specialisation of class JModel to match hit with muon trajectory along z-axis.
Auxiliary class for handling PMT geometry, rate and response.
Regressor function object for JLine3Z fit using JGandalf minimiser.
Template definition of a data regressor of given model.
Auxiliary class for defining the range of iterations of objects.
const JLimit & getLimit() const
Get limit.