56 tripods_container tripods;
57 hydrophones_container hydrophones;
63 JParser<> zap(
"Example program to plot acoustic fit results.");
65 zap[
'f'] =
make_field(inputFile,
"input file (output of JKatoomba)");
66 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
72 zap[
'E'] =
make_field(
id,
"emitter identifier (-1 = all)") = -1;
77 catch(
const exception &error) {
78 FATAL(error.what() << endl);
94 for (JDetector::const_iterator i =
detector.begin(); i !=
detector.end(); ++i) {
95 receivers[i->getID()] = i->getLocation();
98 for (tripods_container::const_iterator i = tripods.begin(); i != tripods.end(); ++i) {
99 emitters[i->getID()] =
JEmitter(i->getID(),
100 i->getUTMPosition() -
detector.getUTMPosition());
115 JTreeScanner_t::iterator p =
in.begin();
117 while (inputFile.hasNext()) {
119 STATUS(
"event: " << setw(10) << inputFile.getCounter() <<
'\r');
DEBUG(endl);
121 const JEvt* evt = inputFile.next();
124 DEBUG(
"model" << endl << model << endl);
126 for ( ; p !=
in.end() && p-> begin()->getToA() < evt->
UNIXTimeStart - 0.5; ++p) {}
128 JTreeScanner_t::iterator q = p;
130 for ( ; q !=
in.end() && q->rbegin()->getToA() <= evt->
UNIXTimeStop + 0.5; ++q) {}
134 for (JTreeScanner_t::iterator i = p; i != q; ++i) {
136 if (
id == i->getID() ||
id == -1) {
138 if (emitters.has(i->getID())) {
140 const JEmitter& emitter = emitters[i->getID()];
142 for (JEvent::const_iterator hit = i->begin(); hit != i->end(); ++hit) {
144 if (receivers.has(hit->getID())) {
146 const JLocation& location = receivers[hit->getID()];
152 const double Vi = V.getInverseVelocity(D, emitter.
getZ(), position.
getZ());
153 const double toa = hit->getToE() + D * Vi;
155 H2[hit->getID()]->Fill(hit->getToA() - toa);
Utility class to parse command line options.
do echo Generating $dir eval D
JModel getModel(const JEvt &evt)
Get model.
int getFloor() const
Get floor number.
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
*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 getDistance(const JVector3D &pos) const
Get distance to point.
Template definition for direct access of elements in ROOT TChain.
Model for fit to acoustics data.
double UNIXTimeStop
stop time
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...
Logical location of module.
Auxiliary wrapper for I/O of container with optional comment (see JComment).
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
const JPosition3D & getPosition() const
Get position.
Implementation for velocity of sound.
Base class for JTreeScanner.
JACOUSTICS::JModel::string_type string
int getString() const
Get string number.
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
double UNIXTimeStart
start time
General purpose class for object reading from a list of file names.
Data structure for position in three dimensions.
const JLimit & getLimit() const
Get limit.
do set_variable DETECTOR_TXT $WORKDIR detector
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY source JAcoustics sh $DETECTOR_ID typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
double getZ() const
Get z position.
#define DEBUG(A)
Message macros.