The Gaudi Framework  v32r2 (46d42edc)
EventIDRange Class Reference

Event ID Range object. More...

#include <GaudiKernel/EventIDRange.h>

Collaboration diagram for EventIDRange:

Public Member Functions

 EventIDRange ()
 
 EventIDRange (const EventIDBase &start, const EventIDBase &stop)
 
 EventIDRange (const EventIDRange &r)
 
EventIDRangeoperator= (const EventIDRange &r)
 
EventIDBase start () const
 
EventIDBase stop () const
 
bool isInRange (const EventIDBase &t) const
 
 operator std::string () const
 

Static Public Member Functions

static EventIDRange intersect (const EventIDRange &it)
 
template<typename... T>
static EventIDRange intersect (const EventIDRange &first, const T &... rest)
 

Private Attributes

EventIDBase m_start {}
 
EventIDBase m_stop {}
 

Friends

bool operator== (const EventIDRange &lhs, const EventIDRange &rhs)
 
bool operator!= (const EventIDRange &lhs, const EventIDRange &rhs)
 
std::ostreamoperator<< (std::ostream &os, const EventIDRange &rhs)
 

Detailed Description

Event ID Range object.

Holds two EventIDBases (start and stop)

Definition at line 23 of file EventIDRange.h.

Constructor & Destructor Documentation

◆ EventIDRange() [1/3]

EventIDRange::EventIDRange ( )

Definition at line 13 of file EventIDRange.cpp.

14  : // defauld constructor: Range covering everything
15  m_start( 0, 0, 0, 0, 0, 0 )
17  EventIDBase::UNDEFNUM, 0 ) {}
static const number_type UNDEFNUM
Definition: EventIDBase.h:61
EventIDBase m_stop
Definition: EventIDRange.h:67
EventIDBase m_start
Definition: EventIDRange.h:66
static const event_number_t UNDEFEVT
Definition: EventIDBase.h:62

◆ EventIDRange() [2/3]

EventIDRange::EventIDRange ( const EventIDBase start,
const EventIDBase stop 
)

Definition at line 19 of file EventIDRange.cpp.

19  : m_start( start ), m_stop( stop ) {
20 
21  // For pure time-stamp range, re-adjust start so that it covers O-INF in terms of run-lumi
26  }
27  // For pure run/lumi range, re-adjust start so that it covers 0-inf in terms of time-stamp
31  }
32 }
static const number_type UNDEFNUM
Definition: EventIDBase.h:61
number_type m_time_stamp_ns_offset
time stamp ns - ns time offset for time_stamp, 32 bit unsigned
Definition: EventIDBase.h:192
EventIDBase m_stop
Definition: EventIDRange.h:67
event_number_t m_event_number
event number
Definition: EventIDBase.h:186
number_type m_time_stamp
posix time in seconds since 1970/01/01
Definition: EventIDBase.h:189
number_type m_lumi_block
luminosity block number: the number which uniquely tags a luminosity block within a run
Definition: EventIDBase.h:196
number_type m_run_number
run number
Definition: EventIDBase.h:183
EventIDBase stop() const
Definition: EventIDRange.h:31
EventIDBase m_start
Definition: EventIDRange.h:66
EventIDBase start() const
Definition: EventIDRange.h:30

◆ EventIDRange() [3/3]

EventIDRange::EventIDRange ( const EventIDRange r)
inline

Definition at line 27 of file EventIDRange.h.

27 : m_start( r.m_start ), m_stop( r.m_stop ){};
EventIDBase m_stop
Definition: EventIDRange.h:67
EventIDBase m_start
Definition: EventIDRange.h:66

Member Function Documentation

◆ intersect() [1/2]

static EventIDRange EventIDRange::intersect ( const EventIDRange it)
inlinestatic

Definition at line 47 of file EventIDRange.h.

47 { return it; }

◆ intersect() [2/2]

template<typename... T>
static EventIDRange EventIDRange::intersect ( const EventIDRange first,
const T &...  rest 
)
inlinestatic

Definition at line 49 of file EventIDRange.h.

