diff --git a/Reconstruction/egamma/egammaAlgs/src/egammaBuilder.cxx b/Reconstruction/egamma/egammaAlgs/src/egammaBuilder.cxx index a91a55c753d82a9fd9d86169cc7a95f90c24d7d4..4bd2c1e098bcf427cc138cc2476b18fedb1850e7 100644 --- a/Reconstruction/egamma/egammaAlgs/src/egammaBuilder.cxx +++ b/Reconstruction/egamma/egammaAlgs/src/egammaBuilder.cxx @@ -98,19 +98,19 @@ StatusCode egammaBuilder::initialize() CHECK( RetrieveEMConversionBuilder() ); // retrieve EM Cluster Tool - CHECK( RetrieveEMClusterTool() ); + ATH_CHECK( m_clusterTool.retrieve() ); // retrieve ambiguity tool - CHECK( RetrieveAmbiguityTool() ); + ATH_CHECK( m_ambiguityTool.retrieve() ); ATH_MSG_INFO("Retrieving " << m_egammaTools.size() << " tools for egamma objects"); - CHECK( RetrieveTools(m_egammaTools) ); + ATH_CHECK( m_egammaTools.retrieve() ); ATH_MSG_INFO("Retrieving " << m_electronTools.size() << " tools for electrons"); - CHECK( RetrieveTools(m_electronTools) ); + ATH_CHECK( m_electronTools.retrieve() ); ATH_MSG_INFO("Retrieving " << m_photonTools.size() << " tools for photons"); - CHECK( RetrieveTools(m_photonTools) ); + ATH_CHECK( m_photonTools.retrieve() ); // retrieve timing profile CHECK( service("ChronoStatSvc",m_timingProfile) ); @@ -119,54 +119,6 @@ StatusCode egammaBuilder::initialize() return StatusCode::SUCCESS; } -// ==================================================================== -StatusCode egammaBuilder::RetrieveTools(ToolHandleArray<IegammaBaseTool>& tools) -{ - for (const auto& tool : tools) - { - if ( tool.retrieve().isFailure() ) - { - - ATH_MSG_FATAL( "Could not get tool: " << tool ); - return StatusCode::FAILURE; - } - } - return StatusCode::SUCCESS; -} -// ==================================================================== -StatusCode egammaBuilder::RetrieveEMClusterTool(){ - // retrieve Ambiguity tool - if (m_clusterTool.empty()) { - ATH_MSG_ERROR("EMClusterTool is empty"); - return StatusCode::FAILURE; - } - if((m_clusterTool.retrieve()).isFailure()) { - ATH_MSG_ERROR("Unable to retrieve "<<m_clusterTool); - return StatusCode::FAILURE; - } - else ATH_MSG_DEBUG("Retrieved Tool "<<m_clusterTool); - - return StatusCode::SUCCESS; -} - - -// ==================================================================== -StatusCode egammaBuilder::RetrieveAmbiguityTool() -{ - // retrieve Ambiguity tool - if (m_ambiguityTool.empty()) { - ATH_MSG_ERROR("EGammaAmbiguityTool is empty"); - return StatusCode::FAILURE; - } - - if((m_ambiguityTool.retrieve()).isFailure()) { - ATH_MSG_ERROR("Unable to retrieve "<<m_ambiguityTool); - return StatusCode::FAILURE; - } - else ATH_MSG_DEBUG("Retrieved Tool "<<m_ambiguityTool); - - return StatusCode::SUCCESS; -} // ==================================================================== StatusCode egammaBuilder::RetrieveEMTrackMatchBuilder(){ diff --git a/Reconstruction/egamma/egammaAlgs/src/egammaBuilder.h b/Reconstruction/egamma/egammaAlgs/src/egammaBuilder.h index 0489e366117da078d02bf78501bdadfd936673e4..f9611b9a039b92e8c465eaa32cd94b5cd375048a 100644 --- a/Reconstruction/egamma/egammaAlgs/src/egammaBuilder.h +++ b/Reconstruction/egamma/egammaAlgs/src/egammaBuilder.h @@ -123,9 +123,6 @@ class egammaBuilder : public AthAlgorithm "ConversionBuilderTool", "EMConversionBuilder", "Tool that matches conversion vertices to egammaRecs"}; - - /** @brief Retrieve each tool in the given vector **/ - StatusCode RetrieveTools(ToolHandleArray<IegammaBaseTool>& tools); /** @brief Call a tool using contExecute and electrons, photon containers if given **/ StatusCode CallTool(const EventContext& ctx, @@ -133,11 +130,6 @@ class egammaBuilder : public AthAlgorithm xAOD::ElectronContainer *electronContainer = 0, xAOD::PhotonContainer *photonContainer = 0); - /** @brief retrieve EMClusterTool **/ - StatusCode RetrieveEMClusterTool(); - - /** @brief retrieve EGammaAmbiguityTool **/ - StatusCode RetrieveAmbiguityTool(); /** @brief retrieve EMTrackMatchBuilder **/ StatusCode RetrieveEMTrackMatchBuilder(); /** @brief retrieve EMConversionBuilder **/ diff --git a/Reconstruction/egamma/egammaAlgs/src/egammaForwardBuilder.cxx b/Reconstruction/egamma/egammaAlgs/src/egammaForwardBuilder.cxx index 8f02aa37c752bab4676e65a04012e0d40a95a3aa..a021c920ee85a9108c96a9fdf5f6db74e2a15902 100644 --- a/Reconstruction/egamma/egammaAlgs/src/egammaForwardBuilder.cxx +++ b/Reconstruction/egamma/egammaAlgs/src/egammaForwardBuilder.cxx @@ -70,9 +70,7 @@ StatusCode egammaForwardBuilder::initialize() ATH_CHECK(m_fourMomBuilder.retrieve()); } - for (const auto& selector : m_forwardElectronIsEMSelectors) { - ATH_CHECK(selector.retrieve()); - } + ATH_CHECK(m_forwardElectronIsEMSelectors.retrieve()); if (m_forwardElectronIsEMSelectors.size() != m_forwardElectronIsEMSelectorResultNames.size()) { ATH_MSG_ERROR("The number of selectors does not match the number of given fwd-electron selector names"); diff --git a/Reconstruction/egamma/egammaAlgs/src/egammaForwardBuilder.h b/Reconstruction/egamma/egammaAlgs/src/egammaForwardBuilder.h index a2b6788f52384cf78465478801f9c059a40b093d..babf2d4e0b3b32f950fd8d70614162be314e9f56 100644 --- a/Reconstruction/egamma/egammaAlgs/src/egammaForwardBuilder.h +++ b/Reconstruction/egamma/egammaAlgs/src/egammaForwardBuilder.h @@ -62,13 +62,10 @@ class egammaForwardBuilder : public AthReentrantAlgorithm /** @brief execute method*/ virtual StatusCode execute_r(const EventContext& ctx) const override final; - /** @brief retrieve object quality tool */ - void RetrieveObjectQualityTool(); - /** @brief execute object quality tool */ - StatusCode ExecObjectQualityTool(const EventContext &ctx, xAOD::Egamma *eg) const; - private: + StatusCode ExecObjectQualityTool(const EventContext &ctx, xAOD::Egamma *eg) const; + /** @brief Tool to perform object quality*/ ToolHandle<IegammaBaseTool> m_objectQualityTool {this, "ObjectQualityToolName", "", diff --git a/Reconstruction/egamma/egammaAlgs/src/topoEgammaBuilder.cxx b/Reconstruction/egamma/egammaAlgs/src/topoEgammaBuilder.cxx index 901dde31c21441fc0b178d1423aa9f0f1b997ded..ed5ccf87a2453ba522f893b9f2f7053205586339 100644 --- a/Reconstruction/egamma/egammaAlgs/src/topoEgammaBuilder.cxx +++ b/Reconstruction/egamma/egammaAlgs/src/topoEgammaBuilder.cxx @@ -51,14 +51,14 @@ StatusCode topoEgammaBuilder::initialize() // ////////////////////////////////////////////////// // retrieve tools - CHECK( RetrieveEMClusterTool() ); - CHECK( RetrieveAmbiguityTool() ); + ATH_CHECK( m_clusterTool.retrieve() ); + ATH_CHECK( m_ambiguityTool.retrieve() ); ATH_MSG_DEBUG("Retrieving " << m_egammaTools.size() << " tools for egamma objects"); - CHECK( RetrieveTools(m_egammaTools) ); + ATH_CHECK( m_egammaTools.retrieve() ); ATH_MSG_DEBUG("Retrieving " << m_electronTools.size() << " tools for electrons"); - CHECK( RetrieveTools(m_electronTools) ); + ATH_CHECK( m_electronTools.retrieve() ); ATH_MSG_DEBUG("Retrieving " << m_photonTools.size() << " tools for photons"); - CHECK( RetrieveTools(m_photonTools) ); + ATH_CHECK( m_photonTools.retrieve() ); // retrieve timing profile if (m_doChrono) CHECK( m_timingProfile.retrieve() ); @@ -67,52 +67,6 @@ StatusCode topoEgammaBuilder::initialize() return StatusCode::SUCCESS; } -// ==================================================================== -StatusCode topoEgammaBuilder::RetrieveTools(ToolHandleArray<IegammaBaseTool>& tools){ - for (const auto tool : tools){ - if ( tool.retrieve().isFailure() ){ - ATH_MSG_FATAL( "Could not get tool: " << tool); - return StatusCode::FAILURE; - } - else ATH_MSG_DEBUG("Retrieved Tool " << tool); - } - return StatusCode::SUCCESS; -} - -// ==================================================================== -StatusCode topoEgammaBuilder::RetrieveEMClusterTool(){ - // retrieve Ambiguity tool - if (m_clusterTool.empty()) { - ATH_MSG_ERROR("EMClusterTool is empty"); - return StatusCode::FAILURE; - } - if((m_clusterTool.retrieve()).isFailure()) { - ATH_MSG_ERROR("Unable to retrieve "<<m_clusterTool); - return StatusCode::FAILURE; - } - else ATH_MSG_DEBUG("Retrieved Tool "<<m_clusterTool); - - return StatusCode::SUCCESS; -} - - -// ==================================================================== -StatusCode topoEgammaBuilder::RetrieveAmbiguityTool(){ - // retrieve Ambiguity tool - if (m_ambiguityTool.empty()) { - ATH_MSG_ERROR("EMAmbiguityTool is empty"); - return StatusCode::FAILURE; - } - - if((m_ambiguityTool.retrieve()).isFailure()) { - ATH_MSG_ERROR("Unable to retrieve "<<m_ambiguityTool); - return StatusCode::FAILURE; - } - else ATH_MSG_DEBUG("Retrieved Tool "<<m_ambiguityTool); - - return StatusCode::SUCCESS; -} - // ==================================================================== StatusCode topoEgammaBuilder::finalize(){ // finalize method diff --git a/Reconstruction/egamma/egammaAlgs/src/topoEgammaBuilder.h b/Reconstruction/egamma/egammaAlgs/src/topoEgammaBuilder.h index 12783e543296aa3d36140c5ccb32ee9c3713d580..22b776a965839df92fe9134e5d1358f0da0ab076 100644 --- a/Reconstruction/egamma/egammaAlgs/src/topoEgammaBuilder.h +++ b/Reconstruction/egamma/egammaAlgs/src/topoEgammaBuilder.h @@ -74,16 +74,6 @@ private: "Tool that does electron/photon ambiguity resolution"}; - /** @brief Retrieve each tool in the given vector **/ - StatusCode RetrieveTools(ToolHandleArray<IegammaBaseTool>& tools); - - /** @brief retrieve EMClusterTool **/ - StatusCode RetrieveEMClusterTool(); - - /** @brief retrieve EMAmbiguityTool **/ - StatusCode RetrieveAmbiguityTool(); - - /** Given an egammaRec object, a pointer to the electron container and the author, * create and dress an electron, pushing it back to the container and * calling the relevant tools **/ diff --git a/Reconstruction/egamma/egammaTools/src/EMPIDBuilder.cxx b/Reconstruction/egamma/egammaTools/src/EMPIDBuilder.cxx index 527bf03a032eae30b29bfd1e29a9afdc2f0fed97..8702ef01d41018662bcd494736c3e32e0ee8a7de 100644 --- a/Reconstruction/egamma/egammaTools/src/EMPIDBuilder.cxx +++ b/Reconstruction/egamma/egammaTools/src/EMPIDBuilder.cxx @@ -40,35 +40,28 @@ StatusCode EMPIDBuilder::initialize() ATH_MSG_DEBUG(" Initializing EMPIDBuilder"); - for (const auto& selector : m_electronIsEMselectors) { - CHECK(selector.retrieve()); - } + ATH_CHECK(m_electronIsEMselectors.retrieve()); if (m_electronIsEMselectors.size() != m_electronIsEMselectorResultNames.size()) { ATH_MSG_ERROR("The number of selectors does not match the number of given electronIsEMselector names"); return StatusCode::FAILURE; } - for (const auto& selector : m_electronLHselectors) { - CHECK(selector.retrieve()); - } + ATH_CHECK(m_electronLHselectors.retrieve()); if (m_electronLHselectors.size() != m_electronLHselectorResultNames.size()) { ATH_MSG_ERROR("The number of selectors does not match the number of given electron LH selector names"); return StatusCode::FAILURE; } - for (const auto& selector : m_genericIsEMselectors) { - CHECK(selector.retrieve()); - } + ATH_CHECK(m_genericIsEMselectors.retrieve()); if (m_genericIsEMselectors.size() != m_genericIsEMselectorResultNames.size()) { ATH_MSG_ERROR("The number of selectors does not match the number of given generic selector names"); return StatusCode::FAILURE; } - for (const auto& selector : m_photonIsEMselectors) { - CHECK(selector.retrieve()); - } + + ATH_CHECK(m_photonIsEMselectors.retrieve()); if (m_photonIsEMselectors.size() != m_photonIsEMselectorResultNames.size()) { ATH_MSG_ERROR("The number of selectors does not match the number of given photon selector names"); diff --git a/Reconstruction/egamma/egammaTools/src/egammaSwTool.cxx b/Reconstruction/egamma/egammaTools/src/egammaSwTool.cxx index 724b35c6ff2420e12e761a3edda1effdae505211..732c69fea13c20a71e322fd1519092a1f8c3b65d 100644 --- a/Reconstruction/egamma/egammaTools/src/egammaSwTool.cxx +++ b/Reconstruction/egamma/egammaTools/src/egammaSwTool.cxx @@ -45,29 +45,29 @@ StatusCode egammaSwTool::initialize() ATH_MSG_DEBUG(" Initializing egammaSwTool"); - ATH_CHECK(populateTools(m_clusterCorrectionPointersEle35)); - ATH_CHECK(populateTools(m_clusterCorrectionPointersEle37)); - ATH_CHECK(populateTools(m_clusterCorrectionPointersEle55)); + ATH_CHECK(m_clusterCorrectionPointersEle35.retrieve()); + ATH_CHECK(m_clusterCorrectionPointersEle37.retrieve()); + ATH_CHECK(m_clusterCorrectionPointersEle55.retrieve()); // - ATH_CHECK(populateTools(m_clusterCorrectionPointersGam35)); - ATH_CHECK(populateTools(m_clusterCorrectionPointersGam37)); - ATH_CHECK(populateTools(m_clusterCorrectionPointersGam55)); + ATH_CHECK(m_clusterCorrectionPointersGam35.retrieve()); + ATH_CHECK(m_clusterCorrectionPointersGam37.retrieve()); + ATH_CHECK(m_clusterCorrectionPointersGam55.retrieve()); // - ATH_CHECK(populateTools(m_clusterCorrectionPointersEconv35)); - ATH_CHECK(populateTools(m_clusterCorrectionPointersEconv37)); - ATH_CHECK(populateTools(m_clusterCorrectionPointersEconv55)); + ATH_CHECK(m_clusterCorrectionPointersEconv35.retrieve()); + ATH_CHECK(m_clusterCorrectionPointersEconv37.retrieve()); + ATH_CHECK(m_clusterCorrectionPointersEconv55.retrieve()); //SuperCluster - ATH_CHECK(populateTools(m_clusterCorrectionPointersSuperClusterEle35)); - ATH_CHECK(populateTools(m_clusterCorrectionPointersSuperClusterEle37)); - ATH_CHECK(populateTools(m_clusterCorrectionPointersSuperClusterEle55)); + ATH_CHECK(m_clusterCorrectionPointersSuperClusterEle35.retrieve()); + ATH_CHECK(m_clusterCorrectionPointersSuperClusterEle37.retrieve()); + ATH_CHECK(m_clusterCorrectionPointersSuperClusterEle55.retrieve()); // - ATH_CHECK(populateTools(m_clusterCorrectionPointersSuperClusterGam35)); - ATH_CHECK(populateTools(m_clusterCorrectionPointersSuperClusterGam37)); - ATH_CHECK(populateTools(m_clusterCorrectionPointersSuperClusterGam55)); + ATH_CHECK(m_clusterCorrectionPointersSuperClusterGam35.retrieve()); + ATH_CHECK(m_clusterCorrectionPointersSuperClusterGam37.retrieve()); + ATH_CHECK(m_clusterCorrectionPointersSuperClusterGam55.retrieve()); // - ATH_CHECK(populateTools(m_clusterCorrectionPointersSuperClusterEconv35)); - ATH_CHECK(populateTools(m_clusterCorrectionPointersSuperClusterEconv37)); - ATH_CHECK(populateTools(m_clusterCorrectionPointersSuperClusterEconv55)); + ATH_CHECK(m_clusterCorrectionPointersSuperClusterEconv35.retrieve()); + ATH_CHECK(m_clusterCorrectionPointersSuperClusterEconv37.retrieve()); + ATH_CHECK(m_clusterCorrectionPointersSuperClusterEconv55.retrieve()); return StatusCode::SUCCESS; } @@ -173,18 +173,6 @@ StatusCode egammaSwTool::execute(const EventContext& ctx, xAOD::CaloCluster* clu return StatusCode::SUCCESS; } -StatusCode egammaSwTool::populateTools(ToolHandleArray<CaloClusterProcessor>& tools) -{ - for (const auto tool : tools){ - if ( tool.retrieve().isFailure() ){ - ATH_MSG_FATAL( "Could not get tool: " << tool); - return StatusCode::FAILURE; - } - else ATH_MSG_DEBUG("Retrieved Tool " << tool); - } - return StatusCode::SUCCESS; -} - StatusCode egammaSwTool::processTools(const EventContext& ctx, ToolHandleArray<CaloClusterProcessor>& tools, xAOD::CaloCluster* cluster) const { diff --git a/Reconstruction/egamma/egammaTools/src/egammaSwTool.h b/Reconstruction/egamma/egammaTools/src/egammaSwTool.h index 7f21ce0a9818950ef88da9d3eba47282860c9392..8be97e737e59f48ed766727a60ad36c78e5647d7 100644 --- a/Reconstruction/egamma/egammaTools/src/egammaSwTool.h +++ b/Reconstruction/egamma/egammaTools/src/egammaSwTool.h @@ -44,7 +44,6 @@ class egammaSwTool : public AthAlgTool, virtual public IegammaSwTool private: - StatusCode populateTools(ToolHandleArray<CaloClusterProcessor>& tools); StatusCode processTools(const EventContext& ctx, ToolHandleArray<CaloClusterProcessor>& tools, xAOD::CaloCluster* cluster) const; /**