13#include <unordered_set>
18 std::string robSetToString(
const std::unordered_set<uint32_t>& robs) {
19 std::ostringstream
ss;
22 for (
const uint32_t rob : robs) {
23 if (first) {
first=
false;}
25 ss <<
"0x" << std::hex << rob << std::dec;
51 return StatusCode::SUCCESS;
56 std::unordered_set<uint32_t> robsToPrefetch;
57 std::vector<uint32_t> robsInRoI;
63 ATH_MSG_DEBUG(
"Processing " << decisionCont->size() <<
" decisions in " << decisionContKey.key());
64 for (
const Decision* decision : *decisionCont) {
67 bool skipPrefetching{
true};
71 skipPrefetching =
false;
75 if (skipPrefetching) {
93 tool->lookup(eventContext)->ROBIDList( roi, robsInRoI );
94 robsToPrefetch.insert(robsInRoI.begin(),robsInRoI.end());
100 ATH_MSG_DEBUG(
"Prefetching " << robsToPrefetch.size() <<
" ROBs: " << robSetToString(robsToPrefetch));
101 std::vector<uint32_t> robsToPrefetchVec{robsToPrefetch.begin(),robsToPrefetch.end()};
104 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
xAOD::TrigComposite Decision
void decisionIDs(const Decision *d, DecisionIDContainer &id)
Extracts DecisionIDs stored in the Decision object.
LinkInfo< T > findLink(const Decision *start, const std::string &linkName, const bool suppressMultipleLinksWarning=false)
Perform a recursive search for ElementLinks of type T and name 'linkName', starting from Decision obj...
bool msgLvl(const MSG::Level lvl) const
An algorithm that can be simultaneously executed in multiple threads.
ElementLink implementation for ROOT usage.
bool isValid() const
Check if the element can be found.
ROBPrefetchingAlg(const std::string &name, ISvcLocator *svcLoc)
ServiceHandle< IROBDataProviderSvc > m_robDataProviderSvc
The ROB data provider service used to prefetch the ROBs.
ToolHandleArray< IRegSelTool > m_regionSelectorTools
Array of RegionSelector tools for RoI->ROBs mapping, one for each detector to be prefetched.
std::unordered_set< TrigCompositeUtils::DecisionID > m_chainFilter
ChainFilter as unordered_set for faster lookup.
Gaudi::Property< std::string > m_roiLinkName
Choose the name of the RoI link to follow.
virtual StatusCode initialize() override
Gaudi::Property< std::vector< TrigCompositeUtils::DecisionID > > m_chainFilterVec
ChainFilter to select decisions for specific active chains.
virtual StatusCode execute(const EventContext &eventContext) const override
SG::ReadHandleKeyArray< TrigCompositeUtils::DecisionContainer > m_inputDecisions
Array of input decisions from which RoIs will be extracted.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
nope - should be used for standalone also, perhaps need to protect the class def bits ifndef XAOD_ANA...