Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
JAcoustics/JEventOverlap.hh
Go to the documentation of this file.
1#ifndef __JACOUSTICS__JEVENTOVERLAP__
2#define __JACOUSTICS__JEVENTOVERLAP__
3
5
6
7/**
8 * \author mdejong
9 */
10
11namespace JACOUSTICS {}
12namespace JPP { using namespace JACOUSTICS; }
13
14namespace JACOUSTICS {
15
16
17 /**
18 * Match of two events considering overlap in time.
19 */
21 public:
22 /**
23 * Constructor.
24 *
25 * \param Tmax_s maximal time difference between two consecutive events [s]
26 */
27 JEventOverlap(const double Tmax_s) :
29 {}
30
31
32 /**
33 * Match criterion.
34 *
35 * \param first first event
36 * \param second second event
37 * \return true if two events overlap in time; else false
38 */
39 bool operator()(const JEvent& first, const JEvent& second) const
40 {
41 if (first .empty()) return false;
42 if (second.empty()) return false;
43
44 return (first.rbegin()->getToE() >= second. begin()->getToE() - tmax_s &&
45 first. begin()->getToE() <= second.rbegin()->getToE() + tmax_s);
46 }
47
48
49 /**
50 * Get time window.
51 *
52 * \return maximal time difference between two consecutive events [s]
53 */
54 double getTmax() const
55 {
56 return tmax_s;
57 }
58
59
60 protected:
61 double tmax_s;
62 };
63}
64
65#endif
Acoustic event.
Auxiliary classes and methods for acoustic position calibration.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Match of two events considering overlap in time and position.
bool operator()(const JEvent &first, const JEvent &second) const
Match criterion.
double getTmax() const
Get time window.
JEventOverlap(const double Tmax_s)
Constructor.