Commit 225cf434 authored by Sergi Rodriguez Bosca's avatar Sergi Rodriguez Bosca
Browse files

Changing eFEX FindTower function and eTowerContainer map

parent 70aaa42f
......@@ -27,6 +27,8 @@
#include "CxxUtils/CachedValue.h"
#include "AthLinks/tools/findInContainer.h"
#include <unordered_map>
namespace LVL1 {
class eTowerContainer : public DataVector<LVL1::eTower>
......@@ -74,7 +76,7 @@ class eTowerContainer : public DataVector<LVL1::eTower>
IMessageSvc* msgSvc() const;
//* @brief Keeps track of the towerID of each eTower associated to each MAP index *.
std::map<int,int> m_map_towerID_containerIndex;
std::unordered_map<int,int> m_map_towerID_containerIndex;
};
}
......
......@@ -29,24 +29,24 @@ void eTowerContainer::print() const {
}
const LVL1::eTower * eTowerContainer::findTower(int towerID) const
{
int container_index = -1;
container_index = m_map_towerID_containerIndex.find(towerID)->second;
if(container_index >= 0){
const LVL1::eTower * eTowerContainer::findTower(int towerID) const{
const auto it = m_map_towerID_containerIndex.find(towerID);
const int container_index = it->second;
if (container_index < 0) {
return nullptr;
}
return (*this)[container_index];
}
return nullptr;
}
LVL1::eTower * eTowerContainer::findTower(int towerID)
{
int container_index = -1;
container_index = m_map_towerID_containerIndex.find(towerID)->second;
if(container_index >= 0){
LVL1::eTower * eTowerContainer::findTower(int towerID){
const auto it = m_map_towerID_containerIndex.find(towerID);
const int container_index = it->second;
if (container_index < 0) {
return nullptr;
}
return (*this)[container_index];
}
return nullptr;
}
void eTowerContainer::clearContainerMap()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment