diff --git a/Trigger/TrigMonitoring/TrigCostMonitor/TrigCostMonitor/TrigNtRobsTool.h b/Trigger/TrigMonitoring/TrigCostMonitor/TrigCostMonitor/TrigNtRobsTool.h index 2167f972ca9153b76e0078c2b77496637e46fb95..34f91dec8e605d9f948d5e97d8376e22a20cbb00 100644 --- a/Trigger/TrigMonitoring/TrigCostMonitor/TrigCostMonitor/TrigNtRobsTool.h +++ b/Trigger/TrigMonitoring/TrigCostMonitor/TrigCostMonitor/TrigNtRobsTool.h @@ -60,8 +60,8 @@ namespace Trig // Tool variables TrigMonConfig *m_config; - - std::set<uint32_t> m_algIds; + std::map<std::string, uint32_t> m_algNameToIDMap; //Algorithm Name to ID caching + std::set<uint32_t> m_algIds; }; } diff --git a/Trigger/TrigMonitoring/TrigCostMonitor/src/TrigNtRobsTool.cxx b/Trigger/TrigMonitoring/TrigCostMonitor/src/TrigNtRobsTool.cxx index e82c491b3ea9ce6ab41f47ab0bb852abebd29f26..32384fc3a9849b0cf606e4a261de447263ae88bb 100644 --- a/Trigger/TrigMonitoring/TrigCostMonitor/src/TrigNtRobsTool.cxx +++ b/Trigger/TrigMonitoring/TrigCostMonitor/src/TrigNtRobsTool.cxx @@ -135,8 +135,9 @@ bool Trig::TrigNtRobsTool::Fill(TrigMonEvent &event) // bool found_id = 0; uint32_t alg_id = 0; - - for(unsigned int i = 0; i < m_config->size<TrigConfSeq>(); ++i) { + + if (m_algNameToIDMap.size() == 0) { +for(unsigned int i = 0; i < m_config->size<TrigConfSeq>(); ++i) { const TrigConfSeq &seq = m_config->at<TrigConfSeq>(i); const std::vector<TrigConfAlg> &avec = seq.getAlg(); @@ -144,13 +145,19 @@ bool Trig::TrigNtRobsTool::Fill(TrigMonEvent &event) for(unsigned int j = 0; j < avec.size(); ++j) { const TrigConfAlg &alg = avec[j]; - if(alg.getName() == rob->requestor_name) { - alg_id = alg.getNameId(); - found_id = true; - break; + m_algNameToIDMap[alg.getName()] = alg.getNameId(); + } } +} + std::map<std::string, uint32_t>::const_iterator algFinder = m_algNameToIDMap.find(rob->requestor_name); + + if (algFinder != m_algNameToIDMap.end() ){ + alg_id = algFinder->second; + found_id = true; } + + if(!found_id) { alg_id = TrigConf::HLTUtils::string2hash(rob->requestor_name, "ALG");