Jpp  18.0.0-rc.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Public Attributes | Protected Attributes | List of all members
JACOUSTICS::JEventOverlap Struct Reference

Match of two events considering overlap in time. More...

#include <JEventOverlap.hh>

Public Types

typedef JRange< double > time_range
 Type definition of time range. More...
 

Public Member Functions

 JEventOverlap (const double Tmax_s)
 Constructor. More...
 
bool operator() (const JEvent &first, const JEvent &second) const
 Match criterion. More...
 
double getTmax () const
 Get time window. More...
 
 JEventOverlap (const double Tmax_s=0.0)
 Constructor. More...
 
bool operator() (const JEvent &first, const JEvent &second) const
 Match criterion. More...
 

Public Attributes

const time_range range
 

Protected Attributes

double tmax_s
 

Detailed Description

Match of two events considering overlap in time.

Definition at line 20 of file JAcoustics/JEventOverlap.hh.

Member Typedef Documentation

Type definition of time range.

Definition at line 133 of file JAcousticsTriggerProcessor.cc.

Constructor & Destructor Documentation

JACOUSTICS::JEventOverlap::JEventOverlap ( const double  Tmax_s)
inline

Constructor.

Parameters
Tmax_smaximal time difference between two consecutive events [s]

Definition at line 27 of file JAcoustics/JEventOverlap.hh.

27  :
28  tmax_s(Tmax_s)
29  {}
JACOUSTICS::JEventOverlap::JEventOverlap ( const double  Tmax_s = 0.0)
inline

Constructor.

Parameters
Tmax_smaximal time difference between two consecutive events [s]

Definition at line 140 of file JAcousticsTriggerProcessor.cc.

140  :
141  range(-Tmax_s, +Tmax_s)
142  {}

Member Function Documentation

bool JACOUSTICS::JEventOverlap::operator() ( const JEvent first,
const JEvent second 
) const
inline

Match criterion.

Parameters
firstfirst event
secondsecond event
Returns
true if two events overlap in time; else false

Definition at line 39 of file JAcoustics/JEventOverlap.hh.

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  }
double JACOUSTICS::JEventOverlap::getTmax ( ) const
inline

Get time window.

Returns
maximal time difference between two consecutive events [s]

Definition at line 54 of file JAcoustics/JEventOverlap.hh.

55  {
56  return tmax_s;
57  }
bool JACOUSTICS::JEventOverlap::operator() ( const JEvent first,
const JEvent second 
) const
inline

Match criterion.

Parameters
firstfirst event
secondsecond event
Returns
true if two events overlap in time; else false

Definition at line 152 of file JAcousticsTriggerProcessor.cc.

153  {
154  using namespace JPP;
155 
156  if (first .empty()) return false;
157  if (second.empty()) return false;
158 
159  time_range r1(make_array(first .begin(), first .end(), &JTransmission::getToA));
160  time_range r2(make_array(second.begin(), second.end(), &JTransmission::getToA));
161 
162  r1.add(range);
163  r2.add(range);
164 
165  return overlap(r1, r2);
166  }
void overlap(T p, T q, const double Tmax_s)
Empty overlapping events.
const array_type< JValue_t > & make_array(const JValue_t(&array)[N])
Method to create array of values.
Definition: JVectorize.hh:54
double getToA() const
Get calibrated time of arrival.
JRange< double > time_range
Type definition of time range.

Member Data Documentation

double JACOUSTICS::JEventOverlap::tmax_s
protected

Definition at line 61 of file JAcoustics/JEventOverlap.hh.

const time_range JACOUSTICS::JEventOverlap::range

Definition at line 168 of file JAcousticsTriggerProcessor.cc.


The documentation for this struct was generated from the following files: