| The Gaudi Framework v32r1 (f65d50dc)

Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
EventIDBase Class Reference

This class provides a unique identification for each event, in terms of run/event number and/or a time stamp. More...

`#include <GaudiKernel/EventIDBase.h>`

## Public Types
typedef unsigned int | number_type
typedef uint64_t | event_number_t

## Public Member Functions
number_type | run_number () const
| run number - 32 bit unsigned More...
event_number_t | event_number () const
| event number - 64 bit unsigned More...
number_type | time_stamp () const
| time stamp - posix time in seconds from 1970, 32 bit unsigned More...
number_type | time_stamp_ns_offset () const
| time stamp ns - ns time offset for time_stamp, 32 bit unsigned More...
number_type | lumi_block () const
| luminosity block identifier, 32 bit unsigned More...
number_type | bunch_crossing_id () const
| bunch crossing ID, 32 bit unsigned More...
void | set_run_number (number_type runNumber)
| set run number More...
void | set_event_number (event_number_t eventNumber)
| set event number More...
void | set_time_stamp (number_type timeStamp)
| set time stamp More...
void | set_time_stamp_ns_offset (number_type timeStampNs)
| set time stamp in ns More...
void | set_lumi_block (number_type lumiBlock)
| set luminosity block identifier More...
void | set_bunch_crossing_id (number_type bcid)
| set bunch crossing ID More...
bool | isRunEvent () const
bool | isTimeStamp () const
bool | isLumiEvent () const
bool | isRunLumi () const
bool | isValid () const
structors
| EventIDBase ()
| EventIDBase (number_type run_number, event_number_t event_number, number_type time_stamp=UNDEFNUM, number_type time_stamp_ns_offset=0, number_type lumi_block=UNDEFNUM, number_type bunch_crossing_id=0)
| EventIDBase (std::tuple< number_type, number_type, event_number_t > run_lumi_ev, std::tuple< number_type, number_type > time_stamp, number_type bunch_crossing_id)
virtual | ~EventIDBase ()=default

## Static Public Member Functions
static auto | SortByTimeStamp ()
static auto | SortByRunEvent ()
static auto | SortByLumiEvent ()
static auto | SortByRunLumi ()

## Static Public Attributes
static const number_type | UNDEFNUM = std::numeric_limits<EventIDBase::number_type>::max()
static const event_number_t | UNDEFEVT = std::numeric_limits<EventIDBase::event_number_t>::max()

## Private Types
enum | Type { Invalid = 0, RunEvent = 1 << 1, TimeStamp = 1 << 2, LumiEvent = 1 << 3, RunLumi = 1 << 4 }

## Private Member Functions
void | setRE ()
void | setTS ()
void | setLE ()
void | setRL ()

## Private Attributes
unsigned | m_type {Invalid}
number_type | m_run_number {UNDEFNUM}
| run number More...
event_number_t | m_event_number {UNDEFEVT}
| event number More...
number_type | m_time_stamp {UNDEFNUM}
| posix time in seconds since 1970/01/01 More...
number_type | m_time_stamp_ns_offset {UNDEFNUM}
| time stamp ns - ns time offset for time_stamp, 32 bit unsigned More...
number_type | m_lumi_block {UNDEFNUM}
| luminosity block number: the number which uniquely tags a luminosity block within a run More...
number_type | m_bunch_crossing_id {UNDEFNUM}
| bunch crossing ID, 32 bit unsigned More...

## Friends
class | EventIDRange
bool | operator== (const EventIDBase &lhs, const EventIDBase &rhs)
| Comparison operators. More...
bool | operator< (const EventIDBase &lhs, const EventIDBase &rhs)
bool | operator> (const EventIDBase &lhs, const EventIDBase &rhs)
bool | operator!= (const EventIDBase &lhs, const EventIDBase &rhs)
bool | operator<= (const EventIDBase &lhs, const EventIDBase &rhs)
bool | operator>= (const EventIDBase &lhs, const EventIDBase &rhs)
EventIDBase | min (const EventIDBase &lhs, const EventIDBase &rhs)
EventIDBase | max (const EventIDBase &lhs, const EventIDBase &rhs)
std::ostream & | operator<< (std::ostream &os, const EventIDBase &rhs)
| Extraction operators. More...

## Detailed Description

This class provides a unique identification for each event, in terms of run/event number and/or a time stamp.

Definition at line 56 of file EventIDBase.h.

## Member Typedef Documentation

## ◆ event_number_t

