236   transmitters_container  transmitters;                         
 
  237   hydrophones_container   hydrophones;                          
 
  240   disable_container       disable;                              
 
  247     JParser<> zap(
"Application to fit position calibration model to acoustic data.");
 
  249     zap[
'f'] = 
make_field(inputFile,       
"output of JAcousticEventBuilder[.sh]");
 
  251     zap[
'n'] = 
make_field(numberOfEvents)                                    = JLimit::max();
 
  259     zap[
'u'] = 
make_field(unify,           
"unify weighing of pings");
 
  261     zap[
'N'] = 
make_field(jobs,            
"number of parallel jobs")        = 1;
 
  262     zap[
'D'] = 
make_field(Tmax_s,          
"deadtime [s]")                   = 100.0e-3;
 
  267   catch(
const exception &error) {
 
  268     FATAL(error.what() << endl);
 
  271   ROOT::EnableThreadSafety();
 
  273   const int sleep_us = 100;                                           
 
  287   for (JDetector::const_iterator i = 
detector.begin(); i != 
detector.end(); ++i) {
 
  288     receivers[i->getID()] = i->getLocation();
 
  291   for (tripods_container::const_iterator i = 
tripods.begin(); i != 
tripods.end(); ++i) {
 
  292     emitters[i->getID()]  = 
JEmitter(i->getID(),
 
  293                                      i->getUTMPosition() - 
detector.getUTMPosition());
 
  296   for (transmitters_container::const_iterator i = transmitters.begin(); i != transmitters.end(); ++i) {
 
  298       emitters[i->getID()]  = 
JEmitter(i->getID(),
 
  301     catch(
const exception&) {
 
  317     for (
const string& file_name : inputFile) {
 
  325         if      (JFremantle::oid == 
"")
 
  326           JFremantle::oid = evt->
getOID();
 
  327         else if (JFremantle::oid != evt->
getOID()) 
 
  328           FATAL(
"Invalid detector identifier " << evt->
getOID() << 
" != " << JFremantle::oid << endl);
 
  331           zmap[evt->begin()->getToE()] = file_name;
 
  340       inputFile.push_back(i->second);
 
  360     JFremantle fremantle(katoomba, jobs);
 
  362     typedef deque<JEvent> buffer_type;
 
  364     for (buffer_type zbuf; inputFile.hasNext(); ) {
 
  366       STATUS(inputFile.getFilename() << 
'\r'); 
DEBUG(endl);
 
  370       for (
const string file_name = inputFile.getFilename(); inputFile.hasNext() && file_name == inputFile.getFilename(); ) {
 
  372         const JEvent* evt = inputFile.next();
 
  374         if (emitters.has(evt->
getID())) {
 
  375           zbuf.push_back(*evt);
 
  379       sort(zbuf.begin(), zbuf.end());                
 
  381       for (buffer_type::iterator p = zbuf.begin(), q; p != zbuf.end(); p = q) {
 
  383         for (q = p; ++q != zbuf.end() && q->begin()->getToE() <= p->rbegin()->getToE() + 
parameters.Tmax_s; ) {}
 
  385         if (q == zbuf.end()) {
 
  387           if (inputFile.hasNext()) {
 
  389             zbuf.erase(zbuf.begin(), p);             
 
  401           for (buffer_type::const_iterator i = p; i != q; ++i) {
 
  402             numberOfPings[i->getID()] += 1;
 
  405           int minimum_number_of_pings = numeric_limits<int>::max();
 
  408             minimum_number_of_pings = min(minimum_number_of_pings, i->second);
 
  414           for (buffer_type::iterator evt = p; evt != q; ++evt) {
 
  416             sort(evt->begin(), evt->end(), 
compare);
 
  421             const double    weight  = (unify ? (double) minimum_number_of_pings / (
double) numberOfPings[evt->getID()] : 1.0);
 
  423             for (
JEvent::const_iterator i = evt->begin(); i != __end; ++i) {
 
  428                 if (receivers.has(i->getID()) && geometry.hasLocation(receivers[i->getID()]) && i->getQ() >= 
parameters.Qmin * (unit(
parameters.Qmin) ? i->getW() : 1.0)) {
 
  430                   data.push_back(
JHit(emitter,
 
  432                                       receivers[i->getID()],
 
  437                   buffer.insert(evt->
getID());
 
  445             while (fremantle.backlog() > jobs) {
 
  446               this_thread::sleep_for(chrono::microseconds(sleep_us));
 
  449             fremantle.enqueue(data);
 
  456   catch(
const exception& error) {
 
  457     FATAL(
"main " << error.what());
 
Worker class for complete fit procedure of acoustic model. 
 
Utility class to parse command line options. 
 
void overlap(T p, T q, const double Tmax_s)
Empty overlapping events. 
 
Q(UTCMax_s-UTCMin_s)-livetime_s
 
JComparator< JResult_t T::*, JComparison::lt > make_comparator(JResult_t T::*member)
Helper method to create comparator between values of data member. 
 
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)...
 
V(JDAQEvent-JTriggerReprocessor)*1.0/(JDAQEvent+1.0e-10)
 
size_t getNumberOfEmitters(T __begin, T __end)
Get number of emitters. 
 
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 wrapper for I/O of container with optional comment (see JComment). 
 
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object 
 
const std::string & getOID() const 
Get detector identifier. 
 
JPosition3D getPosition(const Vec &pos)
Get position. 
 
static struct JACOUSTICS::@4 compare
Auxiliary data structure to sort transmissions. 
 
Implementation for depth dependend 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 echo n Creating graphics for string $STRING for((FLOOR=$FIRST_FLOOR;$FLOOR<=$LAST_FLOOR;FLOOR+=1))
 
do set_variable DETECTOR_TXT $WORKDIR detector
 
int getID() const 
Get identifier. 
 
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 JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
 
Acoustic transmission identifier. 
 
Auxiliary data structure for floating point format specification. 
 
Template definition of fit function of acoustic model. 
 
#define DEBUG(A)
Message macros.