The Gaudi Framework  master (ff829712)
Loading...
Searching...
No Matches
EventIDRange Class Reference

Event ID Range object. 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::ostream & operator<< (std::ostream &os, const EventIDRange &rhs)
 

Detailed Description

Event ID Range object.

Holds two EventIDBases (start and stop)

Definition at line 32 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 )
static const event_number_t UNDEFEVT
Definition EventIDBase.h:71
static const number_type UNDEFNUM
Definition EventIDBase.h:70
EventIDBase m_stop
EventIDBase m_start

◆ 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 ) {}
const EventIDBase & start() const
const EventIDBase & stop() const

◆ EventIDRange() [3/3]

EventIDRange::EventIDRange ( const EventIDRange & r)
inline

Definition at line 36 of file EventIDRange.h.

36: 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 58 of file EventIDRange.h.

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

◆ intersect() [2/2]

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

Definition at line 56 of file EventIDRange.h.

56{ return it; }

◆ isInRange()

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

Definition at line 42 of file EventIDRange.h.

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

◆ operator std::string()

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

Definition at line 85 of file EventIDRange.h.

85 {
86 std::ostringstream os;
87 os << "{" << m_start << " - " << m_stop << "}";
88 return os.str();
89}

◆ 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 39 of file EventIDRange.h.

39{ return m_start; }

◆ stop()

const EventIDBase & EventIDRange::stop ( ) const
inline

Definition at line 40 of file EventIDRange.h.

40{ return m_stop; }

Friends And Related Symbol Documentation

◆ operator!=

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

Definition at line 83 of file EventIDRange.h.

83{ 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 79 of file EventIDRange.h.

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

Member Data Documentation

◆ m_start

EventIDBase EventIDRange::m_start {}
private

Definition at line 75 of file EventIDRange.h.

75{};

◆ m_stop

EventIDBase EventIDRange::m_stop {}
private

Definition at line 76 of file EventIDRange.h.

76{};

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