Jpp  15.0.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JAcoustics/JEventOverlap.hh
Go to the documentation of this file.
1 #ifndef __JACOUSTICS__JEVENTOVERLAP__
2 #define __JACOUSTICS__JEVENTOVERLAP__
3 
4 #include "JAcoustics/JEvent.hh"
5 
6 
7 /**
8  * \author mdejong
9  */
10 
11 namespace JACOUSTICS {}
12 namespace JPP { using namespace JACOUSTICS; }
13 
14 namespace JACOUSTICS {
15 
16 
17  /**
18  * Match of two events considering overlap in time.
19  */
20  class JEventOverlap {
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) :
28  tmax_s(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
JEventOverlap(const double Tmax_s)
Constructor.
Acoustic event.
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first
bool operator()(const JEvent &first, const JEvent &second) const
Match criterion.
double getTmax() const
Get time window.
Acoustic event.
Match of two events considering overlap in time.
then usage $script< detector file >< tripodfile >< stage > input file nInput files correspond to the output of JAcousticsEventBuilder[.sh] nFirst stage eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY eval JPrintDetector a $DETECTOR O CAN source JAcoustics sh $DETECTOR_ID typeset A CONFIGURATION for key in Tmax_s