| The Gaudi Framework v32r1 (f65d50dc)

EventIDBase.cpp
Go to the documentation of this file.
1
10 #include "GaudiKernel/EventIDBase.h"
11
12 #include <limits>
13
14 const EventIDBase::number_type EventIDBase::UNDEFNUM = std::numeric_limits<EventIDBase::number_type>::max();
15 const EventIDBase::event_number_t EventIDBase::UNDEFEVT = std::numeric_limits<EventIDBase::event_number_t>::max();
16
17 EventIDBase::EventIDBase( number_type run_number, event_number_t event_number, number_type time_stamp,
18 number_type time_stamp_ns_offset, number_type lumi_block, number_type bunch_crossing_id )
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 }
36
37 EventIDBase::EventIDBase( std::tuple<number_type, number_type, event_number_t> run_lumi_ev,
38 std::tuple<number_type, number_type> time_stamp, number_type bunch_crossing_id )
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::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
std
STL namespace.
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::EventIDBase
EventIDBase()
Definition: EventIDBase.h:69
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::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.h
This class provides a unique identification for each event, in terms of run/event number and/or a tim...
EventIDBase::m_run_number
number_type m_run_number
run number
Definition: EventIDBase.h:183
std::numeric_limits::max
T max(T... args)
std::tuple
Gaudi::Functional::details::get
auto get(const Handle &handle, const Algo &, const EventContext &) -> decltype(details::deref(handle.get()))
Definition: FunctionalDetails.h:332
EventIDBase::event_number_t
uint64_t event_number_t
Definition: EventIDBase.h:59
EventIDBase
This class provides a unique identification for each event, in terms of run/event number and/or a tim...
Definition: EventIDBase.h:56
EventIDBase::number_type
unsigned int number_type
Definition: EventIDBase.h:58
EventIDBase::UNDEFEVT
static const event_number_t UNDEFEVT
Definition: EventIDBase.h:62
EventIDBase::setTS
void setTS()
Definition: EventIDBase.h:178