typedef uint64_t EventIDBase::event_number_t

Definition at line 59 of file EventIDBase.h.

## ◆ number_type

typedef unsigned int EventIDBase::number_type

Definition at line 58 of file EventIDBase.h.

## Member Enumeration Documentation

## ◆ Type

enum EventIDBase::Type
| private

Enumerator
Invalid |
RunEvent |
TimeStamp |
LumiEvent |
RunLumi |

Definition at line 173 of file EventIDBase.h.

173 { Invalid = 0, RunEvent = 1 << 1, TimeStamp = 1 << 2, LumiEvent = 1 << 3, RunLumi = 1 << 4 };
EventIDBase::LumiEvent
Definition: EventIDBase.h:173
EventIDBase::RunLumi
Definition: EventIDBase.h:173
EventIDBase::Invalid
Definition: EventIDBase.h:173
EventIDBase::RunEvent
Definition: EventIDBase.h:173
EventIDBase::TimeStamp
Definition: EventIDBase.h:173

## Constructor & Destructor Documentation

## ◆ EventIDBase() [1/3]

EventIDBase::EventIDBase | ( |  | ) |
| inline

Definition at line 69 of file EventIDBase.h.

69 {};

## ◆ EventIDBase() [2/3]

EventIDBase::EventIDBase | ( | number_type | run_number,
|  | event_number_t | event_number,
|  | number_type | time_stamp = `UNDEFNUM`,
|  | number_type | time_stamp_ns_offset = `0`,
|  | number_type | lumi_block = `UNDEFNUM`,
|  | number_type | bunch_crossing_id = `0`
| ) |  |

Definition at line 17 of file EventIDBase.cpp.

19 : m_run_number( run_number )
20 , m_event_number( event_number )
21 , m_time_stamp( time_stamp )
22 , m_time_stamp_ns_offset( time_stamp_ns_offset )
23 , m_lumi_block( lumi_block )
24 , m_bunch_crossing_id( bunch_crossing_id ) {
25 if ( m_run_number != UNDEFNUM && m_event_number != UNDEFEVT ) setRE();
26
27 if ( m_time_stamp != UNDEFNUM ) {
28 setTS();
29 if ( m_time_stamp_ns_offset == UNDEFNUM ) m_time_stamp_ns_offset = 0;
30 }
31
32 if ( m_lumi_block != UNDEFNUM && m_event_number != UNDEFEVT ) setLE();
33
34 if ( m_run_number != UNDEFNUM && m_lumi_block != UNDEFNUM ) setRL();
35 }
EventIDBase::UNDEFNUM
static const number_type UNDEFNUM
Definition: EventIDBase.h:61
EventIDBase::setLE
void setLE()
Definition: EventIDBase.h:179
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:192
EventIDBase::lumi_block
number_type lumi_block() const
luminosity block identifier, 32 bit unsigned
Definition: EventIDBase.h:94
EventIDBase::m_bunch_crossing_id
number_type m_bunch_crossing_id
bunch crossing ID, 32 bit unsigned
Definition: EventIDBase.h:199
EventIDBase::setRE
void setRE()
Definition: EventIDBase.h:177
EventIDBase::m_event_number
event_number_t m_event_number
event number
Definition: EventIDBase.h:186
EventIDBase::event_number
event_number_t event_number() const
event number - 64 bit unsigned
Definition: EventIDBase.h:85
EventIDBase::setRL
void setRL()
Definition: EventIDBase.h:180
EventIDBase::m_time_stamp
number_type m_time_stamp
posix time in seconds since 1970/01/01
Definition: EventIDBase.h:189
EventIDBase::run_number
number_type run_number() const
run number - 32 bit unsigned
Definition: EventIDBase.h:82
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:196
EventIDBase::m_run_number
number_type m_run_number
run number
Definition: EventIDBase.h:183
EventIDBase::time_stamp
number_type time_stamp() const
time stamp - posix time in seconds from 1970, 32 bit unsigned
Definition: EventIDBase.h:88
EventIDBase::time_stamp_ns_offset
number_type time_stamp_ns_offset() const
time stamp ns - ns time offset for time_stamp, 32 bit unsigned
Definition: EventIDBase.h:91
EventIDBase::bunch_crossing_id
number_type bunch_crossing_id() const
bunch crossing ID, 32 bit unsigned
Definition: EventIDBase.h:97
EventIDBase::UNDEFEVT
static const event_number_t UNDEFEVT
Definition: EventIDBase.h:62
EventIDBase::setTS
void setTS()
Definition: EventIDBase.h:178

