1 #ifndef GAUDIKERNEL_EVENTIDBASE_H 2 #define GAUDIKERNEL_EVENTIDBASE_H 1 24 template <
typename lambda>
27 template <
typename T,
typename Ret,
typename Arg>
34 template <
typename lambda>
37 template <
typename Fun>
40 return compose( f, [=](
auto*... p ) {
return f( *p... ); } );
43 template <
typename Proj,
typename Cmp = std::greater<>>
73 EventIDBase( number_type run_number, event_number_t event_number, number_type time_stamp = UNDEFNUM,
74 number_type time_stamp_ns_offset = 0, number_type lumi_block = UNDEFNUM,
75 number_type bunch_crossing_id = 0 );
101 m_run_number = runNumber;
102 if ( m_event_number != UNDEFEVT ) setRE();
103 if ( m_lumi_block != UNDEFNUM ) setRL();
109 m_event_number = eventNumber;
110 if ( m_run_number != UNDEFNUM ) setRE();
111 if ( m_lumi_block != UNDEFNUM ) setLE();
117 m_time_stamp = timeStamp;
127 m_lumi_block = lumiBlock;
128 if ( m_run_number != UNDEFNUM ) setRL();
129 if ( m_event_number != UNDEFEVT ) setLE();
177 enum Type {
Invalid = 0, RunEvent = 1 << 1, TimeStamp = 1 << 2, LumiEvent = 1 << 3, RunLumi = 1 << 4 };
181 void setRE() { m_type |= RunEvent; }
182 void setTS() { m_type |= TimeStamp; }
183 void setLE() { m_type |= LumiEvent; }
187 number_type m_run_number{UNDEFNUM};
190 event_number_t m_event_number{UNDEFEVT};
193 number_type m_time_stamp{UNDEFNUM};
196 number_type m_time_stamp_ns_offset{UNDEFNUM};
200 number_type m_lumi_block{UNDEFNUM};
203 number_type m_bunch_crossing_id{UNDEFNUM};
231 const char* separator =
"";
263 #endif // EVENTINFO_EVENTID_H void set_time_stamp(number_type timeStamp)
set time stamp
static const number_type UNDEFNUM
std::ostream & operator<<(std::ostream &os, const EventIDBase &rhs)
void set_time_stamp_ns_offset(number_type timeStampNs)
set time stamp in ns
static auto SortByLumiEvent()
void set_lumi_block(number_type lumiBlock)
set luminosity block identifier
void set_run_number(number_type runNumber)
set run number
number_type bunch_crossing_id() const
bunch crossing ID, 32 bit unsigned
static auto SortByRunEvent()
static auto SortByTimeStamp()
number_type m_time_stamp_ns_offset
time stamp ns - ns time offset for time_stamp, 32 bit unsigned
friend bool operator<=(const EventIDBase &lhs, const EventIDBase &rhs)
void set_bunch_crossing_id(number_type bcid)
set bunch crossing ID
unsigned long long uint64_t
number_type m_bunch_crossing_id
bunch crossing ID, 32 bit unsigned
number_type lumi_block() const
luminosity block identifier, 32 bit unsigned
event_number_t m_event_number
event number
number_type time_stamp() const
time stamp - posix time in seconds from 1970, 32 bit unsigned
number_type m_time_stamp
posix time in seconds since 1970/01/01
number_type m_lumi_block
luminosity block number: the number which uniquely tags a luminosity block within a run ...
typename arg_helper< lambda >::type argument_t
friend bool operator!=(const EventIDBase &lhs, const EventIDBase &rhs)
number_type m_run_number
run number
void set_event_number(event_number_t eventNumber)
set event number
number_type run_number() const
run number - 32 bit unsigned
bool operator==(const EventIDBase &lhs, const EventIDBase &rhs)
friend bool operator>(const EventIDBase &lhs, const EventIDBase &rhs)
number_type time_stamp_ns_offset() const
time stamp ns - ns time offset for time_stamp, 32 bit unsigned
bool operator<(const EventIDBase &lhs, const EventIDBase &rhs)
static auto SortByRunLumi()
auto make_cmp(Proj p, Cmp cmp={})
This class provides a unique identification for each event, in terms of run/event number and/or a tim...
auto compose(lambda_ts &&...lambdas)
friend bool operator>=(const EventIDBase &lhs, const EventIDBase &rhs)
static const event_number_t UNDEFEVT
event_number_t event_number() const
event number - 64 bit unsigned