Skip to content
Snippets Groups Projects
Commit 8b867021 authored by Walter Lampl's avatar Walter Lampl
Browse files

Merge branch 'avoid_duplicate_ROB_requests' into 'master'

Add protection for duplicate ROB requests to HltROBDataProviderSvc

See merge request !34552
parents 2582b90e 873d1370
No related branches found
No related tags found
No related merge requests found
...@@ -16,6 +16,9 @@ ...@@ -16,6 +16,9 @@
// Athena // Athena
// STL includes
#include <algorithm> // std::find
HltROBDataProviderSvc::HltROBDataProviderSvc(const std::string& name, ISvcLocator* pSvcLocator) : HltROBDataProviderSvc::HltROBDataProviderSvc(const std::string& name, ISvcLocator* pSvcLocator) :
base_class(name, pSvcLocator) base_class(name, pSvcLocator)
{ {
...@@ -338,7 +341,7 @@ void HltROBDataProviderSvc::getROBData(const EventContext& context, ...@@ -338,7 +341,7 @@ void HltROBDataProviderSvc::getROBData(const EventContext& context,
// check input ROB list against cache // check input ROB list against cache
eventCache_checkRobListToCache(cache, robIds, robFragments, robIds_missing) ; eventCache_checkRobListToCache(cache, robIds, robFragments, robIds_missing) ;
// missing ROB fragments from the DCM and add them to the cache // no missing ROB fragments, return the found ROB fragments
if (robIds_missing.size() == 0) { if (robIds_missing.size() == 0) {
ATH_MSG_DEBUG( __FUNCTION__ << ": All requested ROB Ids were found in the cache. "); ATH_MSG_DEBUG( __FUNCTION__ << ": All requested ROB Ids were found in the cache. ");
return; return;
...@@ -552,6 +555,13 @@ void HltROBDataProviderSvc::eventCache_checkRobListToCache(EventCache* cache, co ...@@ -552,6 +555,13 @@ void HltROBDataProviderSvc::eventCache_checkRobListToCache(EventCache* cache, co
for (uint32_t id : robIds_toCheck) { for (uint32_t id : robIds_toCheck) {
// check for duplicate IDs on the list of missing ROBs
std::vector<uint32_t>::iterator missing_it = std::find(robIds_missing.begin(), robIds_missing.end(), id);
if (missing_it != robIds_missing.end()) {
ATH_MSG_VERBOSE(__FUNCTION__ << " ROB Id : 0x" << MSG::hex << id << MSG::dec <<" is already on the list of missing IDs.");
continue;
}
// check if ROB is already in cache // check if ROB is already in cache
ROBMAP::const_iterator map_it = cache->robmap.find(id); ROBMAP::const_iterator map_it = cache->robmap.find(id);
if (map_it != cache->robmap.end()) { if (map_it != cache->robmap.end()) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment