diff --git a/Calorimeter/CaloAlignment/CaloAlignmentAlgs/src/CaloAlignCondAlg.cxx b/Calorimeter/CaloAlignment/CaloAlignmentAlgs/src/CaloAlignCondAlg.cxx index 03b906f1634fb490f344096db10157293db40561..52f677372e8c9a35d3e2f3d79e36611816387a92 100644 --- a/Calorimeter/CaloAlignment/CaloAlignmentAlgs/src/CaloAlignCondAlg.cxx +++ b/Calorimeter/CaloAlignment/CaloAlignmentAlgs/src/CaloAlignCondAlg.cxx @@ -30,8 +30,9 @@ StatusCode CaloAlignCondAlg::initialize() StatusCode CaloAlignCondAlg::execute() { + const EventContext& ctx = Gaudi::Hive::currentContext(); // ____________ Construct Write Cond Handle and check its validity ____________ - SG::WriteCondHandle<CaloDetDescrManager> writeCaloMgrHandle{m_writeCaloMgrKey}; + SG::WriteCondHandle<CaloDetDescrManager> writeCaloMgrHandle{m_writeCaloMgrKey,ctx}; if (writeCaloMgrHandle.isValid()) { ATH_MSG_DEBUG("Found valid write handle"); return StatusCode::SUCCESS; @@ -41,7 +42,7 @@ StatusCode CaloAlignCondAlg::execute() // 1. GeoAlignmentStore const GeoAlignmentStore* geoAlign{nullptr}; if(!m_readKeyGeoAlign.empty()) { - SG::ReadCondHandle<GeoAlignmentStore> readHandleGeoAlign{m_readKeyGeoAlign}; + SG::ReadCondHandle<GeoAlignmentStore> readHandleGeoAlign{m_readKeyGeoAlign,ctx}; ATH_CHECK(readHandleGeoAlign.isValid()); ATH_MSG_DEBUG("Retrieved GeoAlignmentStore object form the Condition Store"); writeCaloMgrHandle.addDependency(readHandleGeoAlign); @@ -51,7 +52,7 @@ StatusCode CaloAlignCondAlg::execute() // 2. CaloCellPositionShift const CaloRec::CaloCellPositionShift* cellPosShift{nullptr}; if(!m_readKeyCellPosShift.empty()) { - SG::ReadCondHandle<CaloRec::CaloCellPositionShift> readHandleCellPosShift{m_readKeyCellPosShift}; + SG::ReadCondHandle<CaloRec::CaloCellPositionShift> readHandleCellPosShift{m_readKeyCellPosShift,ctx}; ATH_CHECK(readHandleCellPosShift.isValid()); ATH_MSG_DEBUG("Retrieved CaloRec::CaloCellPositionShift object form the Condition Store"); writeCaloMgrHandle.addDependency(readHandleCellPosShift); diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelAlignCondAlg.cxx b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelAlignCondAlg.cxx index 6f68f62d894ab083ec49bcee9a7c614594395e61..9f475f22e47f8d8502a9ccd8fb5d9ad87d7ebff6 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelAlignCondAlg.cxx +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelAlignCondAlg.cxx @@ -10,7 +10,7 @@ #include <memory> PixelAlignCondAlg::PixelAlignCondAlg(const std::string& name, ISvcLocator* pSvcLocator) - : ::AthReentrantAlgorithm(name, pSvcLocator) + : ::AthAlgorithm(name, pSvcLocator) { } @@ -41,10 +41,11 @@ StatusCode PixelAlignCondAlg::initialize() return StatusCode::SUCCESS; } -StatusCode PixelAlignCondAlg::execute(const EventContext& ctx) const +StatusCode PixelAlignCondAlg::execute() { ATH_MSG_DEBUG("execute " << name()); + const EventContext& ctx = Gaudi::Hive::currentContext(); // ____________ Construct Write Cond Handle and check its validity ____________ SG::WriteCondHandle<GeoAlignmentStore> writeHandle{m_writeKey, ctx}; diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelAlignCondAlg.h b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelAlignCondAlg.h index f90f36709931d7262d4572a53787302308b80e8c..def54ed8f7f840d7071083573502f1a652225e7b 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelAlignCondAlg.h +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelAlignCondAlg.h @@ -7,7 +7,7 @@ #ifndef PIXELCONDITIONSALGORITHMS_PIXELALIGNCONDALG_H #define PIXELCONDITIONSALGORITHMS_PIXELALIGNCONDALG_H -#include "AthenaBaseComps/AthReentrantAlgorithm.h" +#include "AthenaBaseComps/AthAlgorithm.h" #include "StoreGate/ReadCondHandleKey.h" #include "StoreGate/WriteCondHandleKey.h" @@ -21,14 +21,14 @@ namespace InDetDD { class PixelDetectorManager; } -class PixelAlignCondAlg : public AthReentrantAlgorithm +class PixelAlignCondAlg : public AthAlgorithm { public: PixelAlignCondAlg(const std::string& name, ISvcLocator* pSvcLocator); virtual ~PixelAlignCondAlg() override = default; virtual StatusCode initialize() override; - virtual StatusCode execute(const EventContext& ctx) const override; + virtual StatusCode execute() override; private: BooleanProperty m_useDynamicAlignFolders{ diff --git a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_AlignCondAlg.cxx b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_AlignCondAlg.cxx index 02dbd7cd174cc9ea1e59f3ad12f837eac76b3c9c..ae6907ac837597d75e3a52754e2a9eb35a3556bb 100644 --- a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_AlignCondAlg.cxx +++ b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_AlignCondAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "SCT_AlignCondAlg.h" @@ -10,7 +10,7 @@ #include <memory> SCT_AlignCondAlg::SCT_AlignCondAlg(const std::string& name, ISvcLocator* pSvcLocator) - : ::AthReentrantAlgorithm(name, pSvcLocator) + : ::AthAlgorithm(name, pSvcLocator) , m_writeKey{"SCTAlignmentStore", "SCTAlignmentStore"} , m_DetManagerName("SCT") { @@ -44,10 +44,11 @@ StatusCode SCT_AlignCondAlg::initialize() return StatusCode::SUCCESS; } -StatusCode SCT_AlignCondAlg::execute(const EventContext& ctx) const +StatusCode SCT_AlignCondAlg::execute() { ATH_MSG_DEBUG("execute " << name()); + const EventContext& ctx = Gaudi::Hive::currentContext(); // ____________ Construct Write Cond Handle and check its validity ____________ SG::WriteCondHandle<GeoAlignmentStore> writeHandle{m_writeKey, ctx}; diff --git a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_AlignCondAlg.h b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_AlignCondAlg.h index fb2097449ab5028a73166d1a5b5a2d46b06013f7..9911ceaf279c49e89a6de68e6e22c2010dd572e1 100644 --- a/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_AlignCondAlg.h +++ b/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/src/SCT_AlignCondAlg.h @@ -1,13 +1,13 @@ // -*- C++ -*- /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #ifndef SCT_CONDITIONSALGORITHMS_SCT_ALIGNCONDALG_H #define SCT_CONDITIONSALGORITHMS_SCT_ALIGNCONDALG_H -#include "AthenaBaseComps/AthReentrantAlgorithm.h" +#include "AthenaBaseComps/AthAlgorithm.h" #include "StoreGate/ReadCondHandleKey.h" #include "StoreGate/WriteCondHandleKey.h" @@ -36,14 +36,14 @@ namespace InDetDD { // However, we cannot give non-const pointer for SiDetectorElement // in SCT_DetectorManager in the above chain. -class SCT_AlignCondAlg : public AthReentrantAlgorithm +class SCT_AlignCondAlg : public AthAlgorithm { public: SCT_AlignCondAlg(const std::string& name, ISvcLocator* pSvcLocator); virtual ~SCT_AlignCondAlg() override = default; virtual StatusCode initialize() override; - virtual StatusCode execute(const EventContext& ctx) const override; + virtual StatusCode execute() override; virtual StatusCode finalize() override; private: diff --git a/InnerDetector/InDetConditions/TRT_ConditionsAlgs/src/TRTAlignCondAlg.cxx b/InnerDetector/InDetConditions/TRT_ConditionsAlgs/src/TRTAlignCondAlg.cxx index 3175f724d51e72c340430c258413c38c80ce993f..2252e85aed9f3175f2f0d743a0023be557e9fb72 100644 --- a/InnerDetector/InDetConditions/TRT_ConditionsAlgs/src/TRTAlignCondAlg.cxx +++ b/InnerDetector/InDetConditions/TRT_ConditionsAlgs/src/TRTAlignCondAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ @@ -58,9 +58,10 @@ StatusCode TRTAlignCondAlg::execute() { ATH_MSG_DEBUG("execute " << name()); + const EventContext& ctx = Gaudi::Hive::currentContext(); // ____________ Construct Write Cond Handles and check their validity ____________ - SG::WriteCondHandle<GeoAlignmentStore> writeHandle{m_writeKeyAlignStore}; - SG::WriteCondHandle<InDetDD::TRT_DetElementContainer> writeHandleDetElCont{m_writeKeyDetElCont}; + SG::WriteCondHandle<GeoAlignmentStore> writeHandle{m_writeKeyAlignStore,ctx}; + SG::WriteCondHandle<InDetDD::TRT_DetElementContainer> writeHandleDetElCont{m_writeKeyDetElCont,ctx}; if (writeHandleDetElCont.isValid()) { ATH_MSG_DEBUG("CondHandle " << writeHandleDetElCont.fullKey() << " is already valid." @@ -95,7 +96,7 @@ StatusCode TRTAlignCondAlg::execute() // 1. Dynamic folders // ** Global - SG::ReadCondHandle<CondAttrListCollection> readHandleDynamicGlobal{m_readKeyDynamicGlobal}; + SG::ReadCondHandle<CondAttrListCollection> readHandleDynamicGlobal{m_readKeyDynamicGlobal,ctx}; // Get CDO and store it into container const CondAttrListCollection* readCdoDynamicGlobal{*readHandleDynamicGlobal}; if(readCdoDynamicGlobal==nullptr) { @@ -111,7 +112,7 @@ StatusCode TRTAlignCondAlg::execute() } // ** Regular - SG::ReadCondHandle<AlignableTransformContainer> readHandleDynamicRegular{m_readKeyDynamicRegular}; + SG::ReadCondHandle<AlignableTransformContainer> readHandleDynamicRegular{m_readKeyDynamicRegular,ctx}; // Get CDO and store it into container const AlignableTransformContainer* readCdoDynamicRegular{*readHandleDynamicRegular}; if(readCdoDynamicRegular==nullptr) { @@ -131,7 +132,7 @@ StatusCode TRTAlignCondAlg::execute() } else { // 2. Regular folder - SG::ReadCondHandle<AlignableTransformContainer> readHandleRegular{m_readKeyRegular}; + SG::ReadCondHandle<AlignableTransformContainer> readHandleRegular{m_readKeyRegular,ctx}; // Get CDO and store it into container const AlignableTransformContainer* readCdoRegular{*readHandleRegular}; if(readCdoRegular==nullptr) { diff --git a/LArCalorimeter/LArAlignment/LArAlignmentAlgs/src/LArAlignCondAlg.cxx b/LArCalorimeter/LArAlignment/LArAlignmentAlgs/src/LArAlignCondAlg.cxx index c2867823e63fdc060389ec67fb6804e64543c724..59ab3c7744be4342c4c340694f0c76ff94329e65 100644 --- a/LArCalorimeter/LArAlignment/LArAlignmentAlgs/src/LArAlignCondAlg.cxx +++ b/LArCalorimeter/LArAlignment/LArAlignmentAlgs/src/LArAlignCondAlg.cxx @@ -28,15 +28,16 @@ StatusCode LArAlignCondAlg::initialize() StatusCode LArAlignCondAlg::execute() { + const EventContext& ctx = Gaudi::Hive::currentContext(); // ____________ Construct Write Cond Handle and check its validity ____________ - SG::WriteCondHandle<GeoAlignmentStore> writeGeoAlignHandle{m_writeGeoAlignKey}; + SG::WriteCondHandle<GeoAlignmentStore> writeGeoAlignHandle{m_writeGeoAlignKey,ctx}; if (writeGeoAlignHandle.isValid()) { ATH_MSG_DEBUG("Found valid write handle"); return StatusCode::SUCCESS; } // ____________ Get Read Cond Object ____________ - SG::ReadCondHandle<DetCondKeyTrans> readLArAlignHandle{m_readLArAlignKey}; + SG::ReadCondHandle<DetCondKeyTrans> readLArAlignHandle{m_readLArAlignKey,ctx}; ATH_CHECK(readLArAlignHandle.isValid()); ATH_MSG_DEBUG("Retrieved DetCondKeyTrans object form the Condition Store"); writeGeoAlignHandle.addDependency(readLArAlignHandle);