## ◆ EventIDBase() [3/3]

EventIDBase::EventIDBase | ( | std::tuple< number_type, number_type, event_number_t > | run_lumi_ev,
|  | std::tuple< number_type, number_type > | time_stamp,
|  | number_type | bunch_crossing_id
| ) |  |

Definition at line 37 of file EventIDBase.cpp.

39 : EventIDBase( std::get<0>( run_lumi_ev ), // run number
40 std::get<2>( run_lumi_ev ), // event number
41 std::get<0>( time_stamp ), // timestamp in seconds
42 std::get<1>( time_stamp ), // nanoseconds offst
43 std::get<1>( run_lumi_ev ), // lumi block
44 bunch_crossing_id ) {}
EventIDBase::EventIDBase
EventIDBase()
Definition: EventIDBase.h:69
EventIDBase::time_stamp
number_type time_stamp() const
time stamp - posix time in seconds from 1970, 32 bit unsigned
Definition: EventIDBase.h:88
EventIDBase::bunch_crossing_id
number_type bunch_crossing_id() const
bunch crossing ID, 32 bit unsigned
Definition: EventIDBase.h:97

## ◆ ~EventIDBase()

virtual EventIDBase::~EventIDBase | ( |  | ) |
| virtual default

## Member Function Documentation

## ◆ bunch_crossing_id()

number_type EventIDBase::bunch_crossing_id | ( |  | ) | const
| inline

bunch crossing ID, 32 bit unsigned

Definition at line 97 of file EventIDBase.h.

97 { return m_bunch_crossing_id; }
EventIDBase::m_bunch_crossing_id
number_type m_bunch_crossing_id
bunch crossing ID, 32 bit unsigned
Definition: EventIDBase.h:199

## ◆ event_number()

event_number_t EventIDBase::event_number | ( |  | ) | const
| inline

event number - 64 bit unsigned

Definition at line 85 of file EventIDBase.h.

85 { return m_event_number; }
EventIDBase::m_event_number
event_number_t m_event_number
event number
Definition: EventIDBase.h:186

## ◆ isLumiEvent()

bool EventIDBase::isLumiEvent | ( |  | ) | const
| inline

Definition at line 145 of file EventIDBase.h.

145 { return m_type & LumiEvent; }
EventIDBase::m_type
unsigned m_type
Definition: EventIDBase.h:175
EventIDBase::LumiEvent
Definition: EventIDBase.h:173

## ◆ isRunEvent()

bool EventIDBase::isRunEvent | ( |  | ) | const
| inline

Definition at line 143 of file EventIDBase.h.

143 { return m_type & RunEvent; }
EventIDBase::m_type
unsigned m_type
Definition: EventIDBase.h:175
EventIDBase::RunEvent
Definition: EventIDBase.h:173

## ◆ isRunLumi()

bool EventIDBase::isRunLumi | ( |  | ) | const
| inline

Definition at line 146 of file EventIDBase.h.

146 { return m_type & RunLumi; }
EventIDBase::m_type
unsigned m_type
Definition: EventIDBase.h:175
EventIDBase::RunLumi
Definition: EventIDBase.h:173

## ◆ isTimeStamp()

bool EventIDBase::isTimeStamp | ( |  | ) | const
| inline

Definition at line 144 of file EventIDBase.h.

144 { return m_type & TimeStamp; }
EventIDBase::m_type
unsigned m_type
Definition: EventIDBase.h:175
EventIDBase::TimeStamp
Definition: EventIDBase.h:173

## ◆ isValid()

bool EventIDBase::isValid | ( |  | ) | const
| inline

Definition at line 147 of file EventIDBase.h.

147 { return m_type != Invalid; }
EventIDBase::m_type
unsigned m_type
Definition: EventIDBase.h:175
EventIDBase::Invalid
Definition: EventIDBase.h:173

## ◆ lumi_block()

number_type EventIDBase::lumi_block | ( |  | ) | const
| inline

luminosity block identifier, 32 bit unsigned

Definition at line 94 of file EventIDBase.h.

94 { return m_lumi_block; }
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:196

## ◆ run_number()

number_type EventIDBase::run_number | ( |  | ) | const
| inline

run number - 32 bit unsigned

Definition at line 82 of file EventIDBase.h.

82 { return m_run_number; }
EventIDBase::m_run_number
number_type m_run_number
run number
Definition: EventIDBase.h:183

## ◆ set_bunch_crossing_id()

void EventIDBase::set_bunch_crossing_id | ( | number_type | bcid | ) |
| inline

set bunch crossing ID

Definition at line 130 of file EventIDBase.h.

130 { m_bunch_crossing_id = bcid; }
EventIDBase::m_bunch_crossing_id
number_type m_bunch_crossing_id
bunch crossing ID, 32 bit unsigned
Definition: EventIDBase.h:199

## ◆ set_event_number()

void EventIDBase::set_event_number | ( | event_number_t | eventNumber | ) |
| inline

set event number

Definition at line 107 of file EventIDBase.h.

107 {
108 m_event_number = eventNumber;
109 if ( m_run_number != UNDEFNUM ) setRE();
110 if ( m_lumi_block != UNDEFNUM ) setLE();
111 }
EventIDBase::UNDEFNUM
static const number_type UNDEFNUM
Definition: EventIDBase.h:61
EventIDBase::setLE
void setLE()
Definition: EventIDBase.h:179
EventIDBase::setRE
void setRE()
Definition: EventIDBase.h:177
EventIDBase::m_event_number
event_number_t m_event_number
event number
Definition: EventIDBase.h:186
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:196
EventIDBase::m_run_number
number_type m_run_number
run number
Definition: EventIDBase.h:183

## ◆ set_lumi_block()

void EventIDBase::set_lumi_block | ( | number_type | lumiBlock | ) |
| inline

set luminosity block identifier

Definition at line 123 of file EventIDBase.h.

123 {
124 m_lumi_block = lumiBlock;
125 if ( m_run_number != UNDEFNUM ) setRL();
126 if ( m_event_number != UNDEFEVT ) setLE();
127 }
EventIDBase::UNDEFNUM
static const number_type UNDEFNUM
Definition: EventIDBase.h:61
EventIDBase::setLE
void setLE()
Definition: EventIDBase.h:179
EventIDBase::m_event_number
event_number_t m_event_number
event number
Definition: EventIDBase.h:186
EventIDBase::setRL
void setRL()
Definition: EventIDBase.h:180
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:196
EventIDBase::m_run_number
number_type m_run_number
run number
Definition: EventIDBase.h:183
EventIDBase::UNDEFEVT
static const event_number_t UNDEFEVT
Definition: EventIDBase.h:62

## ◆ set_run_number()

void EventIDBase::set_run_number | ( | number_type | runNumber | ) |
| inline

set run number

Definition at line 100 of file EventIDBase.h.

100 {
101 m_run_number = runNumber;
102 if ( m_event_number != UNDEFEVT ) setRE();
103 if ( m_lumi_block != UNDEFNUM ) setRL();
104 }
EventIDBase::UNDEFNUM
static const number_type UNDEFNUM
Definition: EventIDBase.h:61
EventIDBase::setRE
void setRE()
Definition: EventIDBase.h:177
EventIDBase::m_event_number
event_number_t m_event_number
event number
Definition: EventIDBase.h:186
EventIDBase::setRL
void setRL()
Definition: EventIDBase.h:180
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:196
EventIDBase::m_run_number
number_type m_run_number
run number
Definition: EventIDBase.h:183
EventIDBase::UNDEFEVT
static const event_number_t UNDEFEVT
Definition: EventIDBase.h:62

## ◆ set_time_stamp()

void EventIDBase::set_time_stamp | ( | number_type | timeStamp | ) |
| inline

set time stamp

Definition at line 114 of file EventIDBase.h.

114 {
115 m_time_stamp = timeStamp;
116 setTS();
117 }
EventIDBase::m_time_stamp
number_type m_time_stamp
posix time in seconds since 1970/01/01
Definition: EventIDBase.h:189
EventIDBase::setTS
void setTS()
Definition: EventIDBase.h:178

## ◆ set_time_stamp_ns_offset()

void EventIDBase::set_time_stamp_ns_offset | ( | number_type | timeStampNs | ) |
| inline

set time stamp in ns

Definition at line 120 of file EventIDBase.h.

120 { m_time_stamp_ns_offset = timeStampNs; }
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:192

## ◆ setLE()

void EventIDBase::setLE | ( |  | ) |
| inline private

Definition at line 179 of file EventIDBase.h.

179 { m_type |= LumiEvent; }
EventIDBase::m_type
unsigned m_type
Definition: EventIDBase.h:175
EventIDBase::LumiEvent
Definition: EventIDBase.h:173

