ATLAS Offline Software
Loading...
Searching...
No Matches
EventID.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3 */
4
5#ifndef EVENTINFO_EVENTID_H
6#define EVENTINFO_EVENTID_H
7
17
18//<<<<<< INCLUDES >>>>>>
19
20#include <format>
21#include <iostream>
22#include <stdint.h>
23
24#include "GaudiKernel/EventIDBase.h"
25
33
34class EventID: public EventIDBase {
35public:
36 typedef EventIDBase::number_type number_type;
37
39
40 EventID();
41 EventID(number_type run_number,
42 uint64_t event_number);
43 EventID(number_type run_number,
44 uint64_t event_number,
45 number_type time_stamp);
46 EventID(number_type run_number,
47 uint64_t event_number,
48 number_type time_stamp,
49 number_type time_stamp_ns_offset,
50 number_type lumi_block,
51 number_type bunch_crossing_id);
52 EventID(number_type run_number,
53 uint64_t event_number,
54 number_type time_stamp,
55 number_type time_stamp_ns_offset,
56 number_type lumi_block,
57 number_type bunch_crossing_id,
62 // Use default copy constructor.
63 virtual ~EventID();
64
65 EventID(const EventID&) = default;
66 EventID(EventID&&) = default;
67 EventID& operator=(const EventID&) = default;
68 EventID& operator=(EventID&&) = default;
70
73 number_type detector_mask0(void) const;
74
77 number_type detector_mask1(void) const;
78
81 number_type detector_mask2(void) const;
82
85 number_type detector_mask3(void) const;
86
89 uint64_t detector_mask(void) const;
90
91
93 void set_detector_mask(number_type detectorMask0,
94 number_type detectorMask1,
95 number_type detectorMask2 = 0,
96 number_type detectorMask3 = 0);
97
99 friend std::ostream& operator << (std::ostream& os, const EventID& rhs);
100private:
106
112
117
122};
123
124
125//<<<<<< INLINE PUBLIC FUNCTIONS >>>>>>
126
127
128inline
131 return m_detector_mask0;
132}
133
134inline
137 return m_detector_mask1;
138}
139
140inline
143 return m_detector_mask2;
144}
145
146inline
149 return m_detector_mask3;
150}
151
152inline
153uint64_t
155 uint64_t result = m_detector_mask1;
156
157 result = result << 32;
158 result |= m_detector_mask0;
159 return(result);
160}
161
162
163namespace std {
164
166template <>
167struct formatter<EventID>
168 : public formatter<string_view>
169{
170 template <class FmtContext>
171 FmtContext::iterator format (const EventID& ei, FmtContext& ctx) const
172 {
173 return std::format_to (ctx.out(),
174 "[Run,Evt,Lumi,Time,BunchCross,DetMask] = [{},{},{},{}:{},{},{:#0x},{:#0x},{:#0x}]",
175 ei.run_number(),
176 ei.event_number(),
177 ei.lumi_block(),
178 ei.time_stamp(),
179 ei.time_stamp_ns_offset(),
180 ei.bunch_crossing_id(),
181 ei.detector_mask(),
182 ei.detector_mask2(),
183 ei.detector_mask3());
184 }
185};
186
187} // namespace std
188
189
190inline std::ostream& operator << (std::ostream& os, const EventID& rhs) {
191 os << std::format ("{}", rhs);
192 return os;
193}
194
195
196#endif // EVENTINFO_EVENTID_H
std::ostream & operator<<(std::ostream &os, const EventID &rhs)
Definition EventID.h:190
This class provides a unique identification for each event, in terms of run/event number and/or a tim...
Definition EventID.h:34
EventID & operator=(const EventID &)=default
friend std::ostream & operator<<(std::ostream &os, const EventID &rhs)
Extraction operators.
Definition EventID.h:190
number_type detector_mask3(void) const
detector mask1 - bit field indicating which TTC zones have been built into the event,...
Definition EventID.h:148
number_type detector_mask2(void) const
detector mask0 - bit field indicating which TTC zones have been built into the event,...
Definition EventID.h:142
number_type detector_mask1(void) const
detector mask1 - bit field indicating which TTC zones have been built into the event,...
Definition EventID.h:136
number_type m_detector_mask2
detector mask2 - additional trigger bits
Definition EventID.h:114
void set_detector_mask(number_type detectorMask0, number_type detectorMask1, number_type detectorMask2=0, number_type detectorMask3=0)
set detector mask
Definition EventID.cxx:70
uint64_t detector_mask(void) const
detector mask - as a 64 bit number - only provides access to the combined 64 bits det mask,...
Definition EventID.h:154
virtual ~EventID()
Definition EventID.cxx:64
EventIDBase::number_type number_type
Definition EventID.h:36
EventID(const EventID &)=default
EventID(EventID &&)=default
EventID()
Definition EventID.cxx:18
EventID & operator=(EventID &&)=default
number_type detector_mask0(void) const
detector mask0 - bit field indicating which TTC zones have been built into the event,...
Definition EventID.h:130
number_type m_detector_mask0
detector mask0 - bit field indicating which TTC zones have been built into the event,...
Definition EventID.h:103
number_type m_detector_mask3
detector mask3 - additional trigger bits
Definition EventID.h:119
number_type m_detector_mask1
detector mask1 - bit field indicating which TTC zones have been built into the event,...
Definition EventID.h:109
STL namespace.
FmtContext::iterator format(const EventID &ei, FmtContext &ctx) const
Definition EventID.h:171