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 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...
 

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::ostreamoperator<< (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

Definition in file EventIDBase.h.

Function Documentation

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

Definition at line 136 of file EventIDBase.h.

136  {
137  return !(lhs == rhs);
138 }
bool operator< ( const EventIDBase lhs,
const EventIDBase rhs 
)
inline

Definition at line 119 of file EventIDBase.h.

119  {
120  // We are assuming that ALL events will have run and event numbers,
121  // and never just a time stamp.
122  // FIXME: any use for also ordering by lumi-block ?
123  return lhs.m_run_number<rhs.m_run_number ||
124  ( lhs.m_run_number==rhs.m_run_number &&
125  lhs.m_event_number<rhs.m_event_number) ;
126 }
uint64_t m_event_number
event number
Definition: EventIDBase.h:101
number_type m_run_number
run number
Definition: EventIDBase.h:98
std::ostream& operator<< ( std::ostream os,
const EventIDBase rhs 
)
inline

Definition at line 146 of file EventIDBase.h.

146  {
147  os << "["
148  << rhs.m_run_number
149  << "," << rhs.m_event_number;
150 
151  if ( rhs.m_time_stamp != 0 ) {
152  os << "," << rhs.m_time_stamp << ":" << rhs.m_time_stamp_ns_offset;
153  }
154 
155  if ( rhs.m_lumiBlock != 0) {
156  os << ",l:" << rhs.m_lumiBlock;
157  }
158 
159  if ( rhs.m_bunch_crossing_id != 0) {
160  os << ",b:" << rhs.m_bunch_crossing_id;
161  }
162  os << "]";
163  return os;
164 }
uint64_t m_event_number
event number
Definition: EventIDBase.h:101
number_type m_lumiBlock
luminosity block number: the number which uniquely tags a luminosity block within a run ...
Definition: EventIDBase.h:111
number_type m_time_stamp_ns_offset
time stamp ns - ns time offset for time_stamp, 32 bit unsigned
Definition: EventIDBase.h:107
number_type m_bunch_crossing_id
bunch crossing ID, 32 bit unsigned
Definition: EventIDBase.h:114
number_type m_time_stamp
posix time in seconds since 1970/01/01
Definition: EventIDBase.h:104
number_type m_run_number
run number
Definition: EventIDBase.h:98
bool operator<= ( const EventIDBase lhs,
const EventIDBase rhs 
)
inline

Definition at line 139 of file EventIDBase.h.

139  {
140  return !(lhs > rhs);
141 }
bool operator== ( const EventIDBase lhs,
const EventIDBase rhs 
)
inline

Definition at line 128 of file EventIDBase.h.

128  {
129  // We assume that equality via run/event numbers is sufficient
130  return lhs.m_run_number == rhs.m_run_number &&
131  lhs.m_event_number == rhs.m_event_number;
132 }
uint64_t m_event_number
event number
Definition: EventIDBase.h:101
number_type m_run_number
run number
Definition: EventIDBase.h:98
bool operator> ( const EventIDBase lhs,
const EventIDBase rhs 
)
inline

Definition at line 133 of file EventIDBase.h.

133  {
134  return !( (lhs < rhs) || (lhs == rhs));
135 }
bool operator>= ( const EventIDBase lhs,
const EventIDBase rhs 
)
inline

Definition at line 142 of file EventIDBase.h.

142  {
143  return !(lhs < rhs);
144 }