## ◆ setRE()

void EventIDBase::setRE | ( |  | ) |
| inline private

Definition at line 177 of file EventIDBase.h.

177 { m_type |= RunEvent; }
EventIDBase::m_type
unsigned m_type
Definition: EventIDBase.h:175
EventIDBase::RunEvent
Definition: EventIDBase.h:173

## ◆ setRL()

void EventIDBase::setRL | ( |  | ) |
| inline private

Definition at line 180 of file EventIDBase.h.

180 { m_type |= RunLumi; }
EventIDBase::m_type
unsigned m_type
Definition: EventIDBase.h:175
EventIDBase::RunLumi
Definition: EventIDBase.h:173

## ◆ setTS()

void EventIDBase::setTS | ( |  | ) |
| inline private

Definition at line 178 of file EventIDBase.h.

178 { m_type |= TimeStamp; }
EventIDBase::m_type
unsigned m_type
Definition: EventIDBase.h:175
EventIDBase::TimeStamp
Definition: EventIDBase.h:173

## ◆ SortByLumiEvent()

static auto EventIDBase::SortByLumiEvent | ( |  | ) |
| inline static

Definition at line 162 of file EventIDBase.h.

162 {
163 return ::details::add_deref(
164 ::details::make_cmp( []( const EventIDBase& e ) { return std::tie( e.m_lumi_block, e.m_event_number ); } ) );
165 };
std::tie
T tie(T... args)
details::add_deref
auto add_deref(Fun f)
Definition: EventIDBase.h:36
EventIDBase::m_event_number
event_number_t m_event_number
event number
Definition: EventIDBase.h:186
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:196
details::make_cmp
auto make_cmp(Proj p, Cmp cmp={})
Definition: EventIDBase.h:41
EventIDBase
This class provides a unique identification for each event, in terms of run/event number and/or a tim...
Definition: EventIDBase.h:56

## ◆ SortByRunEvent()

static auto EventIDBase::SortByRunEvent | ( |  | ) |
| inline static

Definition at line 157 of file EventIDBase.h.

157 {
158 return ::details::add_deref(
159 ::details::make_cmp( []( const EventIDBase& e ) { return std::tie( e.m_run_number, e.m_event_number ); } ) );
160 };
std::tie
T tie(T... args)
details::add_deref
auto add_deref(Fun f)
Definition: EventIDBase.h:36
EventIDBase::m_event_number
event_number_t m_event_number
event number
Definition: EventIDBase.h:186
EventIDBase::m_run_number
number_type m_run_number
run number
Definition: EventIDBase.h:183
details::make_cmp
auto make_cmp(Proj p, Cmp cmp={})
Definition: EventIDBase.h:41
EventIDBase
This class provides a unique identification for each event, in terms of run/event number and/or a tim...
Definition: EventIDBase.h:56

## ◆ SortByRunLumi()

static auto EventIDBase::SortByRunLumi | ( |  | ) |
| inline static

Definition at line 167 of file EventIDBase.h.

167 {
168 return ::details::add_deref(
169 ::details::make_cmp( []( const EventIDBase& e ) { return std::tie( e.m_run_number, e.m_lumi_block ); } ) );
170 };
std::tie
T tie(T... args)
details::add_deref
auto add_deref(Fun f)
Definition: EventIDBase.h:36
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:196
EventIDBase::m_run_number
number_type m_run_number
run number
Definition: EventIDBase.h:183
details::make_cmp
auto make_cmp(Proj p, Cmp cmp={})
Definition: EventIDBase.h:41
EventIDBase
This class provides a unique identification for each event, in terms of run/event number and/or a tim...
Definition: EventIDBase.h:56

## ◆ SortByTimeStamp()

static auto EventIDBase::SortByTimeStamp | ( |  | ) |
| inline static

Definition at line 152 of file EventIDBase.h.

152 {
153 return ::details::add_deref( ::details::make_cmp(
154 []( const EventIDBase& e ) { return std::tie( e.m_time_stamp, e.m_time_stamp_ns_offset ); } ) );
155 };
std::tie
T tie(T... args)
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:192
details::add_deref
auto add_deref(Fun f)
Definition: EventIDBase.h:36
EventIDBase::m_time_stamp
number_type m_time_stamp
posix time in seconds since 1970/01/01
Definition: EventIDBase.h:189
details::make_cmp
auto make_cmp(Proj p, Cmp cmp={})
Definition: EventIDBase.h:41
EventIDBase
This class provides a unique identification for each event, in terms of run/event number and/or a tim...
Definition: EventIDBase.h:56

