97 public JClonable< JMatch<hit_type>, JMatch3D>
186 if (!this->empty()) {
188 for (const_iterator i = this->begin(); i != this->end(); ++i) {
210 return out <<
setw(3) <<
object.getID() <<
' '
211 <<
FIXED(9,3) <<
object.getT() -
TOA_s <<
" [s]" <<
' '
212 <<
setw(4) <<
object.size() <<
' '
213 <<
FIXED(9,2) <<
object.getQ() <<
' '
214 <<
object.getPosition();
314 const double factor = 1.0) :
320 if (RMax_m > 0.0 && Xv_m > 0.0) {
321 for (
double x = 0.5*Xv_m; x <= RMax_m; x += Xv_m) {
322 for (
double y = 0.5*Xv_m; y <= RMax_m; y += Xv_m) {
323 if (x*x + y*y <= RMax_m*RMax_m) {
347 const double t0 =
vx.getT();
351 for (T p = __begin; p != __end; ++p) {
353 const double t1 = p->getToA() -
V.getTime(p0.
getDistance(p->getPosition()), p0.
getZ(), p->getZ());
355 if (fabs(t1 - t0) <=
Tmax_s) {
379 for (const_iterator i = this->
cbegin(); i != this->
cend(); ++i) {
383 const double t0 =
root.getToA() -
V.getTime(
d0, p0.
getZ(),
root.getZ());
391 const double t1 = p->getToA() -
V.getTime(
d1, p0.
getZ(), p->getZ());
393 if (fabs(t1 - t0) <=
Tmax_s) {
433 JLimit_t& numberOfEvents = inputFile.getLimit();
435 int factoryLimit = 10000;
469 JParser<> zap(
"Main program to trigger acoustic data.");
478 zap[
'p'] =
make_field(precision,
"precision time-of-arrival") = 1.0e-6;
484 catch(
const exception &error) {
516 for (JDetector::const_iterator i =
detector.begin(); i !=
detector.end(); ++i) {
520 if (i->getFloor() == 0) {
527 catch(
const exception&) {
532 receivers[i->getID()] =
JReceiver(i->getID(),
533 i->getPosition() + pos,
534 i->getT0() * 1.0e-9);
567 while (inputFile.hasNext()) {
569 JToA* parameters = inputFile.next();
575 if (receivers.has(parameters->
DOMID)) {
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)) {
645 for (buffer_type::const_iterator p = data.begin(); p != data.end(); ++p) {
647 buffer_type::const_iterator q = p;
649 while (++q != data.end() && q->getToA() - p->getToA() <= parameters.
TMax_s) {}
663 buffer_type::iterator
root = buffer.begin();
664 buffer_type::iterator __p = buffer.begin();
665 buffer_type::iterator
__q = buffer.begin();
672 for (buffer_type::const_iterator i = p; ++i != q; ) {
710 if (!out[1].empty()) {
712 if (out[0].empty()) {
718 out[0].
merge(out[1]);
724 h5->Fill(out[0].size());
726 queue.push_back(out[0]);
736 if (!out[0].empty()) {
738 queue.push_back(out[0]);
744 if (!queue.empty()) {
746 sort(queue.begin(), queue.end());
757 for ( ; q != queue.end() &&
overlap1D(*p,*q); ++q) {
761 if (q->getQ() > i->getQ()) {
770 G2[i->getID()].put(i->getX(), i->getY());
781 for (
const auto& i : *
M) {
int main(int argc, char **argv)
ROOT TTree parameter settings.
Acoustic trigger parameters.
Algorithms for hit clustering and sorting.
Data structure for detector geometry and calibration.
Recording of objects on file according a format that follows from the file name extension.
General purpose class for hash map of unique elements.
Data structure for hydrophone.
Dynamic ROOT object management.
Base class for match operations for cluster and hit-preprocessing methods.
General purpose messaging.
#define DEBUG(A)
Message macros.
Scanning of objects from multiple files according a format that follows from the extension of each fi...
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
I/O formatting auxiliaries.
#define MAKE_CSTRING(A)
Make C-string.
Utility class to parse parameter values.
#define gmake_property(A)
macros to convert (template) parameter to JPropertiesElement object
3D match criterion for acoustic signals.
const JAbstractSoundVelocity & V
virtual bool operator()(const hit_type &first, const hit_type &second) const override
Match operator.
JMatch3D(const JAbstractSoundVelocity &V, const double Tmax_s=0.0)
Constructor.
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.
double getDistance(const JVector3D &pos) const
Get distance to point.
double getZ() const
Get z position.
double getT(const JVector3D &pos) const
Get arrival time of Cherenkov light at given position.
int getID() const
Get identifier.
Template definition of a multi-dimensional oscillation probability interpolation table.
Function object interface for hit matching.
JVertex3D getVertex(const Trk &track)
Get vertex.
JPosition3D getPosition(const Vec &pos)
Get position.
Auxiliary classes and methods for acoustic position calibration.
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.
double getDistance(const JFirst_t &first, const JSecond_t &second)
Get distance between objects.
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.
Auxiliary data structure for floating point format specification.
Interface for depth dependend velocity of sound.
int getCounter() const
Get counter.
Match of two events considering overlap in time and position.
JEventOverlap(const double Tmax_s, const double Dmax_m=std::numeric_limits< double >::max())
Constructor.
bool operator()(const event_type &first, const event_type &second) const
Match criterion.
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 getToA() const
Get calibrated time of arrival.
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
int operator()(const JVertex3D &vx, T __begin, T __end) const
Check vertex.
vertex_type operator()(const JPosition3D &position, const hit_type &root, T __begin, T __end, const int numberOfHits=0) const
Locate vertex around given position.
const JAbstractSoundVelocity & V
JVelo(const JAbstractSoundVelocity &V, const double RMax_m, const double Xv_m, const double factor=1.0)
Constructor.
double getQ() const
Get average quality.
event_type()
Default constructor.
event_type(const JEvent &event)
Copy constructor.
friend std::ostream & operator<<(std::ostream &out, const event_type &object)
Write event to output stream.
static double TOA_s
start time of data
event_type(const JVertex3D &vertex, const JEvent &event)
Constructor.
Transmission with position.
hit_type()
Default constructor.
hit_type(const JPosition3D &position, const JTransmission &transmission)
Constructor.
vertex_type()
Default constructor.
vertex_type(const JVector3D &p0, const double t0, const int n0, const double q0)
Constructor.
Template class for object cloning.
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.