Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
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.
 
bool operator() (const JEvent &first, const JEvent &second) const
 Match criterion.
 
double getTmax () const
 Get time window.
 

Static Public Member Functions

static double getExtraTime ()
 Get extra time.
 

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

◆ JEventOverlap()

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

◆ operator()()

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.

◆ getTmax()

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 }

◆ getExtraTime()

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

◆ tmax_ns

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: