64 using namespace KM3NETDAQ;
67 typedef JParallelFileScanner_t::multi_pointer_type multi_pointer_type;
70 JParallelFileScanner_t inputFile;
77 size_t numberOfPrefits;
84 JParser<> zap(
"Program to perform fit of muon path to data.");
89 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
91 zap[
'R'] =
make_field(roadWidth_m) = numeric_limits<double>::max();
100 catch(
const exception& error) {
101 FATAL(error.what() << endl);
127 JRegressor_t::T_ns.setRange(-50.0, +50.0);
128 JRegressor_t::Vmax_npe = 10.0;
129 JRegressor_t::MAXIMUM_ITERATIONS = 10000;
131 JRegressor_t fit(pdfFile, TTS_ns);
133 for (
int i = 0; i != JRegressor_t::NUMBER_OF_PDFS; ++i) {
134 fit.npe[i].transform(JRegressor_t::JNPE_t::transformer_type::getDefaultTransformer());
139 fit.parameters.resize(4);
142 fit.parameters[1] = JLine3Z::pY();
143 fit.parameters[2] = JLine3Z::pDX();
144 fit.parameters[3] = JLine3Z::pDY();
146 if (fit.getRmax() < roadWidth_m) {
148 roadWidth_m = fit.getRmax();
150 WARNING(
"Set road width to [m] " << roadWidth_m << endl);
153 const double Rmax_m = 100.0;
154 const double Tmax_ns = 10.0;
161 while (inputFile.hasNext()) {
163 STATUS(
"event: " << setw(10) << inputFile.getCounter() <<
'\r');
DEBUG(endl);
165 multi_pointer_type ps = inputFile.next();
178 buildL0(*tev, router,
true, back_inserter(dataL0));
181 for (JEvt::const_iterator track = cp.begin(); track != cp.end(); ++track) {
193 for (JDataL0_t::const_iterator i = dataL0.begin(); i != dataL0.end(); ++i) {
201 top.insert(hit.getPMTIdentifier());
203 const double t1 = hit.getT() - tz.getT(hit);
205 if (tz.getDistance(hit) <= Rmax_m && t1 >= -Tmax_ns && t1 <= +Tmax_ns) {
214 for (JDetector::const_iterator module =
detector.begin(); module !=
detector.end(); ++module) {
220 if (tz.getDistance(pos) <= roadWidth_m && Z(pos.getZ() - tz.getDistance(pos) /
getTanThetaC())) {
222 for (
unsigned int i = 0; i != module->size(); ++i) {
230 buffer.push_back(
JPMTW0(
pmt, R_Hz, top.count(
id)));
236 const int NDF = buffer.size() - fit.parameters.size();
242 if (track->getE() > 0.1)
243 fit.E_GeV = track->getE();
247 const double chi2 = fit(
JLine3Z(tz), buffer.begin(), buffer.end());
255 out.rbegin()->setW(track->getW());
Utility class to parse command line options.
static const int JMUONPATH
Template specialisation of L0 builder for JHitL0 data type.
Auxiliary class for handling PMT geometry, rate and response.
Router for direct addressing of module data in detector data structure.
esac print_variable DETECTOR INPUT_FILE OUTPUT_FILE CDF for TYPE in
General purpose class for parallel reading of objects from a single file or multiple files...
Template specialisation of class JModel to match hit with muon trajectory along z-axis.
Data structure for fit of straight line in positive z-direction.
double getQuality(const double chi2, const int N, const int NDF)
Get quality of fit.
esac $JPP_DIR examples JDetector JTransitTime o $OUTPUT_FILE n N $NPE T $TTS_NS d $DEBUG for HISTOGRAM in tts tt2 pmt
Auxiliary class for defining the range of iterations of objects.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Data structure for PMT geometry and calibration.
Auxiliary class for a hit with background rate value.
void load(const JString &file_name, JDetector &detector)
Load detector from input file.
then usage $script[distance] fi case set_variable R
JFit getFit(const JHistory &history, const JTrack3D &track, const double Q, const int NDF, const double energy=0.0, const int status=0)
Get fit.
Data structure for set of track fit results.
Regressor function object for JLine3Z fit using JGandalf minimiser.
Data structure for fit of straight line paralel to z-axis.
JDirection3D getDirection(const Vec &v)
Get direction.
Object reading from a list of files.
Data structure for position in three dimensions.
const JLimit & getLimit() const
Get limit.
JPosition3D & rotate(const JRotation3D &R)
Rotate.
void select(const JSelector_t &selector)
Select fits.
bool qualitySorter(const JRECONSTRUCTION::JFit &first, const JRECONSTRUCTION::JFit &second)
Comparison of fit results.
#define DEBUG(A)
Message macros.
JPosition3D getPosition(const Vec &v)
Get position.