Jpp  19.0.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JBillabong.cc
Go to the documentation of this file.
1 #include <string>
2 #include <iostream>
3 #include <iomanip>
4 #include <vector>
5 #include <algorithm>
6 #include <chrono>
7 
8 #include "TROOT.h"
9 #include "TFile.h"
10 #include "TH1D.h"
11 
12 #include "JDetector/JDetector.hh"
15 
16 #include "JLang/JPredicate.hh"
17 #include "JLang/JComparator.hh"
18 
19 #include "JTools/JHashMap.hh"
21 
24 #include "JSupport/JMeta.hh"
25 
27 #include "JGeometry3D/JOmega3D.hh"
29 
30 #include "JAcoustics/JToA.hh"
32 #include "JAcoustics/JReceiver.hh"
35 #include "JAcoustics/JEvent.hh"
37 #include "JAcoustics/JSupport.hh"
38 
39 #include "Jeep/JProperties.hh"
40 #include "Jeep/JPrint.hh"
41 #include "Jeep/JParser.hh"
42 #include "Jeep/JMessage.hh"
43 
44 #include "JTrigger/JMatch.hh"
45 #include "JTrigger/JAlgorithm.hh"
46 #include "JTrigger/JBind2nd.hh"
47 
48 
49 namespace JACOUSTICS {
50 
53  using JTRIGGER::JMatch;
54  using JTRIGGER::JClonable;
55  using JTRIGGER::JBind2nd;
57 
58  /**
59  * Type definition for scan along axis
60  */
62 
63 
64  /**
65  * Acoustic hit.
66  */
67  struct hit_type :
68  public JPosition3D,
69  public JTransmission
70  {
71  /**
72  * Default constructor.
73  */
75  {}
76 
77 
78  /**
79  * Constructor.
80  *
81  * \param position position
82  * \param transmission transmission
83  */
84  hit_type(const JPosition3D& position, const JTransmission& transmission) :
85  JPosition3D (position),
86  JTransmission(transmission)
87  {}
88  };
89 
90 
91  /**
92  * 3D match criterion for acoustic signals.
93  */
94  class JMatch3D :
95  public JClonable< JMatch<hit_type>, JMatch3D>
96  {
97  public:
98  /**
99  * Constructor.
100  *
101  * \param V sound velocity [m/s]
102  * \param Dmax_m maximal distance [m]
103  * \param Tmax_s maximal extra time [s]
104  */
105  JMatch3D(const double V, const double Dmax_m, const double Tmax_s) :
106  V(V),
107  Dmax_m(Dmax_m),
108  Tmax_s(Tmax_s)
109  {}
110 
111 
112  /**
113  * Match operator.
114  *
115  * \param first hit
116  * \param second hit
117  * \return match result
118  */
119  virtual bool operator()(const hit_type& first, const hit_type& second) const override
120  {
121  using namespace JPP;
122 
123  const double D = getDistance(first.getPosition(), second.getPosition());
124 
125  if (D <= Dmax_m)
126  return fabs(first.getToA() - second.getToA()) <= D / V + Tmax_s;
127  else
128  return false;
129  }
130 
131  private:
132  const double V;
133  const double Dmax_m;
134  const double Tmax_s;
135  };
136 
137 
138  /**
139  * 1D match criterion for acoustic signals.
140  */
141  class JMatch1D :
142  public JClonable< JMatch<hit_type>, JMatch1D>
143  {
144  public:
145  /**
146  * Constructor.
147  *
148  * \param V sound velocity [m/s]
149  * \param Rmax_m maximal radial distance [m]
150  * \param Zmax_m maximal vertical distance [m]
151  * \param Tmax_s maximal extra time [s]
152  */
153  JMatch1D(const double V, const double Rmax_m, const double Zmax_m, const double Tmax_s) :
154  V(V),
155  Rmax_m(Rmax_m),
156  Zmax_m(Zmax_m),
157  Tmax_s(Tmax_s)
158  {}
159 
160 
161  /**
162  * Match operator.
163  *
164  * \param first hit
165  * \param second hit
166  * \return match result
167  */
168  virtual bool operator()(const hit_type& first, const hit_type& second) const override
169  {
170  /*
171  const double x = first.getX() - second.getX();
172  const double y = first.getY() - second.getY();
173  const double z = first.getZ() - second.getZ();
174 
175  if (fabs(z) <= Zmax_m) {
176 
177  const double R = sqrt(x*x + y*y);
178 
179  if (R <= Rmax_m) {
180  return fabs(first.getToA() - second.getToA()) <= sqrt(R*R + z*z) / V + Tmax_s;
181  }
182  }
183 
184  return false;
185  */
186  return fabs(first.getZ() - second.getZ()) <= Zmax_m;
187  }
188 
189  private:
190  const double V;
191  const double Rmax_m;
192  const double Zmax_m;
193  const double Tmax_s;
194  };
195 
196 
197  /**
198  * Auxiliary data structure for final check on event.
199  */
200  struct JCheck {
201  /**
202  * Constructor.
203  *
204  * \param X x-scan
205  * \param Y y-scan
206  * \param Z z-scan
207  * \param V sound velocity [m/s]
208  * \param Tmax_s maximal time [s]
209  * \param Nmin minimum number of hits
210  */
212  const JHistogram_t& Y,
213  const JHistogram_t& Z,
214  const double V,
215  const double Tmax_s,
216  const int Nmin) :
217  V(V),
218  Dmax_m(Tmax_s * V),
219  Nmin(Nmin)
220  {
221  for (double x = X.getLowerLimit(); x < X.getUpperLimit() + 0.5*X.getBinWidth(); x += X.getBinWidth()) {
222  for (double y = Y.getLowerLimit(); y < Y.getUpperLimit() + 0.5*Y.getBinWidth(); y += Y.getBinWidth()) {
223  for (double z = Z.getLowerLimit(); z < Z.getUpperLimit() + 0.5*Z.getBinWidth(); z += Z.getBinWidth()) {
224  U.push_back(JVector3D(x,y,z));
225  }
226  }
227  }
228  }
229 
230 
231  /**
232  * Check validity.
233  *
234  * \return true if valid; else false
235  */
236  bool is_valid() const
237  {
238  return !U.empty();
239  }
240 
241 
242  /**
243  * Check event.
244  *
245  * \param root root hit
246  * \param __begin begin of data
247  * \param __end end of data
248  * \return true if accepted; else false
249  */
250  template<class T>
251  inline bool operator()(const hit_type& root, T __begin, T __end) const
252  {
253  using namespace std;
254  using namespace JPP;
255 
256  for (vector<JVector3D>::const_iterator u = U.begin(); u != U.end(); ++u) {
257 
258  const JVector3D p0 = root.getPosition() + *u; // vertex position
259  const double t0 = root.getToA() * V - u->getLength(); // vertex time
260 
261  int n = 1;
262 
263  for (T p = __begin; p != __end; ++p) {
264 
265  const double t1 = p->getToA() * V - p0.getDistance(*p);
266 
267  if (fabs(t1 - t0) <= Dmax_m) {
268  n += 1;
269  } else if (n + distance(p,__end) == Nmin) {
270  break;
271  }
272  }
273 
274  if (n >= Nmin) {
275  return true;
276  }
277  }
278 
279  return false;
280  }
281 
282  private:
284  const double V;
285  const double Dmax_m;
286  const int Nmin;
287  };
288 
289 
290  /**
291  * Print event.
292  *
293  * \param out output stream
294  * \param event event
295  */
296  inline void print(std::ostream& out, const JEvent& event)
297  {
298  using namespace std;
299 
300  out << "event: " << setw(6) << event.getCounter() << ' ' << FIXED(12,2) << 0.5 * (event.begin()->getToA() + event.rbegin()->getToA()) << " [s] " << setw(4) << event.size() << endl;
301  }
302 }
303 
304 
305 /**
306  * \file
307  *
308  * Main program to trigger acoustic data.
309  *
310  * An acoustic event is based on coincidences between times of arrival.\n
311  * If the number of coincident times of arrival exceeds a preset minimum,
312  * the event is triggered and subsequently stored in the output file.
313  * \author mdejong
314  */
315 int main(int argc, char **argv)
316 {
317  using namespace std;
318  using namespace JPP;
319 
321 
322  JMultipleFileScanner<JToA> inputFile;
323  JLimit_t& numberOfEvents = inputFile.getLimit();
324 
325  struct {
326  int factoryLimit = 100000;
327  int numberOfHits = 0;
328  double Q = 0.0;
329  double TMax_s = 0.0;
330  double DMax_m = 500.0;
331  double ZMax_m = 200.0;
332  double TMaxExtra_s = 100.0e-6;
333  double TMaxVertex_s = 1.0e-2;
334  double gridAngle_deg = 10.0;
335  } parameters;
336 
337  JHistogram_t X;
338  JHistogram_t Y;
339  JHistogram_t Z;
341  JSoundVelocity V = getSoundVelocity; // default sound velocity
342  string detectorFile;
343  int waveform;
344  int debug;
345 
346  try {
347 
348  JProperties properties;
349 
350  properties.insert(gmake_property(parameters.factoryLimit));
351  properties.insert(gmake_property(parameters.numberOfHits));
352  properties.insert(gmake_property(parameters.Q));
353  properties.insert(gmake_property(parameters.TMax_s));
354  properties.insert(gmake_property(parameters.DMax_m));
355  properties.insert(gmake_property(parameters.ZMax_m));
356  properties.insert(gmake_property(parameters.TMaxExtra_s));
357  properties.insert(gmake_property(parameters.TMaxVertex_s));
358  properties.insert(gmake_property(parameters.gridAngle_deg));
359 
360  JParser<> zap("Main program to trigger acoustic data.");
361 
362  zap['f'] = make_field(inputFile);
363  zap['n'] = make_field(numberOfEvents) = JLimit::max();
364  zap['@'] = make_field(properties, "trigger parameters") = JPARSER::initialised();
365  zap['X'] = make_field(X, "x-scan");
366  zap['Y'] = make_field(Y, "y-scan");
367  zap['Z'] = make_field(Z, "z-scan");
368  zap['o'] = make_field(outputFile, "output file") = "event.root";
369  zap['V'] = make_field(V, "sound velocity") = JPARSER::initialised();
370  zap['a'] = make_field(detectorFile, "detector file");
371  zap['W'] = make_field(waveform, "waveform identifier");
372  zap['d'] = make_field(debug) = 1;
373 
374  zap(argc, argv);
375  }
376  catch(const exception &error) {
377  FATAL(error.what() << endl);
378  }
379 
381 
382  try {
383  load(detectorFile, detector);
384  }
385  catch(const JException& error) {
386  FATAL(error);
387  }
388 
389  V.set(detector.getUTMZ());
390 
391  const JCylinder3D cylinder(detector.begin(), detector.end());
392 
393  const double v0 = V(cylinder.getZmax());
394 
395  if (parameters.TMax_s < parameters.DMax_m / v0) {
396 
397  parameters.TMax_s = parameters.DMax_m / v0;
398 
399  NOTICE("Set maximal time [s] " << FIXED(7,3) << parameters.TMax_s << endl);
400  }
401 
402  const JMatch3D match3D(v0, parameters.DMax_m, parameters.TMaxExtra_s);
403  const JMatch1D match1D(v0, parameters.DMax_m, parameters.ZMax_m, parameters.TMaxExtra_s);
404 
405  const JEventOverlap overlap(parameters.TMax_s);
406 
407  const JCheck check(X, Y, Z, v0, parameters.TMaxVertex_s, parameters.numberOfHits);
408 
409  const JOmega3D omega(JAngle3D(0.0, 0.0), JOmega3D::range_type(0.0, 0.5*PI), parameters.gridAngle_deg * PI / 180.0);
410  const JRotator3D rotator(omega);
411 
412 
413  JHashMap<int, JReceiver> receivers;
414 
415  const JPosition3D center(cylinder.getX(), cylinder.getY(), 0.5 * (cylinder.getZmin() + cylinder.getZmax()));
416 
417  for (JDetector::const_iterator module = detector.begin(); module != detector.end(); ++module) {
418 
419  if (module->getFloor() != 0) {
420 
421  receivers[module->getID()] = JReceiver(module->getID(),
422  module->getPosition() + getPiezoPosition() - center,
423  module->getT0() * 1.0e-9);
424  }
425  }
426 
427  TH1D h0("h0", NULL, 21, -0.5, 20.5);
428 
429  vector<TH1D*> M1(10, NULL);
430 
431  for (size_t i = 2; i <= 5; ++i) {
432  M1[i] = new TH1D(MAKE_CSTRING("M[" << i << "]"), NULL, 1001, -0.5, 1000.5);
433  }
434 
435  outputFile.open();
436 
437  if (!outputFile.is_open()) {
438  FATAL("Error opening file " << outputFile << endl);
439  }
440 
441  outputFile.put(JMeta(argc, argv));
442 
443  // input data
444 
445  typedef vector<hit_type> buffer_type; // data type
446 
448 
449  while (inputFile.hasNext()) {
450 
451  if (inputFile.getCounter()%1000 == 0) {
452  STATUS("counter: " << setw(8) << inputFile.getCounter() << '\r' << flush); DEBUG(endl);
453  }
454 
455  const JToA* p = inputFile.next();
456 
457  if (detector.getID() != p->DETID) { // consistency check
458  FATAL("Invalid detector identifier " << p->DETID << " != " << detector.getID() << endl);
459  }
460 
461  if (p->WAVEFORMID == waveform && receivers.has(p->DOMID)) {
462 
463  if (p->QUALITYFACTOR >= parameters.Q * (parameters.Q <= 1.0 ? p->QUALITYNORMALISATION : 1.0)) {
464 
465  const JReceiver& receiver = receivers[p->DOMID];
466 
467  const double toa = p->TOA_S();
468 
469  const JTransmission transmission(p->RUN,
470  p->DOMID,
471  p->QUALITYFACTOR,
473  receiver.getT(toa),
474  receiver.getT(toa));
475 
476  data.push_back(hit_type(receiver.getPosition(), transmission));
477  }
478  }
479  }
480  STATUS(endl);
481 
482 
483  sort(data.begin(), data.end(), make_comparator(&hit_type::getToA, JComparison::lt())); // sort according time-of-arrival
484 
485 
486  buffer_type buffer(parameters.factoryLimit); // local buffer of hits
487  JEvent out[2]; // FIFO of events
488 
489  const chrono::steady_clock::time_point t0 = chrono::steady_clock::now();
490 
491  size_t trigger_counter = 0;
492 
493  for (buffer_type::const_iterator p = data.begin(), q = p; p != data.end(); ++p) {
494 
495  if (distance(data.cbegin(),p)%10000 == 0) {
496  //STATUS("processed: " << FIXED(5,1) << (double) (100 * distance(data.cbegin(),p)) / (double) data.size() << "%" << ' ' << FIXED(12,2) << p->getToA() << " [s]" << '\r' << flush); DEBUG(endl);
497 
498  const chrono::steady_clock::time_point t1 = chrono::steady_clock::now();
499 
500  STATUS("processed: "
501  << FIXED(5,1) << (double) (100 * distance(data.cbegin(),p)) / (double) data.size() << "%" << ' '
502  << FIXED(8,1) << p->getToA() << " [s]" << ' '
503  << setw(6) << chrono::duration_cast<chrono::seconds>(t1 - t0).count() << " [s]" << ' '
504  << setw(6) << trigger_counter << endl);
505  }
506 
507  h0.Fill(0.0);
508 
509  while (q != data.end() && q->getToA() - p->getToA() <= parameters.TMax_s) { ++q; }
510 
511  if (distance(p,q) >= parameters.numberOfHits) {
512 
513  h0.Fill(1.0);
514 
515  if (distance(p,q) < parameters.factoryLimit) {
516 
517  h0.Fill(2.0);
518 
519  buffer_type::iterator root = buffer.begin();
520  buffer_type::iterator __p = buffer.begin();
521  buffer_type::iterator __q = buffer.begin();
522 
523  *root = *p;
524 
525  ++__p;
526  ++__q;
527 
528  for (buffer_type::const_iterator i = p; ++i != q; ) {
529  if (match3D(*root,*i)) {
530  *(__q++) = *i;
531  }
532  }
533 
534  M1[2]->Fill(distance(root,__q));
535 
536  if (distance(root,__q) >= parameters.numberOfHits) {
537 
538  h0.Fill(3.0);
539 
540  __q = clusterize(__p, __q, match3D);
541 
542  M1[3]->Fill(distance(root,__q));
543 
544  if (distance(root,__q) >= parameters.numberOfHits) {
545 
546  h0.Fill(4.0);
547 
548  const double W = 1.0 / (double) rotator.size();
549 
550  for (const JRotation3D& R : rotator) {
551 
552  for (buffer_type::iterator i = root; i != __q; ++i) {
553  i->rotate(R);
554  }
555 
556  buffer_type::iterator __z = partition(__p, __q, JBind2nd(match1D,*root));
557 
558  M1[4]->Fill(distance(root,__z), W);
559 
560  if (distance(root,__z) >= parameters.numberOfHits) {
561 
562  h0.Fill(5.0, W);
563 
564  __z = clusterize(__p, __z, match1D);
565 
566  M1[5]->Fill(distance(root,__z), W);
567 
568  if (distance(root,__z) >= parameters.numberOfHits) {
569 
570  h0.Fill(6.0, W);
571 
572  if (!check.is_valid() || check(*root, __p, __z)) {
573 
574  trigger_counter += 1;
575 
576  h0.Fill(7.0, W);
577 
578  out[1] = JEvent(detector.getID(), out[0].getCounter() + 1, waveform, p, q);
579 
580  break;
581  }
582  }
583  }
584  }
585  }
586  }
587 
588  } else {
589 
590  trigger_counter += 1;
591 
592  out[1] = JEvent(detector.getID(), out[0].getCounter() + 1, waveform, p, q);
593  }
594 
595  if (!out[1].empty()) {
596 
597  if (out[0].empty()) {
598 
599  out[0] = out[1]; // shift
600 
601  } else if (overlap(out[0],out[1])) {
602 
603  out[0].merge(out[1]); // merge
604 
605  } else {
606 
607  if (debug >= notice_t) { print(cout, out[0]); }
608 
609  outputFile.put(out[0]); // write
610 
611  out[0] = out[1]; // shift
612  }
613  }
614 
615  out[1].clear();
616  }
617  }
618 
619  if (!out[0].empty()) {
620 
621  if (debug >= notice_t) { print(cout, out[0]); }
622 
623  outputFile.put(out[0]); // write
624  }
625  STATUS(endl);
626 
627  outputFile.put(h0);
628 
629  for (TH1D* h1 : M1) {
630  if (h1 != NULL) {
631  outputFile.put(*h1);
632  }
633  }
634 
635  JMultipleFileScanner<JMeta> io(inputFile);
636 
637  io >> outputFile;
638 
639  outputFile.close();
640 }
Auxiliary class for ROOT I/O of application specific meta data.
Definition: JMeta.hh:70
hit_type(const JPosition3D &position, const JTransmission &transmission)
Constructor.
Definition: JBillabong.cc:84
Data structure for angles in three dimensions.
Definition: JAngle3D.hh:33
Object writing to file.
Utility class to parse command line options.
Definition: JParser.hh:1711
General exception.
Definition: JException.hh:24
Module support kit.
1D match criterion.
Definition: JMatch1D.hh:31
Acoustic receiver.
Definition: JReceiver.hh:27
Q(UTCMax_s-UTCMin_s)-livetime_s
const double Dmax_m
Definition: JBillabong.cc:133
T getLowerLimit() const
Get lower limit.
Definition: JRange.hh:202
int main(int argc, char *argv[])
Definition: Main.cc:15
JMatch1D(const double V, const double Rmax_m, const double Zmax_m, const double Tmax_s)
Constructor.
Definition: JBillabong.cc:153
JComparator< JResult_t T::*, JComparison::lt > make_comparator(JResult_t T::*member)
Helper method to create comparator between values of data member.
Sound velocity.
void print(std::ostream &out, const JEvent &event)
Print event.
Definition: JBillabong.cc:296
JBinder2nd< JHit_t > JBind2nd(const JMatch< JHit_t > &match, const JHit_t &second)
Auxiliary method to create JBinder2nd object.
Definition: JBind2nd.hh:66
Algorithms for hit clustering and sorting.
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
General purpose class for hash map of unique keys.
Definition: JHashMap.hh:72
#define gmake_property(A)
macros to convert (template) parameter to JPropertiesElement object
const double Zmax_m
Definition: JBillabong.cc:192
General purpose class for hash map of unique elements.
#define STATUS(A)
Definition: JMessage.hh:63
ROOT TTree parameter settings.
Detector data structure.
Definition: JDetector.hh:89
1D match criterion for acoustic signals.
Definition: JBillabong.cc:141
Match of two events considering overlap in time.
Recording of objects on file according a format that follows from the file name extension.
Rotation matrix.
Definition: JRotation3D.hh:111
virtual bool operator()(const hit_type &first, const hit_type &second) const override
Match operator.
Definition: JBillabong.cc:119
notice
Definition: JMessage.hh:32
Utility class to parse parameter values.
Definition: JProperties.hh:497
then usage else fatal Wrong number of arguments fi JCookie sh eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O CAN eval JPrintDetector a $DETECTOR O SUMMARY source JAcousticsToolkit sh expand_array RUNS for KEY in sound_velocity waveform
then usage $script< input file >[option] nPossible options count
Definition: JVolume1D.sh:31
int32_t WAVEFORMID
DOM unique identifeir.
Definition: JToA.hh:33
*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
Definition: diff-Tuna.sh:38
#define MAKE_CSTRING(A)
Make C-string.
Definition: JPrint.hh:136
Acoustic event.
JCheck(const JHistogram_t &X, const JHistogram_t &Y, const JHistogram_t &Z, const double V, const double Tmax_s, const int Nmin)
Constructor.
Definition: JBillabong.cc:211
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Definition: JParser.hh:84
Time-of-arrival data from acoustic piezo sensor or hydrophone.
Definition: JToA.hh:25
Direction set covering (part of) solid angle.
Definition: JOmega3D.hh:66
Function object interface for hit matching.
Definition: JMatch.hh:25
then fatal Wrong number of arguments fi set_variable STRING $argv[1] set_variable DETECTORXY_TXT $WORKDIR $DETECTORXY_TXT tail read X Y CHI2 RMS printf optimum n $X $Y $CHI2 $RMS awk v Y
Auxiliary data structure for floating point format specification.
Definition: JManip.hh:446
3D match criterion for acoustic signals.
Simple data structure for histogram binning.
string outputFile
double getDistance(const JVector3D &pos) const
Get distance to point.
Definition: JVector3D.hh:270
Data structure for detector geometry and calibration.
do JPlot2D f $WORKDIR canberra[${EMITTER}\] root
std::vector< JHitW0 > buffer_type
hits
Definition: JPerth.cc:70
Utility class to parse parameter values.
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first
double getDistance(const JFirst_t &first, const JSecond_t &second)
Get distance between objects.
JRange< int > range_type
Auxiliary data structure for final check on event.
Definition: JBillabong.cc:200
Type list.
Definition: JTypeList.hh:22
JFIT::JEvent JEvent
Definition: JHistory.hh:353
const int n
Definition: JPolint.hh:786
Auxiliary class for defining the range of iterations of objects.
Definition: JLimit.hh:41
static const JSoundVelocity getSoundVelocity(1541.0,-17.0e-3,-2000.0)
Function object for velocity of sound.
Base class for match operations for cluster and hit-preprocessing methods.
Acoustic transmission.
I/O formatting auxiliaries.
Cylinder object.
Definition: JCylinder3D.hh:39
Detector file.
Definition: JHead.hh:226
Data structure for vector in three dimensions.
Definition: JVector3D.hh:34
Acoustics toolkit.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:2158
int32_t RUN
detector identifier
Definition: JToA.hh:31
do set_variable OUTPUT_DIRECTORY $WORKDIR T
const double Dmax_m
Definition: JBillabong.cc:285
virtual bool operator()(const hit_type &first, const hit_type &second) const override
Match operator.
Definition: JBillabong.cc:168
ROOT I/O of application specific meta data.
T getUpperLimit() const
Get upper limit.
Definition: JRange.hh:213
Template class for object cloning.
Definition: JClonable.hh:20
#define NOTICE(A)
Definition: JMessage.hh:64
uint32_t QUALITYFACTOR
The ticks (16ns) part of the DAQ frame timestamp.
Definition: JToA.hh:37
static const double PI
Mathematical constants.
const JPosition3D & getPosition() const
Get position.
Definition: JPosition3D.hh:130
bool is_valid() const
Check validity.
Definition: JBillabong.cc:236
double getBinWidth() const
Get bin width.
double TOA_S() const
Time of Arrival, expressed in seconds relative to Unix epoch (1 January 1970 00:00:00 UTC) ...
Definition: JToAImp.cc:40
const double Rmax_m
Definition: JBillabong.cc:191
General purpose messaging.
uint32_t QUALITYNORMALISATION
A measure of how good the waveform match was to the signal.
Definition: JToA.hh:38
Implementation for depth dependend velocity of sound.
#define FATAL(A)
Definition: JMessage.hh:67
Scanning of objects from multiple files according a format that follows from the extension of each fi...
double getT(const double t_s) const
Get corrected time.
Definition: JReceiver.hh:72
Acoustic receiver.
const double Tmax_s
Definition: JBillabong.cc:193
then JCookie sh JDataQuality D $DETECTOR_ID R
Definition: JDataQuality.sh:41
then usage $script[energy[distance[z of PMT]]] fi case set_variable z
Definition: JDrawPDF.sh:45
int32_t DETID
Definition: JToA.hh:30
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.
Utility class to parse command line options.
hit_type()
Default constructor.
Definition: JBillabong.cc:74
JPosition3D getPiezoPosition()
Get relative position of piezo in optical module.
double getToA() const
Get calibrated time of arrival.
Acoustic transmission.
Acoustic event.
no fit printf nominal n $STRING awk v X
do set_variable MODULE getModule a $WORKDIR detector_a datx L $STRING JEditDetector a $WORKDIR detector_a datx M $MODULE setz o $WORKDIR detector_a datx JEditDetector a $WORKDIR detector_b datx M $MODULE setz o $WORKDIR detector_b datx done echo Output stored at $WORKDIR detector_a datx and $WORKDIR tripod_a txt JDrawDetector2D a $WORKDIR detector_a datx a $WORKDIR detector_b datx L BL o detector $FORMAT $BATCH JDrawDetector2D T $WORKDIR tripod_a txt T $WORKDIR tripod_b txt L BL o tripod $FORMAT $BATCH JCompareDetector a $WORKDIR detector_a datx b $WORKDIR detector_b datx o $WORKDIR abc root &dev null for KEY in X Y Z
std::vector< JVector3D > U
Definition: JBillabong.cc:283
const JLimit & getLimit() const
Get limit.
Definition: JLimit.hh:84
Data structure for position in three dimensions.
Definition: JPosition3D.hh:36
bool overlap(const JRange< T, JComparator_t > &first, const JRange< T, JComparator_t > &second)
Test overlap between ranges.
Definition: JRange.hh:641
Acoustic event.
const double V
Definition: JBillabong.cc:284
Rotation set.
Definition: JRotator3D.hh:29
uint32_t DOMID
DAQ run number.
Definition: JToA.hh:32
do set_variable DETECTOR_TXT $WORKDIR detector
double u[N+1]
Definition: JPolint.hh:865
JSoundVelocity & set(const double z0)
Set depth.
do echo Generating $dir eval D
Definition: JDrawLED.sh:53
double getZ() const
Get z position.
Definition: JVector3D.hh:115
static struct JTRIGGER::clusterize clusterize
JMatch3D(const double V, const double Dmax_m, const double Tmax_s)
Constructor.
Definition: JBillabong.cc:105
bool operator()(const hit_type &root, T __begin, T __end) const
Check event.
Definition: JBillabong.cc:251
int debug
debug level
JAbstractHistogram< double > JHistogram_t
Type definition for scan along axis.
Definition: JBillabong.cc:61
#define DEBUG(A)
Message macros.
Definition: JMessage.hh:62