49  {
50  EventIDRange r = intersect( rest... );
51 
52  EventIDBase i1 = max( first.start(), r.start() );
53  EventIDBase i2 = min( first.stop(), r.stop() );
54 
55  return EventIDRange( i1, i2 );
56  }
EventIDBase min(const EventIDBase &lhs, const EventIDBase &rhs)
Definition: EventIDBase.h:202
EventIDBase max(const EventIDBase &lhs, const EventIDBase &rhs)
Definition: EventIDBase.h:215
Event ID Range object.
Definition: EventIDRange.h:23
static EventIDRange intersect(const EventIDRange &it)
Definition: EventIDRange.h:47
EventIDBase stop() const
Definition: EventIDRange.h:31
This class provides a unique identification for each event, in terms of run/event number and/or a tim...
Definition: EventIDBase.h:56
EventIDBase start() const
Definition: EventIDRange.h:30

◆ isInRange()

bool EventIDRange::isInRange ( const EventIDBase t) const
inline

Definition at line 33 of file EventIDRange.h.

33  { // return ( t >= m_start && t < m_stop ); }
34  return ( std::tie( t.m_run_number, t.m_lumi_block, t.m_event_number ) >= // run/lumi larger than run/lumi of start
36 
37  std::tie( t.m_run_number, t.m_lumi_block, t.m_event_number ) < // run/lumi smaller than run/lumi of stop
39 
40  std::tie( t.m_time_stamp, t.m_time_stamp_ns_offset ) >= // time-stamp larger than time-stamp of start
42 
43  std::tie( t.m_time_stamp, t.m_time_stamp_ns_offset ) < // time-stap smaller than time-tamp of stop
45  }
T tie(T... args)
number_type m_time_stamp_ns_offset
time stamp ns - ns time offset for time_stamp, 32 bit unsigned
Definition: EventIDBase.h:192
EventIDBase m_stop
Definition: EventIDRange.h:67
event_number_t m_event_number
event number
Definition: EventIDBase.h:186
number_type m_time_stamp
posix time in seconds since 1970/01/01
Definition: EventIDBase.h:189
number_type m_lumi_block
luminosity block number: the number which uniquely tags a luminosity block within a run
Definition: EventIDBase.h:196
number_type m_run_number
run number
Definition: EventIDBase.h:183
EventIDBase m_start
Definition: EventIDRange.h:66

◆ operator std::string()

EventIDRange::operator std::string ( ) const
inline

Definition at line 76 of file EventIDRange.h.

76  {
78  os << "{" << m_start << " - " << m_stop << "}";
79  return os.str();
80 }
EventIDBase m_stop
Definition: EventIDRange.h:67
T str(T... args)
EventIDBase m_start
Definition: EventIDRange.h:66

◆ operator=()

EventIDRange & EventIDRange::operator= ( const EventIDRange r)

Definition at line 34 of file EventIDRange.cpp.

34  {
35  if ( this != &r ) {
36  m_start = r.m_start;
37  m_stop = r.m_stop;
38  }
39  return *this;
40 }
EventIDBase m_stop
Definition: EventIDRange.h:67
EventIDBase m_start
Definition: EventIDRange.h:66

◆ start()

EventIDBase EventIDRange::start ( ) const
inline

Definition at line 30 of file EventIDRange.h.

30 { return m_start; }
EventIDBase m_start
Definition: EventIDRange.h:66

◆ stop()

EventIDBase EventIDRange::stop ( ) const
inline

Definition at line 31 of file EventIDRange.h.

31 { return m_stop; }
EventIDBase m_stop
Definition: EventIDRange.h:67

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( const EventIDRange lhs,
const EventIDRange rhs 
)
friend

Definition at line 74 of file EventIDRange.h.

74 { return !( lhs == rhs ); }

◆ operator<<

std::ostream& operator<< ( std::ostream os,
const EventIDRange rhs 
)
friend

Definition at line 42 of file EventIDRange.cpp.

42  {
43  os << (std::string)rhs;
44  return os;
45 }
STL class.

◆ operator==

bool operator== ( const EventIDRange lhs,
const EventIDRange rhs 
)
friend

Definition at line 70 of file EventIDRange.h.

70  {
71  return lhs.m_start == rhs.m_start && lhs.m_stop == rhs.m_stop;
72 }
EventIDBase m_stop
Definition: EventIDRange.h:67
EventIDBase m_start
Definition: EventIDRange.h:66

Member Data Documentation

◆ m_start

EventIDBase EventIDRange::m_start {}
private

Definition at line 66 of file EventIDRange.h.

◆ m_stop

EventIDBase EventIDRange::m_stop {}
private

Definition at line 67 of file EventIDRange.h.


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