124{
125 ByteStreamAddress *pRE_Addr{nullptr};
126 pRE_Addr = dynamic_cast<ByteStreamAddress*>(pAddr);
127 if (!pRE_Addr) {
129 return StatusCode::FAILURE;
130 }
131
133
134
138 return StatusCode::FAILURE;
139 }
140
141
143
144
146 if (
re->version() < 0x03010000) {
148 } else {
150 }
151
152
154 uint32_t bc_time_ns =
re->bc_time_nanoseconds();
155
156 if (bc_time_ns > 1000000000) {
157 if (runNumber < 20920) {
158
160 bc_time_ns = bc_time_sec;
161 bc_time_sec= temp;
162 ATH_MSG_DEBUG(
"bc_time second/nanosecond swapped, sec/ns = " << bc_time_sec <<
" " << bc_time_ns);
163 }
164 else {
165
166 ATH_MSG_WARNING(
"bc_time nanosecond number larger than 1e9, it is " << bc_time_ns <<
", reset it to 1 sec");
167 bc_time_ns = 1000000000;
168 }
169 }
170
171
173
174
176
177 unsigned int detMask0 = 0xFFFFFFFF, detMask1 = 0xFFFFFFFF, detMask2 = 0xFFFFFFFF, detMask3 = 0xFFFFFFFF;
178
181 if (!
status.isSuccess()) {
183 }
184 else {
185 const ByteStreamMetadata*
metadata = *(metadatacont->
begin());
187 detMask0 = (
unsigned int)(detectorMask & 0x00000000FFFFFFFF);
188 detMask1 = (
unsigned int)(detectorMask >> 32);
190 detMask2 = (
unsigned int)(detectorMask2 & 0x00000000FFFFFFFF);
191 detMask3 = (
unsigned int)(detectorMask2 >> 32);
192 }
193
194
197 evtInfo.setStore(pEvtInfoAux);
198
207
208
212
213
217 }
220 }
223 }
225
226
227 bool mcEventInfoDecoded = false;
229
231 std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*> mcRobFragments;
232 m_robDataProvider->getROBData(Gaudi::Hive::currentContext(), mcRobIds, mcRobFragments,
"EventInfoByteStreamAuxCnv");
233
234 if (!mcRobFragments.empty()) {
235 ATH_MSG_DEBUG(
"Found MC EventInfo ROB fragment, decoding...");
237 if (
sc.isFailure()) {
238 ATH_MSG_WARNING(
"Failed to decode MC EventInfo from ROB fragment, using default values");
239 } else {
240 ATH_MSG_DEBUG(
"Successfully decoded MC EventInfo from ROB fragment");
241 mcEventInfoDecoded = true;
242 }
243 } else {
244 ATH_MSG_DEBUG(
"No MC EventInfo ROB fragment found, using default values");
245 }
246 }
247
248
250
253
254
256
257
258 uint32_t level1TriggerType =
re->lvl1_trigger_type();
259
260
261 std::vector<xAOD::EventInfo::StreamTag> streamTags;
262 std::vector<eformat::helper::StreamTag> onl_streamTags;
263 re->stream_tag(buffer);
264 eformat::helper::decode(
re->nstream_tag(), buffer, onl_streamTags);
265 for (const eformat::helper::StreamTag& onl_streamTag : onl_streamTags) {
266 std::set<uint32_t> tmp_off_dets = std::set<uint32_t>();
267 if (!onl_streamTag.dets.empty()) {
268 std::set<eformat::SubDetector> tmp_onl_dets = onl_streamTag.dets;
269 for (const eformat::SubDetector& subdet : tmp_onl_dets) {
270 tmp_off_dets.insert((uint32_t) subdet);
271 }
272 }
273 streamTags.push_back(xAOD::EventInfo::StreamTag(onl_streamTag.name
274 , onl_streamTag.type
275 , onl_streamTag.obeys_lumiblock
276 , onl_streamTag.robs
277 , tmp_off_dets)
278 );
279 }
280
282
283
284 if (!mcEventInfoDecoded) {
286 }
289
290
293
294 ATH_MSG_DEBUG(
" New xAOD::EventAuxInfo made, run/event= " << runNumber
295 << " " << eventNumber
296 <<
" Time stamp = " <<
ascTime(bc_time_sec)
297 );
298
299 return StatusCode::SUCCESS;
300}
const boost::regex re(r_e)
#define ATH_MSG_WARNING(x)
ByteStreamMetadataContainer
OFFLINE_FRAGMENTS_NAMESPACE::FullEventFragment RawEvent
data type for reading raw event
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
std::string ascTime(unsigned int t)
convert timestamp to ascii time.
ToolHandle< IMCEventInfoByteStreamTool > m_mcEventInfoTool
Tool for decoding MC EventInfo from ROB.
void setBCID(uint32_t value)
Set the bunch crossing ID of the event.
void setDetectorMask(uint32_t mask0, uint32_t mask1)
Set the bit fields indicating with TTC timezones were present.
void setTimeStampNSOffset(uint32_t value)
Set the nanosecond offset wrt. the time stamp.
void setMCEventNumber(uint64_t value)
Set the MC generator's event number.
@ Core
Core flags describing the event.
void setStreamTags(const std::vector< StreamTag > &value)
Set the streams that the event was put in.
void setTimeStamp(uint32_t value)
Set the POSIX time of the event.
void setLevel1TriggerType(uint16_t value)
Set the Level-1 trigger type.
bool setEventFlags(EventFlagSubDet subDet, uint32_t flags)
Set the event flags for a particular sub-detector.
void setDetectorMaskExt(uint32_t mask2, uint32_t mask3)
Set the bit fields indicating with TTC timezones were present.
void setEventNumber(uint64_t value)
Set the current event's event number.
void setEventTypeBitmask(uint32_t value)
Set the event type bitmask.
void setMCChannelNumber(uint32_t value)
Set the MC generator's channel number.
void setExtendedLevel1ID(uint32_t value)
Set the extended Level-1 identifier.
void setMCEventWeights(const std::vector< float > &value)
Set the weights of all the MC events used in the simulation.
void setRunNumber(uint32_t value)
Set the current event's run number.
@ IS_CALIBRATION
true: calibration, false: physics
@ IS_SIMULATION
true: simulation, false: data
@ IS_TESTBEAM
true: testbeam, false: full detector
void setStatusElement(uint32_t value)
Set the trigger status element.
void setLumiBlock(uint32_t value)
Set the current event's luminosity block number.
::StatusCode StatusCode
StatusCode definition for legacy code.
DataObject * asStorable(SG::DataObjectSharedPtr< T > pObject)
EventInfo_v1 EventInfo
Definition of the latest event info version.
EventAuxInfo_v3 EventAuxInfo
Definition of the latest event auxiliary info version.