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();
73 zap[
'E'] =
make_field(
id,
"emitter identifier (-1 = all)") = -1;
78 catch(
const exception &error) {
79 FATAL(error.what() << endl);
95 for (JDetector::const_iterator i =
detector.begin(); i !=
detector.end(); ++i) {
96 receivers[i->getID()] = i->getLocation();
99 for (tripods_container::const_iterator i = tripods.begin(); i != tripods.end(); ++i) {
100 emitters[i->getID()] =
JEmitter(i->getID(),
101 i->getUTMPosition() -
detector.getUTMPosition());
116 JTreeScanner_t::iterator p =
in.begin();
118 while (inputFile.hasNext()) {
120 STATUS(
"event: " << setw(10) << inputFile.getCounter() <<
'\r');
DEBUG(endl);
122 const JEvt* evt = inputFile.next();
125 DEBUG(
"model" << endl << model << endl);
127 for ( ; p !=
in.end() && p-> begin()->getToA() < evt->
UNIXTimeStart - 0.5; ++p) {}
129 JTreeScanner_t::iterator q = p;
131 for ( ; q !=
in.end() && q->rbegin()->getToA() <= evt->
UNIXTimeStop + 0.5; ++q) {}
135 for (JTreeScanner_t::iterator i = p; i != q; ++i) {
137 if (
id == i->getID() ||
id == -1) {
139 if (emitters.has(i->getID())) {
141 const JEmitter& emitter = emitters[i->getID()];
143 for (JEvent::const_iterator hit = i->begin(); hit != i->end(); ++hit) {
145 if (receivers.has(hit->getID())) {
147 const JLocation& location = receivers[hit->getID()];
153 const double Vi = V.getInverseVelocity(D, emitter.
getZ(), position.
getZ());
154 const double toa = hit->getToE() + D * Vi;
156 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.
static JDetectorMechanics getMechanics
Function object to get string mechanics.
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.
then usage $script< input_file >< detector_file > fi set_variable OUTPUT_DIR set_variable SELECTOR JDAQTimesliceL1 set_variable DEBUG case set_variable DEBUG
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 CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
double getZ() const
Get z position.