ATLAS Offline Software
TriggerTranslatorSimple.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 #include "boost/algorithm/string/split.hpp"
7 #include "boost/algorithm/string/classification.hpp"
8 
10  const std::string& name,
11  const IInterface* parent)
12  : AthAlgTool( type, name, parent )
13 {
14  declareInterface<ITriggerTranslatorTool>(this);
15  declareProperty("triggerMapping", m_trigmap_property);
16 }
17 
19 
21  std::vector<std::string> junk;
22  //m_trigmap[""] = junk;
23  for(const auto& item : m_trigmap_property) {
24  ATH_MSG_DEBUG( "Key " << item.first << " Value " << item.second );
25  std::vector<std::string> triggers;
26  boost::split(triggers, item.second, boost::is_any_of(","));
27  m_trigmap[item.first] = triggers;
28  }
29  return StatusCode::SUCCESS;
30 }
31 
32 
33 const std::vector<std::string> TriggerTranslatorToolSimple::translate(const std::string& key) const {
34  return m_trigmap.at(key);
35 }
TriggerTranslatorToolSimple::initialize
virtual StatusCode initialize() override
Definition: TriggerTranslatorSimple.cxx:20
TriggerTranslatorToolSimple::translate
virtual const std::vector< std::string > translate(const std::string &) const override
Definition: TriggerTranslatorSimple.cxx:33
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
python.TrigTLAMonitorAlgorithm.triggers
triggers
Definition: TrigTLAMonitorAlgorithm.py:196
TriggerTranslatorToolSimple::TriggerTranslatorToolSimple
TriggerTranslatorToolSimple(const std::string &type, const std::string &name, const IInterface *parent)
Definition: TriggerTranslatorSimple.cxx:9
TriggerTranslatorToolSimple::m_trigmap_property
std::map< std::string, std::string > m_trigmap_property
Definition: TriggerTranslatorSimple.h:49
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TriggerTranslatorToolSimple::~TriggerTranslatorToolSimple
virtual ~TriggerTranslatorToolSimple()
Definition: TriggerTranslatorSimple.cxx:18
test_pyathena.parent
parent
Definition: test_pyathena.py:15
TriggerTranslatorToolSimple::m_trigmap
std::map< std::string, std::vector< std::string > > m_trigmap
Definition: TriggerTranslatorSimple.h:50
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
item
Definition: ItemListSvc.h:43
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
AthAlgTool
Definition: AthAlgTool.h:26
TriggerTranslatorSimple.h
Trk::split
@ split
Definition: LayerMaterialProperties.h:38
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37