44 {
46
48 ATH_MSG_ERROR(
"EventInfoReadKey not configured for encoding");
49 return StatusCode::FAILURE;
50 }
51
52
54 if (!evtInfoHandle.isValid()) {
56 return StatusCode::FAILURE;
57 }
59
60
62 ATH_MSG_DEBUG(
"Event is not simulation, skipping MC EventInfo encoding");
63 return StatusCode::SUCCESS;
64 }
65
66
68
69
77
78
81 if (acc_pileUpMixtureLow.isAvailable(*evtInfo)) {
82 pileUpMixtureLow = acc_pileUpMixtureLow(*evtInfo);
83 }
84 if (acc_pileUpMixtureHigh.isAvailable(*evtInfo)) {
85 pileUpMixtureHigh = acc_pileUpMixtureHigh(*evtInfo);
86 }
87
88
91
92
94
95 ATH_MSG_DEBUG(
"Encoding MC EventInfo: mcChannelNumber=" << mcChannelNumber
96 << ", mcEventNumber=" << mcEventNumber
97 << ", actualMu=" << actualMu
98 << ", averageMu=" << averageMu
99 << ", eventTypeBitmask=0x" << std::hex << eventTypeBitmask << std::dec
100 << ", extendedLevel1ID=" << extendedLevel1ID
101 << ", backgroundFlags=0x" << std::hex << backgroundFlags << std::dec
102 << ", nWeights=" << nWeights);
103
104
106
107
109
110
112
113
115
116
119
120
121 data[
idx++] = std::bit_cast<uint32_t>(actualMu);
122
123
124 data[
idx++] = std::bit_cast<uint32_t>(averageMu);
125
126
127 data[
idx++] = eventTypeBitmask;
128
129
132
133
136
137
138 data[
idx++] = extendedLevel1ID;
139
140
142
143
145
146
147 for (
size_t i = 0;
i < nWeights; ++
i) {
148 data[
idx++] = std::bit_cast<uint32_t>(weights[i]);
149 }
150
151
153
154 ATH_MSG_DEBUG(
"Created MC EventInfo ROB fragment with " << ndata <<
" words");
155 return StatusCode::SUCCESS;
156}
uint64_t mcEventNumber() const
The MC generator's event number.
const std::vector< float > & mcEventWeights() const
The weights of all the MC events used in the simulation.
bool eventType(EventType type) const
Check for one particular bitmask value.
uint32_t eventTypeBitmask() const
The event type bitmask.
float averageInteractionsPerCrossing() const
Average interactions per crossing for all BCIDs - for out-of-time pile-up.
float actualInteractionsPerCrossing() const
Average interactions per crossing for the current BCID - for in-time pile-up.
uint32_t eventFlags(EventFlagSubDet subDet) const
Get the event flags for a particular sub-detector.
@ IS_SIMULATION
true: simulation, false: data
uint32_t mcChannelNumber() const
The MC generator's channel number.
uint32_t extendedLevel1ID() const
The extended Level-1 identifier.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
EventInfo_v1 EventInfo
Definition of the latest event info version.