42{
45
48
50 JLimit_t& numberOfEvents = inputFile.getLimit();
52 string detectorFile;
55 int id;
57
58 try {
59
60 JParser<> zap(
"Example program to monitor acoustic events.");
61
62 zap[
'f'] =
make_field(inputFile,
"output of JAcousticEventBuilder[.sh]");
68 zap[
'E'] =
make_field(
id,
"emitter identifier (-1 = all)") = -1;
70
71 zap(argc, argv);
72 }
73 catch(const exception &error) {
74 FATAL(error.what() << endl);
75 }
76
77
79
80 try {
82 }
85 }
86
88
89 for (JDetector::const_iterator i =
detector.begin(); i !=
detector.end(); ++i) {
90 receivers[i->getID()] = i->getLocation();
91 }
92
93
95
96
98
100
102
104
105 zbuf[evt->
getID()].push_back(*evt);
106 }
108
109
111
112 STATUS(
"Emitter " << setw(2) << emitter->first <<
' ' << setw(6) << emitter->second.size() << endl);
113
114 if (emitter->first == id || id == -1) {
115
116 if (emitter->second.size() > 1) {
117
118 sort(emitter->second.begin(), emitter->second.end());
119
121
122 if (!p->empty() && !q->empty()) {
123
124 DEBUG(
"Time difference " <<
FIXED(7,3) << q->begin()->getToE() - p->begin()->getToE() << endl);
125
126 if (T_s(q->begin()->getToE() - p->begin()->getToE())) {
127
130
132
133 JEvent::const_iterator __p = p->begin();
134 JEvent::const_iterator __q = q->begin();
135
136 while (__p != p->end() && __q != q->end()) {
137
138 while (__p != p->end() && __q != q->end() && __p->getID() < __q->getID()) { ++__p; }
139 while (__p != p->end() && __q != q->end() && __q->getID() < __p->getID()) { ++__q; }
140
141 if (__p != p->end() && __q != q->end() && __q->getID() == __p->getID()) {
142
143 if (receivers.
has(__p->getID())) {
144
145 const JLocation& location = receivers[__p->getID()];
146 const double t1 = __q->getToA() - __p->getToA();
147
148 buffer[location] = t1;
149 }
150
151 ++__p;
152 ++__q;
153 }
154 }
155
156 if (buffer.size() > 1) {
157
159
160 if (p->first.getString() == q->first.getString() && p->first.getFloor() + 1 == q->first.getFloor()) {
161
162 const double t1 = q->second - p->second;
163
164 H1[p->first]->Fill(t1);
165 H1 ->Fill(t1);
166 }
167 }
168 }
169 }
170 }
171 }
172 }
173 }
174 }
175
176
178
179 out << H1 << *H1;
180
181 out.Write();
182 out.Close();
183}
#define DEBUG(A)
Message macros.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Logical location of module.
Utility class to parse command line options.
Auxiliary class to manage set of compatible ROOT objects (e.g. histograms) using unique keys.
General purpose class for object reading from a list of file names.
virtual bool hasNext() override
Check availability of next element.
counter_type getCounter() const
Get counter.
virtual const pointer_type & next() override
Get next element.
JAbstractHistogram< double > JHistogram_t
Type definition for scan along axis.
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
JComparator< JResult_t T::*, JComparison::lt > make_comparator(JResult_t T::*member)
Helper method to create comparator between values of data member.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary data structure for floating point format specification.
Type definition of range.
int getID() const
Get emitter identifier.
int getID() const
Get identifier.
Auxiliary class for defining the range of iterations of objects.
static counter_type max()
Get maximum counter value.