50 int main(
int argc,
char **argv)
54 using namespace KM3NETDAQ;
57 typedef JParallelFileScanner< JTypeList<JDAQEvent, JEvt> > JParallelFileScanner_t;
58 typedef JParallelFileScanner_t::multi_pointer_type multi_pointer_type;
61 JParallelFileScanner_t inputFile;
67 size_t numberOfPrefits;
74 JParser<> zap(
"Program to determine veto of muon trajectory.");
79 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
80 zap[
'R'] =
make_field(roadWidth_m) = numeric_limits<double>::max();
89 catch(
const exception& error) {
90 FATAL(error.what() << endl);
99 load(detectorFile, detector);
101 catch(
const JException& error) {
105 const JModuleRouter moduleRouter(detector);
108 const JBuildL0<JHitL0> buildL0;
113 VS += vs->getLength() * 1.0e-9;
121 while (inputFile.hasNext()) {
123 STATUS(
"event: " << setw(10) << inputFile.getCounter() <<
'\r');
DEBUG(endl);
125 multi_pointer_type ps = inputFile.next();
131 JEvt::iterator __end = evt->
end();
134 __end = partition(evt->begin(), __end, JHistory::is_not_event(
JMUONVETO));
137 if (evt->begin() != __end) {
139 copy(evt->begin(), __end, back_inserter(out));
141 if (numberOfPrefits > 0) {
142 advance(__end = evt->begin(), min(numberOfPrefits, out.size()));
145 partial_sort(evt->begin(), __end, evt->end(),
qualitySorter);
147 __end = partition(evt->begin(), __end, JHistory::is_event(evt->begin()->getHistory()));
152 buildL0(*tev, moduleRouter,
true, back_inserter(dataL0));
155 for (JEvt::iterator track = evt->begin(); track != __end; ++track) {
164 for (JDataL0_t::const_iterator i = dataL0.begin(); i != dataL0.end(); ++i) {
170 bool is_veto =
false;
172 if (tz.getDistance(hit) <= roadWidth_m) {
174 const double t1 = hit.getT() - tz.getT(hit);
182 top.insert(hit.getPMTIdentifier());
190 for (JDetector::const_iterator module = detector.begin(); module != detector.end(); ++module) {
192 JPosition3D pos(module->getPosition());
196 if (tz.getDistance(pos) <= roadWidth_m) {
198 for (
unsigned int i = 0; i != module->size(); ++i) {
203 count += top.count(
id);
208 out.push_back(JFit(*track).add(
JMUONVETO));
223 JSingleFileScanner<JRemove<typelist, JEvt>::typelist> io(inputFile);
Utility class to parse command line options.
number of photo-electrons from JVeto.cc
Recording of objects on file according a format that follows from the file name extension.
Data structure for detector geometry and calibration.
number of hits from JVeto.cc
Basic data structure for L0 hit.
JLimit JLimit_t
Type definition of limit.
Definition of fit parameters from various applications.
Basic data structure for time and time over threshold information of hit.
const_iterator< T > end() const
Get end of data.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Parallel scanning of objects from a single file or multiple files according a format that follows fro...
void load(const JString &file_name, JDetector &detector)
Load detector from input file.
General purpose messaging.
counter_type advance(counter_type &counter, const counter_type value, const counter_type limit=std::numeric_limits< counter_type >::max())
Advance counter.
Scanning of objects from multiple files according a format that follows from the extension of each fi...
Direct access to module in detector data structure.
Reduced data structure for L1 hit.
Utility class to parse command line options.
ROOT TTree parameter settings.
bool qualitySorter(const JFIT::JFit &first, const JFIT::JFit &second)
Comparison of fit results.
void copy(const Head &from, JHead &to)
Copy header from from to to.
JDirection3D getDirection(const Vec &v)
Get direction.
const JLimit & getLimit() const
Get limit.
JPosition3D & rotate(const JRotation3D &R)
Rotate.
Basic data structure for L1 hit.
#define DEBUG(A)
Message macros.
JPosition3D getPosition(const Vec &v)
Get position.
int main(int argc, char *argv[])