119{
122
126
129 JLimit_t& numberOfEvents = inputFile.getLimit();
135 double Q;
137
138 try {
139
140 JParser<> zap(
"Example program to plot hydrophone data.");
141
153
155 }
156 catch(const exception &error) {
158 }
159
160
162
163 try {
165 }
168 }
169
171
174
176
178
179 if (i->getLocation() == module->getLocation()) {
180
181 receivers[module->getID()] = JReceiver(module->getID(),
182 module->getPosition() + i->getPosition(),
183 module->getT0() * 1.0e-9);
184 break;
185 }
186 }
187 }
188
189 for (tripods_container::const_iterator i = tripods.begin(); i != tripods.end(); ++i) {
191 i->getUTMPosition() -
detector.getUTMPosition());
192 }
193
194 for (transmitters_container::const_iterator i = transmitters.begin(); i != transmitters.end(); ++i) {
195 try {
197 i->getPosition() +
detector.getModule(i->getLocation()).getPosition());
198 }
199 catch(const exception&) {
200 continue;
201 }
202 }
203
204
207
210
212
213
214 while (inputFile.hasNext()) {
215
217
218 const JEvent* evt = inputFile.next();
219
221
223
224 for (JEvent::const_iterator
hit = evt->begin();
hit != evt->end(); ++
hit) {
225 if (receivers.has(
hit->getID())) {
226 buffer[
hit->getID()].push_back(*
hit);
227 }
228 }
229
231
233
235
236 if (
hit->getQ() >= Q) {
237
240
243
244 const double t0 = evt->begin()->getToE() + D *
Vi;
245 const double t1 =
hit->getToA() - t0;
246
247 H1[key_type(
hit->getID(), evt->
getID())]->Fill(t1);
248
249 const double Q =
log10(
hit->getQ());
250
251 if (
T0(t1)) { h0.Fill(Q); }
252 if (
T1(t1)) { h1.Fill(Q); }
253 }
254 }
255 }
256 }
258
260
261 out << h0 << h1 <<
H1;
262
263 out.Write();
264 out.Close();
265}
#define DEBUG(A)
Message macros.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
#define MAKE_CSTRING(A)
Make C-string.
Data structure for position in three dimensions.
double getDistance(const JVector3D &pos) const
Get distance to point.
double getZ() const
Get z position.
Template definition of a multi-dimensional oscillation probability interpolation table.
static JEmitterID getEmitterID
Function object for emitter identification.
JContainer< std::vector< JTripod > > tripods_container
JContainer< std::vector< JTransmitter > > transmitters_container
JContainer< std::vector< JHydrophone > > hydrophones_container
static const JSoundVelocity getSoundVelocity(1541.0, -17.0e-3, -2000.0)
Function object for velocity of sound.
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).
int getID() const
Get emitter identifier.
Implementation for depth dependend velocity of sound.
JSoundVelocity & set(const double z0)
Set depth.
virtual double getInverseVelocity(const double D_m, const double z1, const double z2) const override
Get inverse velocity of sound.
double getQ() const
Get quality.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Auxiliary class for defining the range of iterations of objects.
static counter_type max()
Get maximum counter value.