## ◆ time_stamp()

number_type EventIDBase::time_stamp | ( |  | ) | const
| inline

time stamp - posix time in seconds from 1970, 32 bit unsigned

Definition at line 88 of file EventIDBase.h.

88 { return m_time_stamp; }
EventIDBase::m_time_stamp
number_type m_time_stamp
posix time in seconds since 1970/01/01
Definition: EventIDBase.h:189

## ◆ time_stamp_ns_offset()

number_type EventIDBase::time_stamp_ns_offset | ( |  | ) | const
| inline

time stamp ns - ns time offset for time_stamp, 32 bit unsigned

Definition at line 91 of file EventIDBase.h.

91 { return m_time_stamp_ns_offset; }
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:192

## Friends And Related Function Documentation

## ◆ EventIDRange

friend class EventIDRange
| friend

Definition at line 64 of file EventIDBase.h.

## ◆ max

EventIDBase max | ( | const EventIDBase & | lhs,
|  | const EventIDBase & | rhs
| ) |  |
| friend

Definition at line 215 of file EventIDBase.h.

215 {
216
217 //"max" is much trickier because we need to handle invalid number explicilty by
218 // checking if a EventIDBase is TS or Run/Lumi
219
220 std::tuple<EventIDBase::number_type, EventIDBase::number_type, EventIDBase::event_number_t> run_lumi_ev;
221 std::tuple<EventIDBase::number_type, EventIDBase::number_type> time_stamp;
222
223 if ( lhs.isTimeStamp() && rhs.isTimeStamp() ) { // both time-stamp, compare them
224 time_stamp = std::max( std::tie( lhs.m_time_stamp, lhs.m_time_stamp_ns_offset ),
225 std::tie( rhs.m_time_stamp, rhs.m_time_stamp_ns_offset ) );
226 } else if ( lhs.isTimeStamp() ) { // only lhs time-stamp: Use it
227 time_stamp = std::tie( lhs.m_time_stamp, lhs.m_time_stamp_ns_offset );
228 } else { // otherwise use rhs time-stamp which might be UNDEFNUM (in case both input values are Run-Lumi only)
229 time_stamp = std::tie( rhs.m_time_stamp, rhs.m_time_stamp_ns_offset );
230 }
231
232 if ( lhs.isRunLumi() && rhs.isRunLumi() ) { // both run-lumi, compare them
233 run_lumi_ev = std::max( std::tie( lhs.m_run_number, lhs.m_lumi_block, lhs.m_event_number ),
234 std::tie( rhs.m_run_number, rhs.m_lumi_block, rhs.m_event_number ) );
235
236 } else if ( lhs.isRunLumi() ) { // only lhs run-lumi: Use it
237 run_lumi_ev = std::tie( lhs.m_run_number, lhs.m_lumi_block, lhs.m_event_number );
238 } else { // otherwise use rhs run-lumi which might be UNDEFNUM (in case both input values are TS-only)
239 run_lumi_ev = std::tie( rhs.m_run_number, rhs.m_lumi_block, rhs.m_event_number );
240 }
241
242 return EventIDBase( run_lumi_ev, time_stamp, lhs.bunch_crossing_id() );
243 }
EventIDBase::isRunLumi
bool isRunLumi() const
Definition: EventIDBase.h:146
std::tie
T tie(T... args)
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:192
EventIDBase::m_event_number
event_number_t m_event_number
event number
Definition: EventIDBase.h:186
EventIDBase::EventIDBase
EventIDBase()
Definition: EventIDBase.h:69
EventIDBase::m_time_stamp
number_type m_time_stamp
posix time in seconds since 1970/01/01
Definition: EventIDBase.h:189
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:196
EventIDBase::m_run_number
number_type m_run_number
run number
Definition: EventIDBase.h:183
EventIDBase::time_stamp
number_type time_stamp() const
time stamp - posix time in seconds from 1970, 32 bit unsigned
Definition: EventIDBase.h:88
std::max
T max(T... args)
std::tuple
EventIDBase::bunch_crossing_id
number_type bunch_crossing_id() const
bunch crossing ID, 32 bit unsigned
Definition: EventIDBase.h:97
EventIDBase::isTimeStamp
bool isTimeStamp() const
Definition: EventIDBase.h:144

## ◆ min

EventIDBase min | ( | const EventIDBase & | lhs,
|  | const EventIDBase & | rhs
| ) |  |
| friend

