The Gaudi Framework  master (37c0b60a)
EventIDRange Class Reference

Event ID Range object. Holds two EventIDBases (start and stop) More...

#include </builds/gaudi/Gaudi/GaudiKernel/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)
 
const EventIDBasestart () const
 
const EventIDBasestop () 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 33 of file EventIDRange.h.

Constructor & Destructor Documentation

◆ EventIDRange() [1/3]

EventIDRange::EventIDRange ( )

Definition at line 23 of file EventIDRange.cpp.

24  : // defauld constructor: Range covering everything
25  m_start( 0, 0, 0, 0, 0, 0 )
27  EventIDBase::UNDEFNUM, 0 ) {}

◆ EventIDRange() [2/3]

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

Definition at line 29 of file EventIDRange.cpp.

29 : m_start( start ), m_stop( stop ) {}

◆ EventIDRange() [3/3]

EventIDRange::EventIDRange ( const EventIDRange r)
inline

Definition at line 37 of file EventIDRange.h.

37 : m_start( r.m_start ), m_stop( r.m_stop ) {}

Member Function Documentation

◆ intersect() [1/2]

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

Definition at line 59 of file EventIDRange.h.

59  {
60  EventIDRange r = intersect( rest... );
61 
62  EventIDBase i1 = max( first.start(), r.start() );
63  EventIDBase i2 = min( first.stop(), r.stop() );
64 
65  return EventIDRange( i1, i2 );
66  }

◆ intersect() [2/2]

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

Definition at line 57 of file EventIDRange.h.

57 { return it; }

◆ isInRange()

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

Definition at line 43 of file EventIDRange.h.

43  { // return ( t >= m_start && t < m_stop ); }
44  return ( std::tie( t.m_run_number, t.m_lumi_block, t.m_event_number ) >= // run/lumi larger than run/lumi of start
46 
47  std::tie( t.m_run_number, t.m_lumi_block, t.m_event_number ) < // run/lumi smaller than run/lumi of stop
49 
50  std::tie( t.m_time_stamp, t.m_time_stamp_ns_offset ) >= // time-stamp larger than time-stamp of start
52 
53  std::tie( t.m_time_stamp, t.m_time_stamp_ns_offset ) < // time-stap smaller than time-tamp of stop
55  }

◆ operator std::string()

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

Definition at line 86 of file EventIDRange.h.

86  {
88  os << "{" << m_start << " - " << m_stop << "}";
89  return os.str();
90 }

◆ operator=()

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

Definition at line 31 of file EventIDRange.cpp.

31  {
32  if ( this != &r ) {
33  m_start = r.m_start;
34  m_stop = r.m_stop;
35  }
36  return *this;
37 }

◆ start()

const EventIDBase& EventIDRange::start ( ) const
inline

Definition at line 40 of file EventIDRange.h.

40 { return m_start; }

◆ stop()

const EventIDBase& EventIDRange::stop ( ) const
inline

Definition at line 41 of file EventIDRange.h.

41 { return m_stop; }

Friends And Related Function Documentation

◆ operator!=

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

Definition at line 84 of file EventIDRange.h.

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

◆ operator<<

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

Definition at line 39 of file EventIDRange.cpp.

39  {
40  os << (std::string)rhs;
41  return os;
42 }

◆ operator==

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

Definition at line 80 of file EventIDRange.h.

80  {
81  return lhs.m_start == rhs.m_start && lhs.m_stop == rhs.m_stop;
82 }

Member Data Documentation

◆ m_start

EventIDBase EventIDRange::m_start {}
private

Definition at line 76 of file EventIDRange.h.

◆ m_stop

EventIDBase EventIDRange::m_stop {}
private

Definition at line 77 of file EventIDRange.h.


The documentation for this class was generated from the following files:
EventIDBase::m_time_stamp_ns_offset
number_type m_time_stamp_ns_offset
time stamp ns - ns time offset for time_stamp, 32 bit unsigned
Definition: EventIDBase.h:202
std::string
STL class.
EventIDRange
Event ID Range object. Holds two EventIDBases (start and stop)
Definition: EventIDRange.h:33
EventIDBase::m_run_number
number_type m_run_number
run number
Definition: EventIDBase.h:193
EventIDRange::m_start
EventIDBase m_start
Definition: EventIDRange.h:76
EventIDBase::UNDEFEVT
static const event_number_t UNDEFEVT
Definition: EventIDBase.h:72
EventIDBase::UNDEFNUM
static const number_type UNDEFNUM
Definition: EventIDBase.h:71
EventIDRange::stop
const EventIDBase & stop() const
Definition: EventIDRange.h:41
EventIDBase::m_lumi_block
number_type m_lumi_block
luminosity block number: the number which uniquely tags a luminosity block within a run
Definition: EventIDBase.h:206
EventIDRange::intersect
static EventIDRange intersect(const EventIDRange &it)
Definition: EventIDRange.h:57
std::tie
T tie(T... args)
bug_34121.t
t
Definition: bug_34121.py:31
EventIDBase::m_event_number
event_number_t m_event_number
event number
Definition: EventIDBase.h:196
EventIDRange::m_stop
EventIDBase m_stop
Definition: EventIDRange.h:77
std::min
T min(T... args)
std::ostringstream
STL class.
EventIDRange::start
const EventIDBase & start() const
Definition: EventIDRange.h:40
std::ostringstream::str
T str(T... args)
EventIDBase
This class provides a unique identification for each event, in terms of run/event number and/or a tim...
Definition: EventIDBase.h:66
std::max
T max(T... args)
EventIDBase::m_time_stamp
number_type m_time_stamp
posix time in seconds since 1970/01/01
Definition: EventIDBase.h:199
EventIDRange::EventIDRange
EventIDRange()
Definition: EventIDRange.cpp:23