From b258d3d1075e26c41df0230d4d3a20af00b660a2 Mon Sep 17 00:00:00 2001 From: Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch> Date: Tue, 4 Sep 2018 10:10:35 +0200 Subject: [PATCH] Added (some of) Frank's suggestions. Started using std::string::empty() instead of a comparison with an empty string, and removed the meaningless greeting INFO message from the initialize() function. --- .../AnalysisTriggerAlgs/src/RoIBResultToxAOD.cxx | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/PhysicsAnalysis/AnalysisTrigger/AnalysisTriggerAlgs/src/RoIBResultToxAOD.cxx b/PhysicsAnalysis/AnalysisTrigger/AnalysisTriggerAlgs/src/RoIBResultToxAOD.cxx index 309c8cf3c16..531811e9bfb 100644 --- a/PhysicsAnalysis/AnalysisTrigger/AnalysisTriggerAlgs/src/RoIBResultToxAOD.cxx +++ b/PhysicsAnalysis/AnalysisTrigger/AnalysisTriggerAlgs/src/RoIBResultToxAOD.cxx @@ -46,9 +46,9 @@ namespace { } // private namespace /// Helper macro for initialising SG keys that are allowed to be missing -#define INIT_SG_KEY(VAR) \ - do { \ - ATH_CHECK( VAR.initialize( VAR.key() != "" ) ); \ +#define INIT_SG_KEY(VAR) \ + do { \ + ATH_CHECK( VAR.initialize( ! VAR.key().empty() ) ); \ } while( false ) RoIBResultToxAOD::RoIBResultToxAOD( const std::string& name, @@ -59,9 +59,6 @@ RoIBResultToxAOD::RoIBResultToxAOD( const std::string& name, StatusCode RoIBResultToxAOD::initialize() { - // Greet the user. - ATH_MSG_INFO( "Initializing algorithm" ); - // Print system info. if( m_doCalo == false ) { ATH_MSG_WARNING( "Inputs from LVL1 Calo systems switched off" ); @@ -172,7 +169,7 @@ StatusCode RoIBResultToxAOD::createEmTauRoI( const ROIB::RoIBResult& result, // Tool to reconstruct EM/tau cluster & isolation sums // - need to form tower map for RoI reconstruction xAOD::CPMTowerMap_t cpmtowers; - if( m_emTauTool.isEnabled() && ( m_cpmTowerKey.key() != "" ) ) { + if( m_emTauTool.isEnabled() && ( ! m_cpmTowerKey.key().empty() ) ) { auto cpmTower = SG::makeHandle( m_cpmTowerKey, ctx ); m_emTauTool->mapTowers( cpmTower.cptr(), &cpmtowers ); } @@ -323,7 +320,7 @@ RoIBResultToxAOD::createJetEnergyRoI( const ROIB::RoIBResult& result, // Tool to reconstruct Jet cluster ET sums // - form input map ready for analysis std::map< int, LVL1::JetInput* > jetInputs; - if( m_jetTool.isEnabled() && ( m_jetElementKey.key() != "" ) ) { + if( m_jetTool.isEnabled() && ( ! m_jetElementKey.key().empty() ) ) { auto jetElement = SG::makeHandle( m_jetElementKey, ctx ); m_jetTool->mapJetInputs( jetElement.cptr(), &jetInputs ); } -- GitLab