diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/ITkPixelOfflineCalibCondAlg.cxx b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/ITkPixelOfflineCalibCondAlg.cxx index 5a78370b233a1db2cd211777ee04075c0f8416b0..6afbc3615747caddd3efb6de2a34860063d2bcc3 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/ITkPixelOfflineCalibCondAlg.cxx +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/ITkPixelOfflineCalibCondAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ #include "ITkPixelOfflineCalibCondAlg.h" @@ -22,8 +22,7 @@ PixelOfflineCalibCondAlg::PixelOfflineCalibCondAlg(const std::string& name, ISvc StatusCode PixelOfflineCalibCondAlg::initialize() { ATH_MSG_DEBUG("ITkPixelOfflineCalibCondAlg::initialize()"); - ATH_CHECK(service("DetectorStore", m_detStore)); - ATH_CHECK(m_detStore->retrieve(m_pixelid, "PixelID")) ; + ATH_CHECK(detStore()->retrieve(m_pixelid, "PixelID")) ; if (m_inputSource==2 && m_readKey.key().empty()) { ATH_MSG_ERROR("The database is set to be input source (2) but the ReadKey is empty."); diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/ITkPixelOfflineCalibCondAlg.h b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/ITkPixelOfflineCalibCondAlg.h index b1915d209fd3897ba82ae0c8fad49f65311d2695..daa3f7dab0260d8fb5f685da697dc4221f875142 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/ITkPixelOfflineCalibCondAlg.h +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/ITkPixelOfflineCalibCondAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ #ifndef ITKPIXELOFFLINECALIBCONDALG @@ -46,7 +46,6 @@ class PixelOfflineCalibCondAlg : public AthReentrantAlgorithm SG::WriteCondHandleKey<ITk::PixelOfflineCalibData> m_writeKey {this, "WriteKey", "ITkPixelOfflineCalibData", "Output key of pixel module data"}; - StoreGateSvc* m_detStore{nullptr}; const PixelID* m_pixelid{nullptr}; }; diff --git a/InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/ITkPixelClusterErrorData.h b/InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/ITkPixelClusterErrorData.h index 8f45d152512662019000bffe1df8b2ba2785b0e5..01370d3e1d22147d036e3440b48143357db075e8 100644 --- a/InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/ITkPixelClusterErrorData.h +++ b/InnerDetector/InDetConditions/PixelConditionsData/PixelConditionsData/ITkPixelClusterErrorData.h @@ -9,7 +9,6 @@ #include "Identifier/Identifier.h" #include "InDetIdentifier/PixelID.h" -#include "StoreGate/StoreGateSvc.h" #include <string> #include <vector> @@ -47,7 +46,6 @@ class PixelClusterErrorData // map to store all ITk Analogue Clustering constants and errors std::map< const Identifier, std::vector<double> > m_constmap; - StoreGateSvc* m_detStore{nullptr}; const PixelID* m_pixelID{nullptr}; }; diff --git a/InnerDetector/InDetConditions/PixelConditionsData/src/ITkPixelClusterErrorData.cxx b/InnerDetector/InDetConditions/PixelConditionsData/src/ITkPixelClusterErrorData.cxx index 4ac3da2a031c2bf8a6ad09e127609725ac408d2c..a86d93dac4c747e0538f7cbe3022f4883ec6fe91 100644 --- a/InnerDetector/InDetConditions/PixelConditionsData/src/ITkPixelClusterErrorData.cxx +++ b/InnerDetector/InDetConditions/PixelConditionsData/src/ITkPixelClusterErrorData.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ #include "PixelConditionsData/ITkPixelClusterErrorData.h" @@ -7,6 +7,7 @@ #include "GaudiKernel/ISvcLocator.h" #include "Identifier/IdentifierHash.h" +#include "StoreGate/StoreGateSvc.h" #include <fstream> #include <string> @@ -18,13 +19,11 @@ namespace ITk void PixelClusterErrorData::Initialize() { - - ISvcLocator* svcLoc = Gaudi::svcLocator(); - StatusCode sc = svcLoc->service("DetectorStore", m_detStore); - if(sc.isFailure()){ + SmartIF<StoreGateSvc> detStore{Gaudi::svcLocator()->service("DetectorStore")}; + if(!detStore){ throw std::runtime_error("Could not retrieve DetectorStore"); } - sc = m_detStore->retrieve(m_pixelID, "PixelID"); + StatusCode sc = detStore->retrieve(m_pixelID, "PixelID"); if(sc.isFailure()){ throw std::runtime_error("Could not retrieve PixelID"); }