Go to the documentation of this file.
57 int main(
int argc,
char **argv)
64 typedef JParallelFileScanner_t::multi_pointer_type multi_pointer_type;
67 JParallelFileScanner_t inputFile;
74 size_t numberOfPrefits;
82 JParser<> zap(
"Program to perform intermediate fit of muon trajectory to data.");
87 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
99 catch(
const exception& error) {
100 FATAL(error.what() << endl);
108 const double TMAX_NS = 50.0;
133 JRegressor_t fit(sigma_ns);
138 JRegressor_t::MAXIMUM_ITERATIONS = 10000;
145 while (inputFile.hasNext()) {
147 STATUS(
"event: " << setw(10) << inputFile.getCounter() <<
'\r');
DEBUG(endl);
149 multi_pointer_type ps = inputFile.next();
155 JEvt::iterator __end = evt->end();
161 if (evt->begin() != __end) {
163 copy(evt->begin(), __end, back_inserter(out));
165 if (numberOfPrefits > 0) {
166 advance(__end = evt->begin(), min(numberOfPrefits, out.size()));
169 partial_sort(evt->begin(), __end, evt->end(),
qualitySorter);
171 __end = partition(evt->begin(), __end,
JHistory::is_event(evt->begin()->getHistory()));
179 for (JDAQTimeslice::const_iterator i = timeslice.begin(); i != timeslice.end(); ++i) {
181 if (moduleRouter.
hasModule(i->getModuleID())) {
183 buffer(*i, moduleRouter.
getModule(i->getModuleID()));
185 buildL0(buffer, back_inserter(dataL0));
186 buildL2(buffer, back_inserter(dataL1));
193 for (JEvt::const_iterator track = evt->begin(); track != __end; ++track) {
201 for (JDataL1_t::const_iterator i = dataL1.begin(); i != dataL1.end(); ++i) {
214 data.reserve(data.size() + dataL0.size());
216 JDataR1_t::iterator __end1 = data.end();
218 for (JDataL0_t::iterator i = dataL0.begin(); i != dataL0.end(); ++i) {
220 if (find_if(data.begin(), __end1, bind2nd(equal_to<JDAQModuleIdentifier>(), i->getModuleID())) == __end1) {
242 const int NDF =
getCount(data.begin(), data.end()) - fit.step.size();
246 const double chi2 = fit(
JLine3Z(tz), data.begin(), data.end());
254 out.rbegin()->setW(track->getW());
int main(int argc, char **argv)
Auxiliary class for defining the range of iterations of objects.
Data structure for fit of straight line in positive z-direction.
Data structure for L2 parameters.
counter_type advance(counter_type &counter, const counter_type value, const counter_type limit=std::numeric_limits< counter_type >::max())
Advance counter.
Data structure for normalised vector in positive z-direction.
bool qualitySorter(const JFIT::JFit &first, const JFIT::JFit &second)
Comparison of fit results.
const JModule & getModule(const JObjectID &id) const
Get module parameters.
void load(const JString &file_name, JDetector &detector)
Load detector from input file.
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.
JPosition3D & rotate(const JRotation3D &R)
Rotate.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Data structure for vector in three dimensions.
Template specialisation of class JModel to match hit with muon trajectory along z-axis.
const JLimit & getLimit() const
Get limit.
static const int JMUONSIMPLEX
Regressor function object for JLine3Z fit using JSimplex minimiser.
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.
bool hasModule(const JObjectID &id) const
Has module.
KM3NeT DAQ data structures and auxiliaries.
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.
Template specialisation of L0 builder for JHitL0 data type.
Container for historical events.
2-dimensional frame with time calibrated data from one optical module.
double getQuality(const double chi2, const int NDF)
Get quality of fit.
Object reading from a list of files.
int getCount(const JHitL0 &hit)
Get hit count.