diff --git a/InnerDetector/InDetConditions/SCT_ConditionsTools/src/SCT_ReadoutTool.cxx b/InnerDetector/InDetConditions/SCT_ConditionsTools/src/SCT_ReadoutTool.cxx index a22968b616775bb552e3cd7f30a83775271c1de3..92770569f12c898291279830878d67bff4cbb6b6 100644 --- a/InnerDetector/InDetConditions/SCT_ConditionsTools/src/SCT_ReadoutTool.cxx +++ b/InnerDetector/InDetConditions/SCT_ConditionsTools/src/SCT_ReadoutTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ #include "SCT_ReadoutTool.h" @@ -12,8 +12,7 @@ // Constructor SCT_ReadoutTool::SCT_ReadoutTool(const std::string& type, const std::string& name, const IInterface* parent): base_class(type, name, parent), - m_sctId{nullptr}, - m_msgSvc{nullptr} + m_sctId{nullptr} { } @@ -26,9 +25,7 @@ StatusCode SCT_ReadoutTool::initialize() { } // Retrieve SCT helper ATH_CHECK(detStore()->retrieve(m_sctId, "SCT_ID")); - // Get MessageSvc for SCT_ReadoutData - ISvcLocator* svcLocator{Gaudi::svcLocator()}; - ATH_CHECK(svcLocator->service("MessageSvc", m_msgSvc)); + return StatusCode::SUCCESS; } @@ -82,7 +79,7 @@ StatusCode SCT_ReadoutTool::determineReadout(const Identifier& moduleId, std::ve return StatusCode::SUCCESS; } - SCT_ReadoutData data(m_msgSvc); + SCT_ReadoutData data(msgSvc()); // Set the chips and sort in order of ID data.setChips(chips); diff --git a/InnerDetector/InDetConditions/SCT_ConditionsTools/src/SCT_ReadoutTool.h b/InnerDetector/InDetConditions/SCT_ConditionsTools/src/SCT_ReadoutTool.h index b8cf553b47bf8f19c3fcc09541a40dfa2828484d..b62c3b7ce3a68e5d4fb1b25c5461fe8a6d5b554d 100644 --- a/InnerDetector/InDetConditions/SCT_ConditionsTools/src/SCT_ReadoutTool.h +++ b/InnerDetector/InDetConditions/SCT_ConditionsTools/src/SCT_ReadoutTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /** @@ -48,7 +48,6 @@ class SCT_ReadoutTool : public extends<AthAlgTool, ISCT_ReadoutTool> { /** Private data*/ const SCT_ID* m_sctId; //!< ID helper for SCT - IMessageSvc* m_msgSvc; ToolHandle<ISCT_CablingTool> m_cablingTool{this, "SCT_CablingTool", "SCT_CablingTool", "Tool to retrieve SCT Cabling"}; }; diff --git a/InnerDetector/InDetConditions/SCT_ConditionsTools/test/SCT_RODVetoTool_test.cxx b/InnerDetector/InDetConditions/SCT_ConditionsTools/test/SCT_RODVetoTool_test.cxx index 4255165791b69587364abd540f464bd3cdc91478..5fe7a47e3c9710b6324eb8490f33064cc89bb68b 100644 --- a/InnerDetector/InDetConditions/SCT_ConditionsTools/test/SCT_RODVetoTool_test.cxx +++ b/InnerDetector/InDetConditions/SCT_ConditionsTools/test/SCT_RODVetoTool_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /** @@ -74,8 +74,8 @@ protected: m_svcMgr = m_appMgr; ASSERT_TRUE( m_svcMgr.isValid() ); - m_sg = nullptr; - ASSERT_TRUE( m_svcLoc->service ("StoreGateSvc", m_sg).isSuccess() ); + m_sg = m_svcLoc->service ("StoreGateSvc"); + ASSERT_TRUE( m_sg.isValid() ); m_evtSel = m_svcLoc->service("EventSelector"); ASSERT_TRUE( m_evtSel.isValid() ); @@ -104,8 +104,8 @@ protected: ASSERT_TRUE( detStore->record(pHelper, "SCT_ID").isSuccess() ); } } - StoreGateSvc* conditionStore = nullptr; - ASSERT_TRUE( m_svcLoc->service ("StoreGateSvc/ConditionStore", conditionStore).isSuccess() ); + SmartIF<StoreGateSvc> conditionStore{m_svcLoc->service ("StoreGateSvc/ConditionStore")}; + ASSERT_TRUE( conditionStore.isValid() ); } @@ -122,7 +122,7 @@ protected: SmartIF<IToolSvc> m_toolSvc; SmartIF<IEvtSelector> m_evtSel; SmartIF<IProperty> m_propMgr; - StoreGateSvc* m_sg{nullptr}; + SmartIF<StoreGateSvc> m_sg; Athena_test::DummyRCUSvc m_rcu; }; @@ -189,8 +189,8 @@ TEST_F(SCT_RODVetoTool_test, isGood_Id) { EventIDBase eid (1, 0, 0, 0, 20); ctx.setEventID (eid); - StoreGateSvc* conditionStore = nullptr; - ASSERT_TRUE( m_svcLoc->service ("StoreGateSvc/ConditionStore", conditionStore).isSuccess() ); + SmartIF<StoreGateSvc> conditionStore{m_svcLoc->service ("StoreGateSvc/ConditionStore")}; + ASSERT_TRUE( conditionStore.isValid() ); std::unique_ptr<IdentifierSet> dummyData{std::make_unique<IdentifierSet>()}; DataObjID id2 ("BadSCTModuleIds_RODVeto");