Definition at line 202 of file EventIDBase.h.

202 {
203
204 //"min" is easy b/c the numbers denoting invalidty for TS or Run/Event/LB are the
205 // largest possible numbers, so naturally larger than any valid number
206
207 return EventIDBase( std::min( std::tie( lhs.m_run_number, lhs.m_lumi_block, lhs.m_event_number ),
208 std::tie( rhs.m_run_number, rhs.m_lumi_block, rhs.m_event_number ) ),
209 std::min( std::tie( lhs.m_time_stamp, lhs.m_time_stamp_ns_offset ),
210 std::tie( rhs.m_time_stamp, rhs.m_time_stamp_ns_offset ) ),
211 lhs.bunch_crossing_id() // bcid doesn't really matter here
212 );
213 }
std::tie
T tie(T... args)
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:192
EventIDBase::m_event_number
event_number_t m_event_number
event number
Definition: EventIDBase.h:186
EventIDBase::EventIDBase
EventIDBase()
Definition: EventIDBase.h:69
EventIDBase::m_time_stamp
number_type m_time_stamp
posix time in seconds since 1970/01/01
Definition: EventIDBase.h:189
std::min
T min(T... args)
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:196
EventIDBase::m_run_number
number_type m_run_number
run number
Definition: EventIDBase.h:183
EventIDBase::bunch_crossing_id
number_type bunch_crossing_id() const
bunch crossing ID, 32 bit unsigned
Definition: EventIDBase.h:97

## ◆ operator!=

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

Definition at line 136 of file EventIDBase.h.

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

## ◆ operator<

bool operator< | ( | const EventIDBase & | lhs,
|  | const EventIDBase & | rhs
| ) |  |
| friend

Definition at line 245 of file EventIDBase.h.

245 {
246 // first try ordering by timestamp if both are non-zero
247 // then try ordering by run/lumi/event
248 // this assumes that both EventIDBase have the same set of values defined.
249
250 if ( lhs.isTimeStamp() && rhs.isTimeStamp() ) {
251 return lhs.m_time_stamp < rhs.m_time_stamp;
252 } else {
253 return std::tie( lhs.m_run_number, lhs.m_lumi_block, lhs.m_event_number ) <
254 std::tie( rhs.m_run_number, rhs.m_lumi_block, rhs.m_event_number );
255 }
256 }
std::tie
T tie(T... args)
EventIDBase::m_event_number
event_number_t m_event_number
event number
Definition: EventIDBase.h:186
EventIDBase::m_time_stamp
number_type m_time_stamp
posix time in seconds since 1970/01/01
Definition: EventIDBase.h:189
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:196
EventIDBase::m_run_number
number_type m_run_number
run number
Definition: EventIDBase.h:183
EventIDBase::isTimeStamp
bool isTimeStamp() const
Definition: EventIDBase.h:144

## ◆ operator<<

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

Extraction operators.

Definition at line 264 of file EventIDBase.h.

264 {
265 if ( rhs.m_type == EventIDBase::Invalid ) return os << "[INVALID]";
266
267 const char* separator = "";
268 os << "[";
269 if ( rhs.m_run_number != EventIDBase::UNDEFNUM ) {
270 os << rhs.m_run_number;
271 separator = ",";
272 }
273
274 if ( rhs.m_event_number != EventIDBase::UNDEFEVT ) {
275 os << separator << rhs.m_event_number;
276 separator = ",";
277 }
278
279 if ( rhs.isTimeStamp() ) {
280 os << separator << "t:" << rhs.m_time_stamp;
281 if ( rhs.m_time_stamp_ns_offset != 0 ) {
282 os << "." << std::setfill( '0' ) << std::setw( 9 ) << rhs.m_time_stamp_ns_offset;
283 }
284 separator = ",";
285 }
286
287 if ( rhs.isLumiEvent() || rhs.isRunLumi() ) {
288 os << separator << "l:" << rhs.m_lumi_block;
289 separator = ",";
290 }
291
292 if ( rhs.m_bunch_crossing_id != 0 ) { os << separator << "b:" << rhs.m_bunch_crossing_id; }
293 os << "]";
294 return os;
295 }
EventIDBase::UNDEFNUM
static const number_type UNDEFNUM
Definition: EventIDBase.h:61
EventIDBase::m_type
unsigned m_type
Definition: EventIDBase.h:175
EventIDBase::isRunLumi
bool isRunLumi() const
Definition: EventIDBase.h:146
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:192
EventIDBase::m_bunch_crossing_id
number_type m_bunch_crossing_id
bunch crossing ID, 32 bit unsigned
Definition: EventIDBase.h:199
EventIDBase::m_event_number
event_number_t m_event_number
event number
Definition: EventIDBase.h:186
std::setw
T setw(T... args)
EventIDBase::m_time_stamp
number_type m_time_stamp
posix time in seconds since 1970/01/01
Definition: EventIDBase.h:189
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:196
EventIDBase::Invalid
Definition: EventIDBase.h:173
std::setfill
T setfill(T... args)
EventIDBase::m_run_number
number_type m_run_number
run number
Definition: EventIDBase.h:183
EventIDBase::isLumiEvent
bool isLumiEvent() const
Definition: EventIDBase.h:145
EventIDBase::UNDEFEVT
static const event_number_t UNDEFEVT
Definition: EventIDBase.h:62
EventIDBase::isTimeStamp
bool isTimeStamp() const
Definition: EventIDBase.h:144

