129 tripods_container tripods;
130 hydrophones_container hydrophones;
135 JParser<> zap(
"Example program to plot hydrophone data.");
138 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
143 zap[
'T'] =
make_field(tripods,
"tripod data");
149 catch(
const exception &error) {
150 FATAL(error.what() << endl);
170 for (hydrophones_container::const_iterator i = hydrophones.begin(); i != hydrophones.end(); ++i) {
172 for (JDetector::const_iterator module =
detector.begin(); module !=
detector.end(); ++module) {
174 if (i->getLocation() == module->getLocation()) {
176 receivers[module->getID()] =
JReceiver(module->getID(),
177 module->getPosition() + i->getPosition(),
178 module->getT0() * 1.0e-9);
184 for (tripods_container::const_iterator i = tripods.begin(); i != tripods.end(); ++i) {
185 emitters[i->getID()] =
JEmitter(i->getID(),
186 i->getUTMPosition() -
detector.getUTMPosition());
192 while (inputFile.hasNext()) {
194 STATUS(
"event: " << setw(10) << inputFile.getCounter() <<
'\r');
DEBUG(endl);
196 const JEvent* evt = inputFile.next();
199 buffer[evt->
getID()].push_back((*evt)[0].getToE());
207 for (
int counter = 0; toashortFile.hasNext(); ++counter) {
209 if (counter%1000 == 0) {
210 STATUS(
"counter: " << setw(8) << counter <<
'\r' << flush);
DEBUG(endl);
217 if (emitters.has(
id) && receivers.has(parameters->
DOMID) && !buffer[id].empty()) {
221 const JTransmission transmission = transceiver.getTransmission(*parameters, V);
223 double t1 = numeric_limits<double>::max();
224 double w1 = 1.0 / (double) buffer[
id].size();
228 const double ti = transmission.
getToE() - *i;
230 if (fabs(ti) < fabs(t1)) {
235 H1[key_type(parameters->
DOMID,
id)]->Fill(t1, w1);
Utility class to parse command line options.
static JEmitterID & getEmitterID
Function object for emitter identification.
*fatal Wrong number of arguments esac JCookie sh typeset Z DETECTOR typeset Z SOURCE_RUN typeset Z TARGET_RUN set_variable PARAMETERS_FILE $WORKDIR parameters
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
double getToE() const
Get estimated time of emission.
Auxiliary class for defining the range of iterations of objects.
static const JSoundVelocity getSoundVelocity(1541.0,-17.0e-3,-2000.0)
Function object for velocity of sound.
Auxiliary class to manage set of compatible ROOT objects (e.g. histograms) using unique keys...
Auxiliary wrapper for I/O of container with optional comment (see JComment).
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Implementation for velocity of sound.
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.
int EMITTERID
waveform identifier
#define DEBUG(A)
Message macros.