424{
427
429
431
433 JLimit_t& numberOfEvents = inputFile.getLimit();
435 int factoryLimit = 10000;
437 double RMax_m = 0.0;
438 double DMax_m = 0.0;
439 double Xv_m = 0.0;
440 double factor = 2.0;
448 double precision;
451
452 try {
453
455
468
469 JParser<> zap(
"Main program to trigger acoustic data.");
470
478 zap[
'p'] =
make_field(precision,
"precision time-of-arrival") = 1.0e-6;
481
483 }
484 catch(const exception &error) {
486 }
487
488
490
491 try {
493 }
496 }
497
499
501
503
504
506
509
513
515
516 for (JDetector::const_iterator i =
detector.begin(); i !=
detector.end(); ++i) {
517
519
520 if (i->getFloor() == 0) {
521
522 try {
524 hydrophones.end(),
526 }
527 catch(const exception&) {
528 continue;
529 }
530 }
531
532 receivers[i->getID()] =
JReceiver(i->getID(),
533 i->getPosition() + pos,
534 i->getT0() * 1.0e-9);
535 }
536
537
538
544
546
548
551 }
552
555
556
557
558
560
562
564
566
567 while (inputFile.hasNext()) {
568
569 JToA* parameters = inputFile.next();
570
573 }
574
575 if (receivers.has(parameters->
DOMID)) {
576
578
581
584 }
585
592
595 }
596 }
597 }
599
600 if (parameters.numberOfHits == 0) {
601
603
604 STATUS(
"Number of hits " << parameters.numberOfHits <<
endl);
605 }
606
608
610
612
614
616
617
618
620
622
623
624
625 for (buffer_type::const_iterator p = receiver->second.begin(); p != __end; ++p) {
626 if (p->getQ() >= parameters.Q * (parameters.Q <= 1.0 ? p->getW() : 1.0)) {
628 }
629 }
630 }
631
633
635
638
644
645 for (buffer_type::const_iterator p =
data.begin(); p !=
data.end(); ++p) {
646
647 buffer_type::const_iterator q = p;
648
649 while (++q !=
data.end() && q->getToA() - p->getToA() <= parameters.TMax_s) {}
650
652
653 if (
distance(p,q) >= parameters.numberOfHits) {
654
656
657 if ((
int) out[1].size() >= parameters.numberOfHits &&
velo(out[1].
getVertex(), p, q) >= parameters.numberOfHits) {
658
659
660
661 } else {
662
663 buffer_type::iterator
root = buffer.begin();
664 buffer_type::iterator __p = buffer.begin();
665 buffer_type::iterator
__q = buffer.begin();
666
668
669 ++__p;
671
672 for (buffer_type::const_iterator i = p; ++i != q; ) {
673 if (match(*p,*i)) {
676 }
677 }
678
680
682
684
686
688
690
691 if (
vx.N >= parameters.numberOfHits) {
692
694
696
697 if (
vx.N >= parameters.numberOfHits) {
699 }
700 }
701 }
702 }
703 }
704
705 } else {
706
708 }
709
710 if (!out[1].empty()) {
711
712 if (out[0].empty()) {
713
714 out[0] = out[1];
715
717
718 out[0].
merge(out[1]);
719
720 } else {
721
723
724 h5->Fill(out[0].size());
725
726 queue.push_back(out[0]);
727
728 out[0] = out[1];
729 }
730
731 out[1].clear();
732 }
733 }
734 }
735
736 if (!out[0].empty()) {
737
738 queue.push_back(out[0]);
739 }
741 }
742 }
743
744 if (!queue.empty()) {
745
746 sort(queue.begin(), queue.end());
747
749
750
751
754
756
757 for ( ; q != queue.end() &&
overlap1D(*p,*q); ++q) {
758
760
761 if (q->getQ() > i->getQ()) {
762 i = q;
763 }
764 }
765
767
769
770 G2[i->getID()].put(i->getX(), i->getY());
771
772 p = q;
773 }
774 }
775
777
779
781 for (
const auto& i : *
M) {
783 }
784 }
785
788 }
789
791}
#define DEBUG(A)
Message macros.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
#define MAKE_CSTRING(A)
Make C-string.
#define gmake_property(A)
macros to convert (template) parameter to JPropertiesElement object
3D match criterion for acoustic signals.
int getString() const
Get string number.
Utility class to parse parameter values.
Data structure for position in three dimensions.
const JPosition3D & getPosition() const
Get position.
Data structure for vector in three dimensions.
int getID() const
Get identifier.
Template definition of a multi-dimensional oscillation probability interpolation table.
JVertex3D getVertex(const Trk &track)
Get vertex.
JPosition3D getPosition(const Vec &pos)
Get position.
int getWaveformID(int id)
Get waveform identifier.
JContainer< std::vector< JHydrophone > > hydrophones_container
static const JSoundVelocity getSoundVelocity(1541.0, -17.0e-3, -2000.0)
Function object for velocity of sound.
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
JComparator< JResult_t T::*, JComparison::lt > make_comparator(JResult_t T::*member)
Helper method to create comparator between values of data member.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
std::vector< JHitW0 > buffer_type
hits
JHitIterator_t clusterize(JHitIterator_t __begin, JHitIterator_t __end, const JMatch_t &match, const int Nmin=1)
Partition data according given binary match operator.
Auxiliary data structure for sequence of same character.
Interface for depth dependend velocity of sound.
Match of two events considering overlap in time and position.
void merge(const JEvent &event)
Merge event.
double getT(const double t_s) const
Get corrected time.
Implementation for depth dependend velocity of sound.
JSoundVelocity & set(const double z0)
Set depth.
Time-of-arrival data from acoustic piezo sensor or hydrophone.
uint32_t DOMID
DAQ run number.
uint32_t QUALITYFACTOR
The ticks (16ns) part of the DAQ frame timestamp.
uint32_t QUALITYNORMALISATION
A measure of how good the waveform match was to the signal.
int32_t WAVEFORMID
DOM unique identifeir.
int32_t RUN
detector identifier
double TOA_S() const
Time of Arrival, expressed in seconds relative to Unix epoch (1 January 1970 00:00:00 UTC)
Auxiliary class to compare transmissions.
Auxiliary class to compare transmissions.
double Q
minimal quality if larger than one; else minimal normalised quality
double TMax_s
maximal difference between times of emission [s]
int numberOfHits
minimal number of hits to trigger event
static double TOA_s
start time of data
Transmission with position.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Auxiliary data structure to build TGraph.
Auxiliary class for defining the range of iterations of objects.
static counter_type max()
Get maximum counter value.