Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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>

Inheritance diagram for JTRIGGER::JEventOverlap:

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...
 

Protected Attributes

double tmax_ns
 

Detailed Description

Match of two events considering overlap in time.

Definition at line 22 of file 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 31 of file JEventOverlap.hh.

31  :
32  tmax_ns(Tmax_ns)
33  {}

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 43 of file JEventOverlap.hh.

44  {
45  if (first .empty()) return false;
46  if (second.empty()) return false;
47 
48  return (first.rbegin()->getT() >= second. begin()->getT() - tmax_ns &&
49  first. begin()->getT() <= second.rbegin()->getT() + tmax_ns);
50  }
double JTRIGGER::JEventOverlap::getTmax ( ) const
inline

Get time window.

Returns
maximal time difference between two consecutive events [ns]

Definition at line 58 of file JEventOverlap.hh.

59  {
60  return tmax_ns;
61  }

Member Data Documentation

double JTRIGGER::JEventOverlap::tmax_ns
protected

Definition at line 64 of file JEventOverlap.hh.


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