Skip to content
Snippets Groups Projects
Commit b4d9fc57 authored by Christopher John Mcnicol's avatar Christopher John Mcnicol Committed by Graeme Stewart
Browse files

'Updated caching of algorithm names' (TrigCostMonitor-01-20-19)

	* Add caching for Algorithm names
	* Tag TrigCostMonitor-01-20-19


Former-commit-id: bde26831
parent 1cf7398b
No related branches found
No related tags found
No related merge requests found
...@@ -60,8 +60,8 @@ namespace Trig ...@@ -60,8 +60,8 @@ namespace Trig
// Tool variables // Tool variables
TrigMonConfig *m_config; TrigMonConfig *m_config;
std::map<std::string, uint32_t> m_algNameToIDMap; //Algorithm Name to ID caching
std::set<uint32_t> m_algIds; std::set<uint32_t> m_algIds;
}; };
} }
......
...@@ -135,8 +135,9 @@ bool Trig::TrigNtRobsTool::Fill(TrigMonEvent &event) ...@@ -135,8 +135,9 @@ bool Trig::TrigNtRobsTool::Fill(TrigMonEvent &event)
// //
bool found_id = 0; bool found_id = 0;
uint32_t alg_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 TrigConfSeq &seq = m_config->at<TrigConfSeq>(i);
const std::vector<TrigConfAlg> &avec = seq.getAlg(); const std::vector<TrigConfAlg> &avec = seq.getAlg();
...@@ -144,13 +145,19 @@ bool Trig::TrigNtRobsTool::Fill(TrigMonEvent &event) ...@@ -144,13 +145,19 @@ bool Trig::TrigNtRobsTool::Fill(TrigMonEvent &event)
for(unsigned int j = 0; j < avec.size(); ++j) { for(unsigned int j = 0; j < avec.size(); ++j) {
const TrigConfAlg &alg = avec[j]; const TrigConfAlg &alg = avec[j];
if(alg.getName() == rob->requestor_name) { m_algNameToIDMap[alg.getName()] = alg.getNameId();
alg_id = alg.getNameId();
found_id = true;
break;
} }
} }
}
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) { if(!found_id) {
alg_id = TrigConf::HLTUtils::string2hash(rob->requestor_name, "ALG"); alg_id = TrigConf::HLTUtils::string2hash(rob->requestor_name, "ALG");
......
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