| The Gaudi Framework v29r0 (ff2e7097)

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

- File List
- File Members

Classes | Functions
EventIDBase.h File Reference

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

`#include <iostream>`
`#include <stdint.h>`
`#include <tuple>`
Include dependency graph for EventIDBase.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Classes
class | EventIDBase
| This class provides a unique identification for each event, in terms of run/event number and/or a time stamp. More...
class | EventIDBase::SortByTimeStamp
class | EventIDBase::SortByRunEvent
class | EventIDBase::SortByLumiEvent
class | EventIDBase::SortByRunLumi

## Functions
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)
bool | operator>= (const EventIDBase &lhs, const EventIDBase &rhs)
std::ostream & | operator<< (std::ostream &os, const EventIDBase &rhs)

## Detailed Description

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

Author
  RD Schaffer R.D.S.nosp@m.chaf.nosp@m.fer@c.nosp@m.ern..nosp@m.ch
  Paolo Calafiura pcala.nosp@m.fiur.nosp@m.a@lbl.nosp@m..gov
  Charles Leggett

Definition in file EventIDBase.h.

## Function Documentation

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

Definition at line 240 of file EventIDBase.h.

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

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

Definition at line 206 of file EventIDBase.h.

207 {
208 // first try ordering by timestamp if both are non-zero
209 // then try ordering by run/lumi/event
210 // this assumes that both EventIDBase have the same set of values defined.
211
212 if ( lhs.isTimeStamp() && rhs.isTimeStamp() ) {
213 return ( lhs.m_time_stamp < rhs.m_time_stamp );
214 } else {
215 return ( std::tie( lhs.m_run_number, lhs.m_lumi_block, lhs.m_event_number ) <
216 std::tie( rhs.m_run_number, rhs.m_lumi_block, rhs.m_event_number ) );
217 }
218 }
std::tie
T tie(T...args)
EventIDBase::m_event_number
event_number_t m_event_number
event number
Definition: EventIDBase.h:190
EventIDBase::m_time_stamp
number_type m_time_stamp
posix time in seconds since 1970/01/01
Definition: EventIDBase.h:193
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:200
EventIDBase::m_run_number
number_type m_run_number
run number
Definition: EventIDBase.h:187
EventIDBase::isTimeStamp
bool isTimeStamp() const
Definition: EventIDBase.cpp:50

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

Definition at line 244 of file EventIDBase.h.

245 {
246 if ( rhs.m_type == EventIDBase::Invalid ) {
247 os << "[INVALID]";
248 return os;
249 }
250
251 os << "[" << rhs.m_run_number << "," << rhs.m_event_number;
252
253 if ( rhs.isTimeStamp() ) {
254 os << "," << rhs.m_time_stamp << ":" << rhs.m_time_stamp_ns_offset;
255 }
256
257 if ( rhs.isLumiEvent() || rhs.isRunLumi() ) {
258 os << ",l:" << rhs.m_lumi_block;
259 }
260
261 if ( rhs.m_bunch_crossing_id != 0 ) {
262 os << ",b:" << rhs.m_bunch_crossing_id;
263 }
264 os << "]";
265 return os;
266 }
EventIDBase::m_type
unsigned m_type
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:196
EventIDBase::isRunLumi
bool isRunLumi() const
Definition: EventIDBase.cpp:54
EventIDBase::m_bunch_crossing_id
number_type m_bunch_crossing_id
bunch crossing ID, 32 bit unsigned
Definition: EventIDBase.h:203
EventIDBase::m_event_number
event_number_t m_event_number
event number
Definition: EventIDBase.h:190
EventIDBase::m_time_stamp
number_type m_time_stamp
posix time in seconds since 1970/01/01
Definition: EventIDBase.h:193
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:200
EventIDBase::Invalid
Definition: EventIDBase.h:177
EventIDBase::m_run_number
number_type m_run_number
run number
Definition: EventIDBase.h:187
EventIDBase::isTimeStamp
bool isTimeStamp() const
Definition: EventIDBase.cpp:50
EventIDBase::isLumiEvent
bool isLumiEvent() const
Definition: EventIDBase.cpp:52

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

Definition at line 241 of file EventIDBase.h.

241 { return !( lhs > rhs ); }

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

Definition at line 234 of file EventIDBase.h.

235 {
236 // We assume that equality via run/event/lumi numbers is sufficient
237 return ( lhs.m_run_number == rhs.m_run_number && lhs.m_event_number == rhs.m_event_number &&
238 lhs.m_lumi_block == rhs.m_lumi_block );
239 }
EventIDBase::m_event_number
event_number_t m_event_number
event number
Definition: EventIDBase.h:190
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:200
EventIDBase::m_run_number
number_type m_run_number
run number
Definition: EventIDBase.h:187

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

Definition at line 220 of file EventIDBase.h.

221 {
222 // first try ordering by timestamp if both are non-zero
223 // then try ordering by run/lumi/event
224 // this assumes that both EventIDBase have the same set of values defined.
225
226 if ( lhs.isTimeStamp() && rhs.isTimeStamp() ) {
227 return ( lhs.m_time_stamp > rhs.m_time_stamp );
228 } else {
229 return ( std::tie( lhs.m_run_number, lhs.m_lumi_block, lhs.m_event_number ) >
230 std::tie( rhs.m_run_number, rhs.m_lumi_block, rhs.m_event_number ) );
231 }
232 }
std::tie
T tie(T...args)
EventIDBase::m_event_number
event_number_t m_event_number
event number
Definition: EventIDBase.h:190
EventIDBase::m_time_stamp
number_type m_time_stamp
posix time in seconds since 1970/01/01
Definition: EventIDBase.h:193
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:200
EventIDBase::m_run_number
number_type m_run_number
run number
Definition: EventIDBase.h:187
EventIDBase::isTimeStamp
bool isTimeStamp() const
Definition: EventIDBase.cpp:50

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

Definition at line 242 of file EventIDBase.h.

242 { return !( lhs < rhs ); }