ATLAS Offline Software
Loading...
Searching...
No Matches
TriggerTranslatorSimple.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
7
9 const std::string& name,
10 const IInterface* parent)
11 : AthAlgTool( type, name, parent )
12{
13 declareInterface<ITriggerTranslatorTool>(this);
14 declareProperty("triggerMapping", m_trigmap_property);
15}
16
18
20 std::vector<std::string> junk;
21 //m_trigmap[""] = junk;
22 for(const auto& item : m_trigmap_property) {
23 ATH_MSG_DEBUG( "Key " << item.first << " Value " << item.second );
24 std::vector<std::string> triggers = CxxUtils::tokenize(item.second, ",");
25 m_trigmap[item.first] = std::move(triggers);
26 }
27 return StatusCode::SUCCESS;
28}
29
30
31const std::vector<std::string> TriggerTranslatorToolSimple::translate(const std::string& key) const {
32 return m_trigmap.at(key);
33}
#define ATH_MSG_DEBUG(x)
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
virtual StatusCode initialize() override
std::map< std::string, std::string > m_trigmap_property
virtual const std::vector< std::string > translate(const std::string &) const override
std::map< std::string, std::vector< std::string > > m_trigmap
TriggerTranslatorToolSimple(const std::string &type, const std::string &name, const IInterface *parent)
std::vector< std::string > tokenize(std::string_view the_str, std::string_view delimiters)
Splits the string into smaller substrings.