57 JParser<> zap(
"Example program to monitor acoustic events.");
59 zap[
'f'] =
make_field(inputFile,
"output of JAcousticEventBuilder[.sh]");
60 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
63 zap[
'T'] =
make_field(T_s) = JRange_t(0.0, 10.0);
64 zap[
'E'] =
make_field(
id,
"emitter identifier (-1 = all)") = -1;
69 catch(
const exception &error) {
70 FATAL(error.what() << endl);
85 for (JDetector::const_iterator i =
detector.begin(); i !=
detector.end(); ++i) {
86 receivers[i->getID()] = i->getLocation();
95 while (inputFile.hasNext()) {
97 STATUS(
"input " << setw(6) << inputFile.getCounter() <<
'\r');
DEBUG(endl);
99 const JEvent* evt = inputFile.next();
101 zbuf[evt->
getID()].push_back(*evt);
108 STATUS(
"Emitter " << setw(2) << emitter->first <<
' ' << setw(6) << emitter->second.size() << endl);
110 if (emitter->first ==
id ||
id == -1) {
112 if (emitter->second.size() > 1) {
114 sort(emitter->second.begin(), emitter->second.end());
118 if (!p->empty() && !q->empty()) {
120 DEBUG(
"Time difference " <<
FIXED(7,3) << q->begin()->getToE() - p->begin()->getToE() << endl);
122 if (T_s(q->begin()->getToE() - p->begin()->getToE())) {
129 JEvent::const_iterator __p = p->begin();
130 JEvent::const_iterator __q = q->begin();
132 while (__p != p->end() && __q != q->end()) {
134 while (__p != p->end() && __q != q->end() && __p->getID() < __q->getID()) { ++__p; }
135 while (__p != p->end() && __q != q->end() && __q->getID() < __p->getID()) { ++__q; }
137 if (__p != p->end() && __q != q->end() && __q->getID() == __p->getID()) {
139 if (receivers.has(__p->getID())) {
141 const JLocation& location = receivers[__p->getID()];
142 const double t1 = __q->getToA() - __p->getToA();
144 buffer[location] = t1;
152 if (buffer.size() > 1) {
156 if (p->first.getString() == q->first.getString() && p->first.getFloor() + 1 == q->first.getFloor()) {
158 const double t1 = q->second - p->second;
160 H1[p->first]->Fill(t1);
Utility class to parse command line options.
JComparator< JResult_t T::*, JComparison::lt > make_comparator(JResult_t T::*member)
Helper method to create comparator between values of data member.
Auxiliary data structure for floating point format specification.
Auxiliary class for defining the range of iterations of objects.
Auxiliary class to manage set of compatible ROOT objects (e.g. histograms) using unique keys...
Logical location of module.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
General purpose class for object reading from a list of file names.
const JLimit & getLimit() const
Get limit.
do set_variable DETECTOR_TXT $WORKDIR detector
int getID() const
Get identifier.
#define DEBUG(A)
Message macros.