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

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

#include <JEventOverlap.hh>

Public Member Functions

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

Static Public Member Functions

static double getExtraTime ()
 Get extra time. More...
 

Protected Attributes

double tmax_ns
 

Detailed Description

Match of two events considering overlap in time.

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

Constructor & Destructor Documentation

JTRIGGER::JEventOverlap::JEventOverlap ( const double  Tmax_ns)
inline

Constructor.

Parameters
Tmax_nsmaximal time difference between two consecutive events [ns]

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

27  :
28  tmax_ns(Tmax_ns)
29  {}

Member Function Documentation

bool JTRIGGER::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 JTrigger/JEventOverlap.hh.

40  {
41  if (first .empty()) return false;
42  if (second.empty()) return false;
43 
44  return (first.rbegin()->getT() >= second. begin()->getT() - tmax_ns - getExtraTime() &&
45  first. begin()->getT() <= second.rbegin()->getT() + tmax_ns + getExtraTime());
46  }
static double getExtraTime()
Get extra time.
double JTRIGGER::JEventOverlap::getTmax ( ) const
inline

Get time window.

Returns
maximal time difference between two consecutive events [ns]

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

55  {
56  return tmax_ns;
57  }
static double JTRIGGER::JEventOverlap::getExtraTime ( )
inlinestatic

Get extra time.

The extra time is used to accomodate small time gaps (sub-ns) due to numerical precision.

Returns
extra time [ns]

Definition at line 67 of file JTrigger/JEventOverlap.hh.

68  {
69  return 0.1;
70  }

Member Data Documentation

double JTRIGGER::JEventOverlap::tmax_ns
protected

Definition at line 73 of file JTrigger/JEventOverlap.hh.


The documentation for this class was generated from the following file: