ATLAS Offline Software
Loading...
Searching...
No Matches
HLTResultMTMaker Class Reference

Tool to create the HLTResultMT at the end of each event. More...

#include <HLTResultMTMaker.h>

Inheritance diagram for HLTResultMTMaker:
Collaboration diagram for HLTResultMTMaker:

Public Member Functions

 HLTResultMTMaker (const std::string &type, const std::string &name, const IInterface *parent)
 Standard constructor.
virtual ~HLTResultMTMaker () override=default
 Standard destructor.
virtual StatusCode initialize () override
virtual StatusCode start () override
virtual StatusCode finalize () override
StatusCode makeResult (const EventContext &eventContext) const
 Create and fill a new HLTResultMT, and record it in the event store.
StatusCode fillResult (HLT::HLTResultMT &hltResult, const EventContext &eventContext) const
 Fill an existing HLTResultMT with event information.
const std::string & resultName () const
 Return name of the HLTResultMT.
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

void validatePEBInfo (HLT::HLTResultMT &hltResult) const
 Check ROB and SubDet lists in StreamTags and remove those which are disabled.
StatusCode validateExtraROBsAndSubDets ()
 Check ExtraROBs and ExtraSubDets against the detector mask and drop the masked out IDs.
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

SG::WriteHandleKey< HLT::HLTResultMTm_hltResultWHKey
 StoreGate key for the HLTResultMT.
SG::WriteHandleKey< xAOD::TrigCompositeContainerm_runtimeMetadataWHKey
 StoreGate key for HLT Runtime Metadata container.
SG::ReadHandleKey< ByteStreamMetadataContainerm_bsMetaDataContRHKey
 StoreGate key for the ByteStreamMetadata container to retrieve detector mask.
ToolHandle< HLTResultMTMakerToolm_streamTagMaker
 Tool creating stream tags (defines if event is accepted)
ToolHandleArray< HLTResultMTMakerToolm_makerTools
 Tools filling the HLTResultMT object.
ToolHandle< GenericMonitoringToolm_monTool
 Monitoring tool.
ServiceHandle< Gaudi::Interfaces::IOptionsSvc > m_jobOptionsSvc
 Handle to JobOptionsSvc used to retrieve the DataFlowConfig property.
Gaudi::Property< std::vector< uint32_t > > m_extraEnabledROBs
 Extra enabled ROBs.
Gaudi::Property< std::vector< uint32_t > > m_extraROBs
 Extra enabled ROBs checked against detector mask.
Gaudi::Property< std::vector< uint32_t > > m_extraEnabledSubDets
 Extra enabled SubDets.
Gaudi::Property< std::vector< uint32_t > > m_extraSubDets
 Extra enabled SubDets checked against detector mask.
std::set< uint32_t > m_enabledROBs
 List of enabled ROBs retrieved during initialisation.
std::set< eformat::SubDetector > m_enabledSubDets
 List of enabled SubDets retrieved during initialisation.
bool m_skipValidatePEBInfo {false}
 If true, don't call validatePEBInfo.
std::atomic_bool m_emptyPEBInfoErrorPrinted {false}
 Flag if empty PEB list error was already printed.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Tool to create the HLTResultMT at the end of each event.

Definition at line 29 of file HLTResultMTMaker.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ HLTResultMTMaker()

HLTResultMTMaker::HLTResultMTMaker ( const std::string & type,
const std::string & name,
const IInterface * parent )

Standard constructor.

Definition at line 58 of file HLTResultMTMaker.cxx.

59 : AthAlgTool(type, name, parent) {}
AthAlgTool()
Default constructor:

◆ ~HLTResultMTMaker()

virtual HLTResultMTMaker::~HLTResultMTMaker ( )
overridevirtualdefault

Standard destructor.

Member Function Documentation

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ fillResult()

StatusCode HLTResultMTMaker::fillResult ( HLT::HLTResultMT & hltResult,
const EventContext & eventContext ) const

Fill an existing HLTResultMT with event information.

Definition at line 150 of file HLTResultMTMaker.cxx.

150 {
151 auto monTime = Monitored::Timer<std::chrono::duration<float, std::milli>>("TIME_fillResult");
152
153 // Save HLT runtime metadata
154 SG::WriteHandle<xAOD::TrigCompositeContainer> runtimeMetadataOutput = TrigCompositeUtils::createAndStore(m_runtimeMetadataWHKey, eventContext);
155 runtimeMetadataOutput->push_back(std::make_unique<xAOD::TrigComposite>());
156 char hostname [HOST_NAME_MAX];
157 bool errcode = !gethostname(hostname, HOST_NAME_MAX); // returns 0 on success and -1 on failure, casted to false on success, true on failure
158 std::string hostnameString = std::string(hostname); // setDetail needs a reference
159 errcode &= runtimeMetadataOutput->back()->setDetail("hostname", hostnameString);
160 if (!errcode) ATH_MSG_WARNING("Failed to append hostname to HLT Runtime Metadata TC");
161
162 // Fill the stream tags
163 StatusCode finalStatus = StatusCode::SUCCESS;
164 if (m_streamTagMaker.isEnabled() && m_streamTagMaker->fill(hltResult, eventContext).isFailure()) {
165 ATH_MSG_ERROR(m_streamTagMaker->name() << " failed");
166 finalStatus = StatusCode::FAILURE;
167 }
168
169 // Fill the result using all other tools if the event was accepted
170 if (hltResult.isAccepted()) {
171 for (auto& maker: m_makerTools) {
172 ATH_MSG_DEBUG("Calling " << maker->name() << " for accepted event");
173 if (StatusCode sc = maker->fill(hltResult, eventContext); sc.isFailure()) {
174 ATH_MSG_ERROR(maker->name() << " failed");
175 finalStatus = sc;
176 }
177 }
178
179 if (!m_skipValidatePEBInfo) validatePEBInfo(hltResult);
180 }
181 else {
182 ATH_MSG_DEBUG("Rejected event, further result filling skipped after stream tag maker");
183 }
184
185 ATH_MSG_DEBUG(hltResult);
186
187 Monitored::Group(m_monTool, monTime);
188 return finalStatus;
189}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
static Double_t sc
ToolHandle< GenericMonitoringTool > m_monTool
Monitoring tool.
SG::WriteHandleKey< xAOD::TrigCompositeContainer > m_runtimeMetadataWHKey
StoreGate key for HLT Runtime Metadata container.
bool m_skipValidatePEBInfo
If true, don't call validatePEBInfo.
void validatePEBInfo(HLT::HLTResultMT &hltResult) const
Check ROB and SubDet lists in StreamTags and remove those which are disabled.
ToolHandleArray< HLTResultMTMakerTool > m_makerTools
Tools filling the HLTResultMT object.
ToolHandle< HLTResultMTMakerTool > m_streamTagMaker
Tool creating stream tags (defines if event is accepted)
bool isAccepted() const
If there is at least one stream tag set, it means the event is accepted.
::StatusCode StatusCode
StatusCode definition for legacy code.
SG::WriteHandle< DecisionContainer > createAndStore(const SG::WriteHandleKey< DecisionContainer > &key, const EventContext &ctx)
Creates and right away records the DecisionContainer with the key.

◆ finalize()

StatusCode HLTResultMTMaker::finalize ( )
overridevirtual

Definition at line 131 of file HLTResultMTMaker.cxx.

131 {
132 ATH_CHECK(m_monTool.release());
133 return StatusCode::SUCCESS;
134}
#define ATH_CHECK
Evaluate an expression and check for errors.

◆ initialize()

StatusCode HLTResultMTMaker::initialize ( )
overridevirtual

Definition at line 64 of file HLTResultMTMaker.cxx.

64 {
65 ATH_CHECK(m_hltResultWHKey.initialize());
67 ATH_CHECK(m_streamTagMaker.retrieve(DisableTool{m_streamTagMaker.name().empty()}));
68 ATH_CHECK(m_makerTools.retrieve());
69 ATH_CHECK(m_monTool.retrieve(DisableTool{m_monTool.empty()}));
70 ATH_CHECK(m_jobOptionsSvc.retrieve());
71 ATH_CHECK(m_bsMetaDataContRHKey.initialize(!m_extraROBs.empty() || !m_extraSubDets.empty()));
72
73 return StatusCode::SUCCESS;
74}
Gaudi::Property< std::vector< uint32_t > > m_extraROBs
Extra enabled ROBs checked against detector mask.
Gaudi::Property< std::vector< uint32_t > > m_extraSubDets
Extra enabled SubDets checked against detector mask.
ServiceHandle< Gaudi::Interfaces::IOptionsSvc > m_jobOptionsSvc
Handle to JobOptionsSvc used to retrieve the DataFlowConfig property.
SG::ReadHandleKey< ByteStreamMetadataContainer > m_bsMetaDataContRHKey
StoreGate key for the ByteStreamMetadata container to retrieve detector mask.
SG::WriteHandleKey< HLT::HLTResultMT > m_hltResultWHKey
StoreGate key for the HLTResultMT.

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ makeResult()

StatusCode HLTResultMTMaker::makeResult ( const EventContext & eventContext) const

Create and fill a new HLTResultMT, and record it in the event store.

Definition at line 139 of file HLTResultMTMaker.cxx.

139 {
140 auto hltResult = SG::makeHandle(m_hltResultWHKey,eventContext);
141 ATH_CHECK( hltResult.record(std::make_unique<HLT::HLTResultMT>()) );
142 ATH_MSG_DEBUG("Recorded HLTResultMT with key " << m_hltResultWHKey.key());
143 ATH_CHECK(fillResult(*hltResult, eventContext));
144 return StatusCode::SUCCESS;
145}
StatusCode fillResult(HLT::HLTResultMT &hltResult, const EventContext &eventContext) const
Fill an existing HLTResultMT with event information.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ resultName()

const std::string & HLTResultMTMaker::resultName ( ) const
inline

Return name of the HLTResultMT.

Definition at line 47 of file HLTResultMTMaker.h.

47{return m_hltResultWHKey.key();}

◆ start()

StatusCode HLTResultMTMaker::start ( )
overridevirtual

Definition at line 80 of file HLTResultMTMaker.cxx.

80 {
81 // DataFlowConfig is a special object used online to hold DF properties passed from TDAQ to HLT as run parameters.
82 Gaudi::Property<std::vector<uint32_t>> enabledROBsProp("EnabledROBs",{});
83 if (enabledROBsProp.fromString(m_jobOptionsSvc->get("DataFlowConfig.DF_Enabled_ROB_IDs","[]")).isSuccess()) {
84 m_enabledROBs.insert(enabledROBsProp.value().begin(), enabledROBsProp.value().end());
85 ATH_MSG_DEBUG("Retrieved a list of " << m_enabledROBs.size()
86 << " ROBs from DataFlowConfig.DF_Enabled_ROB_IDs");
87 }
88 else {
89 ATH_MSG_ERROR("Could not parse DataFlowConfig.DF_Enabled_ROB_IDs from JobOptionsSvc");
90 }
91
92 m_enabledSubDets.clear();
93 Gaudi::Property<std::vector<uint32_t>> enabledSubDetsProp("EnabledSubDets",{});
94 if (enabledSubDetsProp.fromString(m_jobOptionsSvc->get("DataFlowConfig.DF_Enabled_SubDet_IDs","[]")).isSuccess()) {
95 // Need to convert from uint32_t to eformat::SubDetector representable by uint8_t
96 for (const uint32_t id : enabledSubDetsProp.value()) {
97 m_enabledSubDets.insert( static_cast<eformat::SubDetector>(id & 0xFF) );
98 }
99 ATH_MSG_DEBUG("Retrieved a list of " << m_enabledSubDets.size()
100 << " SubDets from DataFlowConfig.DF_Enabled_SubDet_IDs");
101 }
102 else {
103 ATH_MSG_ERROR("Could not parse DataFlowConfig.DF_Enabled_SubDet_IDs from JobOptionsSvc");
104 }
105
106 if (m_enabledROBs.empty() && m_enabledSubDets.empty()) {
108 ATH_MSG_INFO("The list of enabled ROBs and SubDets was not provided by DataFlowConfig or is empty. "
109 << "StreamTag PEBInfo validation will be skipped.");
110 }
111 else {
113 m_enabledROBs.insert(m_extraEnabledROBs.value().begin(), m_extraEnabledROBs.value().end());
114 m_enabledROBs.insert(m_extraROBs.value().begin(), m_extraROBs.value().end());
115 // Need to convert from uint32_t to eformat::SubDetector representable by uint8_t
116 for (const uint32_t id : m_extraEnabledSubDets.value()) {
117 m_enabledSubDets.insert( static_cast<eformat::SubDetector>(id & 0xFF) );
118 }
119 for (const uint32_t id : m_extraSubDets.value()) {
120 m_enabledSubDets.insert( static_cast<eformat::SubDetector>(id & 0xFF) );
121 }
122 ATH_MSG_INFO("StreamTag PEBInfo will be validated against " << m_enabledROBs.size() << " enabled ROBs and "
123 << m_enabledSubDets.size() << " enabled SubDets");
124 }
125 return StatusCode::SUCCESS;
126}
#define ATH_MSG_INFO(x)
Gaudi::Property< std::vector< uint32_t > > m_extraEnabledROBs
Extra enabled ROBs.
std::set< uint32_t > m_enabledROBs
List of enabled ROBs retrieved during initialisation.
Gaudi::Property< std::vector< uint32_t > > m_extraEnabledSubDets
Extra enabled SubDets.
StatusCode validateExtraROBsAndSubDets()
Check ExtraROBs and ExtraSubDets against the detector mask and drop the masked out IDs.
std::set< eformat::SubDetector > m_enabledSubDets
List of enabled SubDets retrieved during initialisation.

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

◆ validateExtraROBsAndSubDets()

StatusCode HLTResultMTMaker::validateExtraROBsAndSubDets ( )
private

Check ExtraROBs and ExtraSubDets against the detector mask and drop the masked out IDs.

Definition at line 255 of file HLTResultMTMaker.cxx.

255 {
256 if (m_extraROBs.empty() && m_extraSubDets.empty()) {
257 // Nothing to check
258 return StatusCode::SUCCESS;
259 }
260
261 // Get the detector mask
263 ATH_CHECK(bsmdc.isValid());
264 ATH_CHECK(!bsmdc->empty());
265 const ByteStreamMetadata* metadata = bsmdc->front();
266 const eformat::helper::DetectorMask detectorMask{metadata->getDetectorMask(), metadata->getDetectorMask2()};
267
268 // Check ROBs
269 std::vector<uint32_t> validatedExtraROBs;
270 for (const uint32_t rob_id : m_extraROBs.value()) {
271 const eformat::helper::SourceIdentifier sid{rob_id};
272 const eformat::SubDetector subdet_id = sid.subdetector_id();
273 if (detectorMask.is_set(subdet_id)) {
274 validatedExtraROBs.push_back(rob_id);
275 }
276 else {
277 ATH_MSG_WARNING("Removing 0x" << MSG::hex << rob_id << MSG::dec << " from " << m_extraROBs.name()
278 << " because SubDetector " << sid.human_detector() << " is disabled in the detector mask");
279 }
280 }
281 m_extraROBs = validatedExtraROBs;
282
283 // Check SubDets
284 std::vector<uint32_t> validatedExtraSubDets;
285 for (const uint32_t subdet_id32 : m_extraSubDets.value()) {
286 const eformat::SubDetector subdet_id = static_cast<eformat::SubDetector>(subdet_id32 & 0xFF);
287 if (detectorMask.is_set(subdet_id)) {
288 validatedExtraSubDets.push_back(subdet_id32);
289 }
290 else {
291 ATH_MSG_WARNING("Removing 0x" << MSG::hex << subdet_id << MSG::dec << " from " << m_extraSubDets.name()
292 << " because SubDetector " << eformat::helper::SourceIdentifier(subdet_id,0,0).human_detector()
293 << " is disabled in the detector mask");
294 }
295 }
296 m_extraSubDets = validatedExtraSubDets;
297
298 return StatusCode::SUCCESS;
299}

◆ validatePEBInfo()

void HLTResultMTMaker::validatePEBInfo ( HLT::HLTResultMT & hltResult) const
private

Check ROB and SubDet lists in StreamTags and remove those which are disabled.

Definition at line 194 of file HLTResultMTMaker.cxx.

194 {
195 std::vector<eformat::helper::StreamTag> streamTagsToRemove;
196 for (eformat::helper::StreamTag& st : hltResult.getStreamTagsNonConst()) {
197 // Skip full event building stream tags immediately
198 if (st.robs.empty() && st.dets.empty()) {continue;}
199
200 std::set<uint32_t> removedROBs = removeDisabled(st.robs,m_enabledROBs);
201 if (!removedROBs.empty()) {
202 ATH_MSG_DEBUG("StreamTag " << st.type << "_" << st.name << " requested disabled ROBs: " << format(removedROBs)
203 << " - these ROBs were removed from the StreamTag by " << name());
204 std::vector<eformat::SubDetector> removedSubDets;
205 for (const uint32_t rob : removedROBs) {
206 eformat::SubDetector sd{eformat::helper::SourceIdentifier(rob).subdetector_id()};
207 if (std::find(removedSubDets.begin(),removedSubDets.end(),sd)==removedSubDets.end()) {
208 removedSubDets.push_back(sd);
209 }
210 }
211 auto monRemovedROBsSubDet = Monitored::Collection(
212 "PEB_RemovedROBs_SubDet", removedSubDets,
213 [](const eformat::SubDetector sd) -> const std::string & {return eformat::helper::SubDetectorDictionary.string(sd);});
214 Monitored::Group(m_monTool, monRemovedROBsSubDet);
215 } else {
216 ATH_MSG_VERBOSE("No disabled ROBs were requested by StreamTag " << st.type << "_" << st.name);
217 }
218
219 std::set<eformat::SubDetector> removedSubDets = removeDisabled(st.dets,m_enabledSubDets);
220 if (!removedSubDets.empty()) {
221 ATH_MSG_DEBUG("StreamTag " << st.type << "_" << st.name << " requested disabled SubDets: " << format(removedSubDets)
222 << " - these SubDets were removed from the StreamTag by " << name());
223 std::vector<eformat::SubDetector> removedSubDetsVec(removedSubDets.begin(),removedSubDets.end());
224 auto monRemovedSubDets = Monitored::Collection(
225 "PEB_RemovedSubDets", removedSubDetsVec,
226 [](const eformat::SubDetector sd)-> const std::string & {return eformat::helper::SubDetectorDictionary.string(sd);});
227 Monitored::Group(m_monTool, monRemovedSubDets);
228 } else {
229 ATH_MSG_VERBOSE("No disabled SubDets were requested by StreamTag " << st.type << "_" << st.name);
230 }
231
232 // If the PEB list now became empty, it would turn PEB into FEB - prevent this and drop the stream tag (ATR-24378)
233 if (st.robs.empty() && st.dets.empty()) {
234 bool printed{false};
235 if (m_emptyPEBInfoErrorPrinted.compare_exchange_strong(printed, true, std::memory_order_relaxed)) {
236 ATH_MSG_ERROR("Event accepted to stream " << st.type << "_" << st.name << " but the streaming to this stream "
237 << "is forcibly prevented, because all requested ROBs/SubDets in the PEB list are disabled. "
238 << "ROBs: " << format(removedROBs) << ", SubDets: " << format(removedSubDets));
239 }
240 streamTagsToRemove.push_back(st);
241 }
242 }
243 for (const eformat::helper::StreamTag& st : streamTagsToRemove) {
244 auto it =
245 std::remove(hltResult.getStreamTagsNonConst().begin(),
246 hltResult.getStreamTagsNonConst().end(),
247 st);
248 hltResult.getStreamTagsNonConst().resize (it - hltResult.getStreamTagsNonConst().begin());
249 }
250}
#define ATH_MSG_VERBOSE(x)
std::atomic_bool m_emptyPEBInfoErrorPrinted
Flag if empty PEB list error was already printed.
std::vector< eformat::helper::StreamTag > & getStreamTagsNonConst()
Non-const-getter for stream tags needed by the result maker to remove disabled ROBs/SubDets.
ValuesCollection< T > Collection(std::string name, const T &collection)
Declare a monitored (double-convertible) collection.
DataModel_detail::iterator< DVL > remove(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end, const T &value)
Specialization of remove for DataVector/List.

Member Data Documentation

◆ m_bsMetaDataContRHKey

SG::ReadHandleKey<ByteStreamMetadataContainer> HLTResultMTMaker::m_bsMetaDataContRHKey
private
Initial value:
{
this, "ByteStreamMetadataRHKey", "InputMetaDataStore+ByteStreamMetadata",
"Key of the ByteStreamMetadataContainer to retrieve the detector mask"
}

StoreGate key for the ByteStreamMetadata container to retrieve detector mask.

Definition at line 67 of file HLTResultMTMaker.h.

67 {
68 this, "ByteStreamMetadataRHKey", "InputMetaDataStore+ByteStreamMetadata",
69 "Key of the ByteStreamMetadataContainer to retrieve the detector mask"
70 };

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_emptyPEBInfoErrorPrinted

std::atomic_bool HLTResultMTMaker::m_emptyPEBInfoErrorPrinted {false}
mutableprivate

Flag if empty PEB list error was already printed.

Definition at line 120 of file HLTResultMTMaker.h.

120{false};

◆ m_enabledROBs

std::set<uint32_t> HLTResultMTMaker::m_enabledROBs
private

List of enabled ROBs retrieved during initialisation.

Definition at line 114 of file HLTResultMTMaker.h.

◆ m_enabledSubDets

std::set<eformat::SubDetector> HLTResultMTMaker::m_enabledSubDets
private

List of enabled SubDets retrieved during initialisation.

Definition at line 116 of file HLTResultMTMaker.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extraEnabledROBs

Gaudi::Property<std::vector<uint32_t> > HLTResultMTMaker::m_extraEnabledROBs
private
Initial value:
{
this, "ExtraEnabledROBs", {},
"Extra ROBs which can be requested in a stream tag, but are not part of the ROS-ROB map"
}

Extra enabled ROBs.

Definition at line 92 of file HLTResultMTMaker.h.

92 {
93 this, "ExtraEnabledROBs", {},
94 "Extra ROBs which can be requested in a stream tag, but are not part of the ROS-ROB map"
95 };

◆ m_extraEnabledSubDets

Gaudi::Property<std::vector<uint32_t> > HLTResultMTMaker::m_extraEnabledSubDets
private
Initial value:
{
this, "ExtraEnabledSubDets", {},
"Extra SubDets which can be requested in a stream tag, but are not part of the ROS-ROB map"
}

Extra enabled SubDets.

Definition at line 102 of file HLTResultMTMaker.h.

102 {
103 this, "ExtraEnabledSubDets", {},
104 "Extra SubDets which can be requested in a stream tag, but are not part of the ROS-ROB map"
105 };

◆ m_extraROBs

Gaudi::Property<std::vector<uint32_t> > HLTResultMTMaker::m_extraROBs
private
Initial value:
{
this, "ExtraROBs", {},
"Same as ExtraEnabledROBs but checked against detector mask and dropped if SubDet is masked out"
}

Extra enabled ROBs checked against detector mask.

Definition at line 97 of file HLTResultMTMaker.h.

97 {
98 this, "ExtraROBs", {},
99 "Same as ExtraEnabledROBs but checked against detector mask and dropped if SubDet is masked out"
100 };

◆ m_extraSubDets

Gaudi::Property<std::vector<uint32_t> > HLTResultMTMaker::m_extraSubDets
private
Initial value:
{
this, "ExtraSubDets", {},
"Same as ExtraEnabledSubDets but checked against detector mask and dropped if SubDet is masked out"
}

Extra enabled SubDets checked against detector mask.

Definition at line 107 of file HLTResultMTMaker.h.

107 {
108 this, "ExtraSubDets", {},
109 "Same as ExtraEnabledSubDets but checked against detector mask and dropped if SubDet is masked out"
110 };

◆ m_hltResultWHKey

SG::WriteHandleKey<HLT::HLTResultMT> HLTResultMTMaker::m_hltResultWHKey
private
Initial value:
{
this, "HLTResultWHKey", "HLTResultMT",
"Key of the output HLTResultMT object"
}

StoreGate key for the HLTResultMT.

Definition at line 58 of file HLTResultMTMaker.h.

58 {
59 this, "HLTResultWHKey", "HLTResultMT",
60 "Key of the output HLTResultMT object"
61 };

◆ m_jobOptionsSvc

ServiceHandle<Gaudi::Interfaces::IOptionsSvc> HLTResultMTMaker::m_jobOptionsSvc
private
Initial value:
{
this, "JobOptionsSvc", "JobOptionsSvc",
"Job options service to retrieve DataFlowConfig"
}

Handle to JobOptionsSvc used to retrieve the DataFlowConfig property.

Definition at line 87 of file HLTResultMTMaker.h.

87 {
88 this, "JobOptionsSvc", "JobOptionsSvc",
89 "Job options service to retrieve DataFlowConfig"
90 };

◆ m_makerTools

ToolHandleArray<HLTResultMTMakerTool> HLTResultMTMaker::m_makerTools
private
Initial value:
{
this, "MakerTools", {},
"Set of additional tools that fill content of the HLTResultMT"
}

Tools filling the HLTResultMT object.

Definition at line 77 of file HLTResultMTMaker.h.

77 {
78 this, "MakerTools", {},
79 "Set of additional tools that fill content of the HLTResultMT"
80 };

◆ m_monTool

ToolHandle<GenericMonitoringTool> HLTResultMTMaker::m_monTool
private
Initial value:
{
this, "MonTool", "",
"Monitoring tool"
}

Monitoring tool.

Definition at line 82 of file HLTResultMTMaker.h.

82 {
83 this, "MonTool", "",
84 "Monitoring tool"
85 };

◆ m_runtimeMetadataWHKey

SG::WriteHandleKey<xAOD::TrigCompositeContainer> HLTResultMTMaker::m_runtimeMetadataWHKey
private
Initial value:
{
this, "HLTRuntimeMetadataWHKey", "HLT_RuntimeMetadata",
"Key of the output with additional runtime metadata" }

StoreGate key for HLT Runtime Metadata container.

Definition at line 63 of file HLTResultMTMaker.h.

63 {
64 this, "HLTRuntimeMetadataWHKey", "HLT_RuntimeMetadata",
65 "Key of the output with additional runtime metadata" };

◆ m_skipValidatePEBInfo

bool HLTResultMTMaker::m_skipValidatePEBInfo {false}
private

If true, don't call validatePEBInfo.

Definition at line 118 of file HLTResultMTMaker.h.

118{false};

◆ m_streamTagMaker

ToolHandle<HLTResultMTMakerTool> HLTResultMTMaker::m_streamTagMaker
private
Initial value:
{
this, "StreamTagMaker", "",
"Tool creating stream tags (defines if event is accepted)"
}

Tool creating stream tags (defines if event is accepted)

Definition at line 72 of file HLTResultMTMaker.h.

72 {
73 this, "StreamTagMaker", "",
74 "Tool creating stream tags (defines if event is accepted)"
75 };

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: