97 {
99
100 const EventContext& ctx = Gaudi::Hive::currentContext();
102
103
112 if (lvl1_id == 0) {
114 }
120
121 eformat::helper::SourceIdentifier sid = eformat::helper::SourceIdentifier(eformat::FULL_SD_EVENT, nevt);
122 RawEventWrite*
re =
setRawEvent (std::make_unique<RawEventWrite>(sid.code(), bc_time_sec, bc_time_ns, global_id, run_type, run_no, lumi_block, lvl1_id, bc_id, lvl1_type));
123
124
125 std::vector<eformat::helper::StreamTag> on_streamTags;
126 for (
const auto& sTag : evtInfo->
streamTags()) {
127 on_streamTags.emplace_back(
sTag.name(),
sTag.type(),
sTag.obeysLumiblock(),
sTag.robs(), detsOnline(
sTag.dets()));
128 }
129 uint32_t nStreamTagWords = eformat::helper::size_word(on_streamTags);
130 slot.m_tagBuff.resize (nStreamTagWords);
131 eformat::helper::encode(on_streamTags, nStreamTagWords, slot.m_tagBuff.data());
132 re->stream_tag(nStreamTagWords, slot.m_tagBuff.data());
133
134
136 return StatusCode::SUCCESS;
137 }
138
139
141 if (
m_evtStore->retrieve(trigDecision,
"xTrigDecision") != StatusCode::SUCCESS) {
142 ATH_MSG_WARNING(
"Property " <<
m_fillTriggerBits.name() <<
" set to True but failed to retrieve xAOD::TrigDecision. Leaving empty trigger bits in the event header.");
143 return StatusCode::SUCCESS;
144 }
145
146
147 const std::vector<uint32_t> &tbp = trigDecision->
tbp();
148 const std::vector<uint32_t> &
tap = trigDecision->
tap();
149 const std::vector<uint32_t> &tav = trigDecision->
tav();
150 const size_t l1TotSize = tbp.size() +
tap.size() + tav.size();
151 if (l1TotSize > 0) {
152 slot.m_l1Buff.resize (l1TotSize);
153 size_t l1Size{0};
154 for (const uint32_t tb : tbp) {
155 slot.m_l1Buff[l1Size++] =
tb;
156 }
157 for (const uint32_t tb : tap) {
158 slot.m_l1Buff[l1Size++] =
tb;
159 }
160 for (const uint32_t tb : tav) {
161 slot.m_l1Buff[l1Size++] =
tb;
162 }
163 re->lvl1_trigger_info(l1TotSize, slot.m_l1Buff.data());
164 }
165
166
168 if (lvl2PP.size() > 0) {
169 slot.m_l2Buff = lvl2PP;
170 re->lvl2_trigger_info(lvl2PP.size(), slot.m_l2Buff.data());
171 }
172
173
175 if (efPP.size() > 0) {
176 slot.m_efBuff = efPP;
177 re->event_filter_info(efPP.size(), slot.m_efBuff.data());
178 }
179
180 return StatusCode::SUCCESS;
181}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
Gaudi::Property< bool > m_fillTriggerBits
fill trigger bits
ServiceHandle< StoreGateSvc > m_evtStore
Event store.
RawEventWrite * setRawEvent(std::unique_ptr< RawEventWrite > rawEventWrite)
uint32_t lumiBlock() const
The current event's luminosity block number.
uint32_t bcid() const
The bunch crossing ID of the event.
uint16_t level1TriggerType() const
The Level-1 trigger type.
uint32_t timeStamp() const
POSIX time in seconds from 1970. January 1st.
const std::vector< StreamTag > & streamTags() const
Get the streams that the event was put in.
uint32_t runNumber() const
The current event's run number.
uint32_t timeStampNSOffset() const
Nanosecond time offset wrt. the time stamp.
uint64_t eventNumber() const
The current event's event number.
uint32_t extendedLevel1ID() const
The extended Level-1 identifier.
const std::vector< uint32_t > & tav() const
Get the Trigger After Veto bits.
const std::vector< uint32_t > & lvl2PassedPhysics() const
Get the LVL2 physics decision bits.
const std::vector< uint32_t > & efPassedPhysics() const
Get the EF physics decision bits.
const std::vector< uint32_t > & tap() const
Get the Trigger After Prescale bits.
const std::vector< uint32_t > & tbp() const
Get the Trigger Before Prescale bits.
EventInfo_v1 EventInfo
Definition of the latest event info version.
TrigDecision_v1 TrigDecision
Define the latest version of the trigger decision class.