## ◆ operator<=

bool operator<= | ( | const EventIDBase & | lhs,
|  | const EventIDBase & | rhs
| ) |  |
| friend

Definition at line 137 of file EventIDBase.h.

137 { return !( lhs > rhs ); }

## ◆ operator==

bool operator== | ( | const EventIDBase & | lhs,
|  | const EventIDBase & | rhs
| ) |  |
| friend

Comparison operators.

Definition at line 258 of file EventIDBase.h.

258 {
259 // We assume that equality via run/event/lumi numbers is sufficient
260 return ( lhs.m_run_number == rhs.m_run_number && lhs.m_event_number == rhs.m_event_number &&
261 lhs.m_lumi_block == rhs.m_lumi_block );
262 }
EventIDBase::m_event_number
event_number_t m_event_number
event number
Definition: EventIDBase.h:186
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:196
EventIDBase::m_run_number
number_type m_run_number
run number
Definition: EventIDBase.h:183

## ◆ operator>

bool operator> | ( | const EventIDBase & | lhs,
|  | const EventIDBase & | rhs
| ) |  |
| friend

Definition at line 135 of file EventIDBase.h.

135 { return rhs < lhs; }

## ◆ operator>=

bool operator>= | ( | const EventIDBase & | lhs,
|  | const EventIDBase & | rhs
| ) |  |
| friend

Definition at line 138 of file EventIDBase.h.

138 { return !( lhs < rhs ); }

## Member Data Documentation

## ◆ m_bunch_crossing_id

number_type EventIDBase::m_bunch_crossing_id {UNDEFNUM}
| private

bunch crossing ID, 32 bit unsigned

Definition at line 199 of file EventIDBase.h.

## ◆ m_event_number

event_number_t EventIDBase::m_event_number {UNDEFEVT}
| private

event number

Definition at line 186 of file EventIDBase.h.

## ◆ m_lumi_block

number_type EventIDBase::m_lumi_block {UNDEFNUM}
| private

luminosity block number: the number which uniquely tags a luminosity block within a run

Definition at line 196 of file EventIDBase.h.

## ◆ m_run_number

number_type EventIDBase::m_run_number {UNDEFNUM}
| private

run number

Definition at line 183 of file EventIDBase.h.

## ◆ m_time_stamp

number_type EventIDBase::m_time_stamp {UNDEFNUM}
| private

posix time in seconds since 1970/01/01

Definition at line 189 of file EventIDBase.h.

## ◆ m_time_stamp_ns_offset

number_type EventIDBase::m_time_stamp_ns_offset {UNDEFNUM}
| private

time stamp ns - ns time offset for time_stamp, 32 bit unsigned

Definition at line 192 of file EventIDBase.h.

## ◆ m_type

unsigned EventIDBase::m_type {Invalid}
| private

Definition at line 175 of file EventIDBase.h.

## ◆ UNDEFEVT

const EventIDBase::event_number_t EventIDBase::UNDEFEVT = std::numeric_limits<EventIDBase::event_number_t>::max()
| static

Definition at line 62 of file EventIDBase.h.

## ◆ UNDEFNUM

const EventIDBase::number_type EventIDBase::UNDEFNUM = std::numeric_limits<EventIDBase::number_type>::max()
| static

Definition at line 61 of file EventIDBase.h.

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

- GaudiKernel/GaudiKernel/EventIDBase.h
- GaudiKernel/src/Lib/EventIDBase.cpp