| The Gaudi Framework v28r2p1 (f1a77ff4)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Classes | Public Types | 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>`

## Classes
class | SortByLumiEvent
class | SortByRunEvent
class | SortByTimeStamp

## 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 | 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)
virtual | ~EventIDBase ()

## Static Public Attributes
static const number_type | UNDEFNUM
static const event_number_t | UNDEFEVT

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

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

## 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_lumiBlock {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
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)
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 29 of file EventIDBase.h.

## Member Typedef Documentation

typedef uint64_t EventIDBase::event_number_t

Definition at line 33 of file EventIDBase.h.

typedef unsigned int EventIDBase::number_type

Definition at line 32 of file EventIDBase.h.

## Member Enumeration Documentation

enum EventIDBase::Type
| private

Enumerator
Invalid |
RunEvent |
TimeStamp |
LumiEvent |

Definition at line 151 of file EventIDBase.h.

151 {
152 Invalid = 0,
153 RunEvent = 1 << 1,
154 TimeStamp = 1 << 2,
155 LumiEvent = 1 << 3
156 };
EventIDBase::LumiEvent
Definition: EventIDBase.h:155
EventIDBase::Invalid
Definition: EventIDBase.h:152
EventIDBase::RunEvent
Definition: EventIDBase.h:153
EventIDBase::TimeStamp
Definition: EventIDBase.h:154

## Constructor & Destructor Documentation

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

Definition at line 42 of file EventIDBase.h.

42 {};

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 19 of file EventIDBase.cpp.

25 :
26 m_run_number (run_number),
27 m_event_number (event_number),
28 m_time_stamp (time_stamp),
29 m_time_stamp_ns_offset (time_stamp_ns_offset),
30 m_lumiBlock (lumi_block),
31 m_bunch_crossing_id (bunch_crossing_id)
32 {
33 if (m_run_number != UNDEFNUM && m_event_number != UNDEFEVT) {
34 setRE();
35 }
36
37 if (m_time_stamp != UNDEFNUM) {
38 setTS();
39 if (m_time_stamp_ns_offset == UNDEFNUM) {
40 m_time_stamp_ns_offset = 0;
41 }
42 }
43
44 if (m_lumiBlock != UNDEFNUM && m_event_number != UNDEFEVT) {
45 setLE();
46 }
47
48 }
EventIDBase::UNDEFNUM
static const number_type UNDEFNUM
Definition: EventIDBase.h:35
EventIDBase::setLE
void setLE()
Definition: EventIDBase.h:162
EventIDBase::bunch_crossing_id
number_type bunch_crossing_id() const
bunch crossing ID, 32 bit unsigned
Definition: EventIDBase.h:69
EventIDBase::m_lumiBlock
number_type m_lumiBlock
luminosity block number: the number which uniquely tags a luminosity block within a run ...
Definition: EventIDBase.h:178
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:174
EventIDBase::m_bunch_crossing_id
number_type m_bunch_crossing_id
bunch crossing ID, 32 bit unsigned
Definition: EventIDBase.h:181
EventIDBase::setRE
void setRE()
Definition: EventIDBase.h:160
EventIDBase::lumi_block
number_type lumi_block() const
luminosity block identifier, 32 bit unsigned
Definition: EventIDBase.h:66
EventIDBase::m_event_number
event_number_t m_event_number
event number
Definition: EventIDBase.h:168
EventIDBase::time_stamp
number_type time_stamp() const
time stamp - posix time in seconds from 1970, 32 bit unsigned
Definition: EventIDBase.h:60
EventIDBase::m_time_stamp
number_type m_time_stamp
posix time in seconds since 1970/01/01
Definition: EventIDBase.h:171
EventIDBase::m_run_number
number_type m_run_number
run number
Definition: EventIDBase.h:165
EventIDBase::run_number
number_type run_number() const
run number - 32 bit unsigned
Definition: EventIDBase.h:54
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:63
EventIDBase::UNDEFEVT
static const event_number_t UNDEFEVT
Definition: EventIDBase.h:36
EventIDBase::setTS
void setTS()
Definition: EventIDBase.h:161
EventIDBase::event_number
event_number_t event_number() const
event number - 64 bit unsigned
Definition: EventIDBase.h:57

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

Definition at line 50 of file EventIDBase.cpp.

51 {}

## Member Function Documentation

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

bunch crossing ID, 32 bit unsigned

Definition at line 69 of file EventIDBase.h.

69 { 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:181

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

event number - 64 bit unsigned

Definition at line 57 of file EventIDBase.h.

57 { return m_event_number; }
EventIDBase::m_event_number
event_number_t m_event_number
event number
Definition: EventIDBase.h:168

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

Definition at line 64 of file EventIDBase.cpp.

64 {
65 return ( m_type & LumiEvent );
66 }
EventIDBase::m_type
unsigned m_type
Definition: EventIDBase.h:158
EventIDBase::LumiEvent
Definition: EventIDBase.h:155

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

Definition at line 54 of file EventIDBase.cpp.

54 {
55 return ( m_type & RunEvent );
56 }
EventIDBase::m_type
unsigned m_type
Definition: EventIDBase.h:158
EventIDBase::RunEvent
Definition: EventIDBase.h:153

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

Definition at line 59 of file EventIDBase.cpp.

59 {
60 return ( m_type & TimeStamp );
61 }
EventIDBase::m_type
unsigned m_type
Definition: EventIDBase.h:158
EventIDBase::TimeStamp
Definition: EventIDBase.h:154

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

Definition at line 69 of file EventIDBase.cpp.

69 {
70 return ( m_type != Invalid );
71 }
EventIDBase::m_type
unsigned m_type
Definition: EventIDBase.h:158
EventIDBase::Invalid
Definition: EventIDBase.h:152

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

luminosity block identifier, 32 bit unsigned

Definition at line 66 of file EventIDBase.h.

66 { return m_lumiBlock; }
EventIDBase::m_lumiBlock
number_type m_lumiBlock
luminosity block number: the number which uniquely tags a luminosity block within a run ...
Definition: EventIDBase.h:178

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

run number - 32 bit unsigned

Definition at line 54 of file EventIDBase.h.

54 { return m_run_number; }
EventIDBase::m_run_number
number_type m_run_number
run number
Definition: EventIDBase.h:165

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

set bunch crossing ID

Definition at line 89 of file EventIDBase.h.

89 { 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:181

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

set event number

Definition at line 75 of file EventIDBase.h.

75 { m_event_number = eventNumber; }
EventIDBase::m_event_number
event_number_t m_event_number
event number
Definition: EventIDBase.h:168

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

set luminosity block identifier

Definition at line 86 of file EventIDBase.h.

86 { m_lumiBlock = lumiBlock; setLE(); }
EventIDBase::setLE
void setLE()
Definition: EventIDBase.h:162
EventIDBase::m_lumiBlock
number_type m_lumiBlock
luminosity block number: the number which uniquely tags a luminosity block within a run ...
Definition: EventIDBase.h:178

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

set run number

Definition at line 72 of file EventIDBase.h.

72 { m_run_number = runNumber; setRE();}
EventIDBase::setRE
void setRE()
Definition: EventIDBase.h:160
EventIDBase::m_run_number
number_type m_run_number
run number
Definition: EventIDBase.h:165

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

set time stamp

Definition at line 78 of file EventIDBase.h.

78 { m_time_stamp = timeStamp; setTS();}
EventIDBase::m_time_stamp
number_type m_time_stamp
posix time in seconds since 1970/01/01
Definition: EventIDBase.h:171
EventIDBase::setTS
void setTS()
Definition: EventIDBase.h:161

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

set time stamp in ns

Definition at line 81 of file EventIDBase.h.

81 {
82 m_time_stamp_ns_offset = timeStampNs;
83 }
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:174

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

Definition at line 162 of file EventIDBase.h.

162 { m_type = m_type | LumiEvent; }
EventIDBase::m_type
unsigned m_type
Definition: EventIDBase.h:158
EventIDBase::LumiEvent
Definition: EventIDBase.h:155

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

Definition at line 160 of file EventIDBase.h.

160 { m_type = m_type | RunEvent; }
EventIDBase::m_type
unsigned m_type
Definition: EventIDBase.h:158
EventIDBase::RunEvent
Definition: EventIDBase.h:153

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

Definition at line 161 of file EventIDBase.h.

161 { m_type = m_type | TimeStamp; }
EventIDBase::m_type
unsigned m_type
Definition: EventIDBase.h:158
EventIDBase::TimeStamp
Definition: EventIDBase.h:154

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

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

Definition at line 60 of file EventIDBase.h.

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

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

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

Definition at line 63 of file EventIDBase.h.

63 { 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:174

## Friends And Related Function Documentation

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

Definition at line 211 of file EventIDBase.h.

211 {
212 return !(lhs == rhs);
213 }

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

Comparison operators.

Definition at line 185 of file EventIDBase.h.

185 {
186 // first try ordering by timestamp if both are non-zero
187 // then try ordering by lumi/event if both have non-zero lumi
188 // then order by run/event
189
190 if (lhs.isTimeStamp() && rhs.isTimeStamp()) {
191 return (lhs.m_time_stamp < rhs.m_time_stamp);
192 } else {
193 if (lhs.isLumiEvent() && rhs.isLumiEvent()) {
194 return (std::tie(lhs.m_lumiBlock, lhs.m_event_number) <
195 std::tie(rhs.m_lumiBlock, rhs.m_event_number) );
196 } else {
197 return (std::tie(lhs.m_run_number, lhs.m_event_number) <
198 std::tie(rhs.m_run_number, rhs.m_event_number) );
199 }
200 }
201 }
EventIDBase::m_lumiBlock
number_type m_lumiBlock
luminosity block number: the number which uniquely tags a luminosity block within a run ...
Definition: EventIDBase.h:178
std::tie
T tie(T...args)
EventIDBase::m_event_number
event_number_t m_event_number
event number
Definition: EventIDBase.h:168
EventIDBase::m_time_stamp
number_type m_time_stamp
posix time in seconds since 1970/01/01
Definition: EventIDBase.h:171
EventIDBase::m_run_number
number_type m_run_number
run number
Definition: EventIDBase.h:165
EventIDBase::isTimeStamp
bool isTimeStamp() const
Definition: EventIDBase.cpp:59
EventIDBase::isLumiEvent
bool isLumiEvent() const
Definition: EventIDBase.cpp:64

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

Extraction operators.

Definition at line 221 of file EventIDBase.h.

221 {
222 if (rhs.m_type == EventIDBase::Invalid) {
223 os << "[INVALID]";
224 return os;
225 }
226
227 os << "["
228 << rhs.m_run_number
229 << "," << rhs.m_event_number;
230
231 if ( rhs.isTimeStamp() != 0 ) {
232 os << "," << rhs.m_time_stamp << ":" << rhs.m_time_stamp_ns_offset;
233 }
234
235 if ( rhs.isLumiEvent() != 0) {
236 os << ",l:" << rhs.m_lumiBlock;
237 }
238
239 if ( rhs.m_bunch_crossing_id != 0) {
240 os << ",b:" << rhs.m_bunch_crossing_id;
241 }
242 os << "]";
243 return os;
244 }
EventIDBase::m_type
unsigned m_type
Definition: EventIDBase.h:158
EventIDBase::m_lumiBlock
number_type m_lumiBlock
luminosity block number: the number which uniquely tags a luminosity block within a run ...
Definition: EventIDBase.h:178
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:174
EventIDBase::m_bunch_crossing_id
number_type m_bunch_crossing_id
bunch crossing ID, 32 bit unsigned
Definition: EventIDBase.h:181
EventIDBase::m_event_number
event_number_t m_event_number
event number
Definition: EventIDBase.h:168
EventIDBase::m_time_stamp
number_type m_time_stamp
posix time in seconds since 1970/01/01
Definition: EventIDBase.h:171
EventIDBase::Invalid
Definition: EventIDBase.h:152
EventIDBase::m_run_number
number_type m_run_number
run number
Definition: EventIDBase.h:165
EventIDBase::isTimeStamp
bool isTimeStamp() const
Definition: EventIDBase.cpp:59
EventIDBase::isLumiEvent
bool isLumiEvent() const
Definition: EventIDBase.cpp:64

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

Definition at line 214 of file EventIDBase.h.

214 {
215 return !(lhs > rhs);
216 }

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

Definition at line 203 of file EventIDBase.h.

203 {
204 // We assume that equality via run/event numbers is sufficient
205 return ( lhs.m_run_number == rhs.m_run_number &&
206 lhs.m_event_number == rhs.m_event_number );
207 }
EventIDBase::m_event_number
event_number_t m_event_number
event number
Definition: EventIDBase.h:168
EventIDBase::m_run_number
number_type m_run_number
run number
Definition: EventIDBase.h:165

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

Definition at line 208 of file EventIDBase.h.

208 {
209 return !( (lhs < rhs) || (lhs == rhs));
210 }

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

Definition at line 217 of file EventIDBase.h.

217 {
218 return !(lhs < rhs);
219 }

## Member Data Documentation

number_type EventIDBase::m_bunch_crossing_id {UNDEFNUM}
| private

bunch crossing ID, 32 bit unsigned

Definition at line 181 of file EventIDBase.h.

event_number_t EventIDBase::m_event_number {UNDEFEVT}
| private

event number

Definition at line 168 of file EventIDBase.h.

number_type EventIDBase::m_lumiBlock {UNDEFNUM}
| private

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

Definition at line 178 of file EventIDBase.h.

number_type EventIDBase::m_run_number {UNDEFNUM}
| private

run number

Definition at line 165 of file EventIDBase.h.

number_type EventIDBase::m_time_stamp {UNDEFNUM}
| private

posix time in seconds since 1970/01/01

Definition at line 171 of file EventIDBase.h.

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 174 of file EventIDBase.h.

unsigned EventIDBase::m_type {Invalid}
| private

Definition at line 158 of file EventIDBase.h.

const EventIDBase::event_number_t EventIDBase::UNDEFEVT
| static

Initial value:
=
std::numeric_limits<EventIDBase::event_number_t>::max()

Definition at line 36 of file EventIDBase.h.

const EventIDBase::number_type EventIDBase::UNDEFNUM
| static

Initial value:
=
std::numeric_limits<EventIDBase::number_type>::max()

Definition at line 35 of file EventIDBase.h.

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

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