Commit 8df5c144 authored by Vakhtang Tsulaia's avatar Vakhtang Tsulaia
Browse files

Merge branch 'master-aligncondalgs' into 'master'

Fixes in alignment condition algorithms

See merge request atlas/athena!47509
parents f8fae691 34c20bee
...@@ -30,8 +30,9 @@ StatusCode CaloAlignCondAlg::initialize() ...@@ -30,8 +30,9 @@ StatusCode CaloAlignCondAlg::initialize()
StatusCode CaloAlignCondAlg::execute() StatusCode CaloAlignCondAlg::execute()
{ {
const EventContext& ctx = Gaudi::Hive::currentContext();
// ____________ Construct Write Cond Handle and check its validity ____________ // ____________ Construct Write Cond Handle and check its validity ____________
SG::WriteCondHandle<CaloDetDescrManager> writeCaloMgrHandle{m_writeCaloMgrKey}; SG::WriteCondHandle<CaloDetDescrManager> writeCaloMgrHandle{m_writeCaloMgrKey,ctx};
if (writeCaloMgrHandle.isValid()) { if (writeCaloMgrHandle.isValid()) {
ATH_MSG_DEBUG("Found valid write handle"); ATH_MSG_DEBUG("Found valid write handle");
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
...@@ -41,7 +42,7 @@ StatusCode CaloAlignCondAlg::execute() ...@@ -41,7 +42,7 @@ StatusCode CaloAlignCondAlg::execute()
// 1. GeoAlignmentStore // 1. GeoAlignmentStore
const GeoAlignmentStore* geoAlign{nullptr}; const GeoAlignmentStore* geoAlign{nullptr};
if(!m_readKeyGeoAlign.empty()) { if(!m_readKeyGeoAlign.empty()) {
SG::ReadCondHandle<GeoAlignmentStore> readHandleGeoAlign{m_readKeyGeoAlign}; SG::ReadCondHandle<GeoAlignmentStore> readHandleGeoAlign{m_readKeyGeoAlign,ctx};
ATH_CHECK(readHandleGeoAlign.isValid()); ATH_CHECK(readHandleGeoAlign.isValid());
ATH_MSG_DEBUG("Retrieved GeoAlignmentStore object form the Condition Store"); ATH_MSG_DEBUG("Retrieved GeoAlignmentStore object form the Condition Store");
writeCaloMgrHandle.addDependency(readHandleGeoAlign); writeCaloMgrHandle.addDependency(readHandleGeoAlign);
...@@ -51,7 +52,7 @@ StatusCode CaloAlignCondAlg::execute() ...@@ -51,7 +52,7 @@ StatusCode CaloAlignCondAlg::execute()
// 2. CaloCellPositionShift // 2. CaloCellPositionShift
const CaloRec::CaloCellPositionShift* cellPosShift{nullptr}; const CaloRec::CaloCellPositionShift* cellPosShift{nullptr};
if(!m_readKeyCellPosShift.empty()) { if(!m_readKeyCellPosShift.empty()) {
SG::ReadCondHandle<CaloRec::CaloCellPositionShift> readHandleCellPosShift{m_readKeyCellPosShift}; SG::ReadCondHandle<CaloRec::CaloCellPositionShift> readHandleCellPosShift{m_readKeyCellPosShift,ctx};
ATH_CHECK(readHandleCellPosShift.isValid()); ATH_CHECK(readHandleCellPosShift.isValid());
ATH_MSG_DEBUG("Retrieved CaloRec::CaloCellPositionShift object form the Condition Store"); ATH_MSG_DEBUG("Retrieved CaloRec::CaloCellPositionShift object form the Condition Store");
writeCaloMgrHandle.addDependency(readHandleCellPosShift); writeCaloMgrHandle.addDependency(readHandleCellPosShift);
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include <memory> #include <memory>
PixelAlignCondAlg::PixelAlignCondAlg(const std::string& name, ISvcLocator* pSvcLocator) PixelAlignCondAlg::PixelAlignCondAlg(const std::string& name, ISvcLocator* pSvcLocator)
: ::AthReentrantAlgorithm(name, pSvcLocator) : ::AthAlgorithm(name, pSvcLocator)
{ {
} }
...@@ -41,10 +41,11 @@ StatusCode PixelAlignCondAlg::initialize() ...@@ -41,10 +41,11 @@ StatusCode PixelAlignCondAlg::initialize()
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
} }
StatusCode PixelAlignCondAlg::execute(const EventContext& ctx) const StatusCode PixelAlignCondAlg::execute()
{ {
ATH_MSG_DEBUG("execute " << name()); ATH_MSG_DEBUG("execute " << name());
const EventContext& ctx = Gaudi::Hive::currentContext();
// ____________ Construct Write Cond Handle and check its validity ____________ // ____________ Construct Write Cond Handle and check its validity ____________
SG::WriteCondHandle<GeoAlignmentStore> writeHandle{m_writeKey, ctx}; SG::WriteCondHandle<GeoAlignmentStore> writeHandle{m_writeKey, ctx};
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#ifndef PIXELCONDITIONSALGORITHMS_PIXELALIGNCONDALG_H #ifndef PIXELCONDITIONSALGORITHMS_PIXELALIGNCONDALG_H
#define PIXELCONDITIONSALGORITHMS_PIXELALIGNCONDALG_H #define PIXELCONDITIONSALGORITHMS_PIXELALIGNCONDALG_H
#include "AthenaBaseComps/AthReentrantAlgorithm.h" #include "AthenaBaseComps/AthAlgorithm.h"
#include "StoreGate/ReadCondHandleKey.h" #include "StoreGate/ReadCondHandleKey.h"
#include "StoreGate/WriteCondHandleKey.h" #include "StoreGate/WriteCondHandleKey.h"
...@@ -21,14 +21,14 @@ namespace InDetDD { ...@@ -21,14 +21,14 @@ namespace InDetDD {
class PixelDetectorManager; class PixelDetectorManager;
} }
class PixelAlignCondAlg : public AthReentrantAlgorithm class PixelAlignCondAlg : public AthAlgorithm
{ {
public: public:
PixelAlignCondAlg(const std::string& name, ISvcLocator* pSvcLocator); PixelAlignCondAlg(const std::string& name, ISvcLocator* pSvcLocator);
virtual ~PixelAlignCondAlg() override = default; virtual ~PixelAlignCondAlg() override = default;
virtual StatusCode initialize() override; virtual StatusCode initialize() override;
virtual StatusCode execute(const EventContext& ctx) const override; virtual StatusCode execute() override;
private: private:
BooleanProperty m_useDynamicAlignFolders{ BooleanProperty m_useDynamicAlignFolders{
......
/* /*
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" #include "SCT_AlignCondAlg.h"
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include <memory> #include <memory>
SCT_AlignCondAlg::SCT_AlignCondAlg(const std::string& name, ISvcLocator* pSvcLocator) SCT_AlignCondAlg::SCT_AlignCondAlg(const std::string& name, ISvcLocator* pSvcLocator)
: ::AthReentrantAlgorithm(name, pSvcLocator) : ::AthAlgorithm(name, pSvcLocator)
, m_writeKey{"SCTAlignmentStore", "SCTAlignmentStore"} , m_writeKey{"SCTAlignmentStore", "SCTAlignmentStore"}
, m_DetManagerName("SCT") , m_DetManagerName("SCT")
{ {
...@@ -44,10 +44,11 @@ StatusCode SCT_AlignCondAlg::initialize() ...@@ -44,10 +44,11 @@ StatusCode SCT_AlignCondAlg::initialize()
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
} }
StatusCode SCT_AlignCondAlg::execute(const EventContext& ctx) const StatusCode SCT_AlignCondAlg::execute()
{ {
ATH_MSG_DEBUG("execute " << name()); ATH_MSG_DEBUG("execute " << name());
const EventContext& ctx = Gaudi::Hive::currentContext();
// ____________ Construct Write Cond Handle and check its validity ____________ // ____________ Construct Write Cond Handle and check its validity ____________
SG::WriteCondHandle<GeoAlignmentStore> writeHandle{m_writeKey, ctx}; SG::WriteCondHandle<GeoAlignmentStore> writeHandle{m_writeKey, ctx};
......
// -*- C++ -*- // -*- 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 #ifndef SCT_CONDITIONSALGORITHMS_SCT_ALIGNCONDALG_H
#define 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/ReadCondHandleKey.h"
#include "StoreGate/WriteCondHandleKey.h" #include "StoreGate/WriteCondHandleKey.h"
...@@ -36,14 +36,14 @@ namespace InDetDD { ...@@ -36,14 +36,14 @@ namespace InDetDD {
// However, we cannot give non-const pointer for SiDetectorElement // However, we cannot give non-const pointer for SiDetectorElement
// in SCT_DetectorManager in the above chain. // in SCT_DetectorManager in the above chain.
class SCT_AlignCondAlg : public AthReentrantAlgorithm class SCT_AlignCondAlg : public AthAlgorithm
{ {
public: public:
SCT_AlignCondAlg(const std::string& name, ISvcLocator* pSvcLocator); SCT_AlignCondAlg(const std::string& name, ISvcLocator* pSvcLocator);
virtual ~SCT_AlignCondAlg() override = default; virtual ~SCT_AlignCondAlg() override = default;
virtual StatusCode initialize() override; virtual StatusCode initialize() override;
virtual StatusCode execute(const EventContext& ctx) const override; virtual StatusCode execute() override;
virtual StatusCode finalize() override; virtual StatusCode finalize() override;
private: private:
......
/* /*
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() ...@@ -58,9 +58,10 @@ StatusCode TRTAlignCondAlg::execute()
{ {
ATH_MSG_DEBUG("execute " << name()); ATH_MSG_DEBUG("execute " << name());
const EventContext& ctx = Gaudi::Hive::currentContext();
// ____________ Construct Write Cond Handles and check their validity ____________ // ____________ Construct Write Cond Handles and check their validity ____________
SG::WriteCondHandle<GeoAlignmentStore> writeHandle{m_writeKeyAlignStore}; SG::WriteCondHandle<GeoAlignmentStore> writeHandle{m_writeKeyAlignStore,ctx};
SG::WriteCondHandle<InDetDD::TRT_DetElementContainer> writeHandleDetElCont{m_writeKeyDetElCont}; SG::WriteCondHandle<InDetDD::TRT_DetElementContainer> writeHandleDetElCont{m_writeKeyDetElCont,ctx};
if (writeHandleDetElCont.isValid()) { if (writeHandleDetElCont.isValid()) {
ATH_MSG_DEBUG("CondHandle " << writeHandleDetElCont.fullKey() << " is already valid." ATH_MSG_DEBUG("CondHandle " << writeHandleDetElCont.fullKey() << " is already valid."
...@@ -95,7 +96,7 @@ StatusCode TRTAlignCondAlg::execute() ...@@ -95,7 +96,7 @@ StatusCode TRTAlignCondAlg::execute()
// 1. Dynamic folders // 1. Dynamic folders
// ** Global // ** Global
SG::ReadCondHandle<CondAttrListCollection> readHandleDynamicGlobal{m_readKeyDynamicGlobal}; SG::ReadCondHandle<CondAttrListCollection> readHandleDynamicGlobal{m_readKeyDynamicGlobal,ctx};
// Get CDO and store it into container // Get CDO and store it into container
const CondAttrListCollection* readCdoDynamicGlobal{*readHandleDynamicGlobal}; const CondAttrListCollection* readCdoDynamicGlobal{*readHandleDynamicGlobal};
if(readCdoDynamicGlobal==nullptr) { if(readCdoDynamicGlobal==nullptr) {
...@@ -111,7 +112,7 @@ StatusCode TRTAlignCondAlg::execute() ...@@ -111,7 +112,7 @@ StatusCode TRTAlignCondAlg::execute()
} }
// ** Regular // ** Regular
SG::ReadCondHandle<AlignableTransformContainer> readHandleDynamicRegular{m_readKeyDynamicRegular}; SG::ReadCondHandle<AlignableTransformContainer> readHandleDynamicRegular{m_readKeyDynamicRegular,ctx};
// Get CDO and store it into container // Get CDO and store it into container
const AlignableTransformContainer* readCdoDynamicRegular{*readHandleDynamicRegular}; const AlignableTransformContainer* readCdoDynamicRegular{*readHandleDynamicRegular};
if(readCdoDynamicRegular==nullptr) { if(readCdoDynamicRegular==nullptr) {
...@@ -131,7 +132,7 @@ StatusCode TRTAlignCondAlg::execute() ...@@ -131,7 +132,7 @@ StatusCode TRTAlignCondAlg::execute()
} }
else { else {
// 2. Regular folder // 2. Regular folder
SG::ReadCondHandle<AlignableTransformContainer> readHandleRegular{m_readKeyRegular}; SG::ReadCondHandle<AlignableTransformContainer> readHandleRegular{m_readKeyRegular,ctx};
// Get CDO and store it into container // Get CDO and store it into container
const AlignableTransformContainer* readCdoRegular{*readHandleRegular}; const AlignableTransformContainer* readCdoRegular{*readHandleRegular};
if(readCdoRegular==nullptr) { if(readCdoRegular==nullptr) {
......
...@@ -28,15 +28,16 @@ StatusCode LArAlignCondAlg::initialize() ...@@ -28,15 +28,16 @@ StatusCode LArAlignCondAlg::initialize()
StatusCode LArAlignCondAlg::execute() StatusCode LArAlignCondAlg::execute()
{ {
const EventContext& ctx = Gaudi::Hive::currentContext();
// ____________ Construct Write Cond Handle and check its validity ____________ // ____________ Construct Write Cond Handle and check its validity ____________
SG::WriteCondHandle<GeoAlignmentStore> writeGeoAlignHandle{m_writeGeoAlignKey}; SG::WriteCondHandle<GeoAlignmentStore> writeGeoAlignHandle{m_writeGeoAlignKey,ctx};
if (writeGeoAlignHandle.isValid()) { if (writeGeoAlignHandle.isValid()) {
ATH_MSG_DEBUG("Found valid write handle"); ATH_MSG_DEBUG("Found valid write handle");
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
} }
// ____________ Get Read Cond Object ____________ // ____________ Get Read Cond Object ____________
SG::ReadCondHandle<DetCondKeyTrans> readLArAlignHandle{m_readLArAlignKey}; SG::ReadCondHandle<DetCondKeyTrans> readLArAlignHandle{m_readLArAlignKey,ctx};
ATH_CHECK(readLArAlignHandle.isValid()); ATH_CHECK(readLArAlignHandle.isValid());
ATH_MSG_DEBUG("Retrieved DetCondKeyTrans object form the Condition Store"); ATH_MSG_DEBUG("Retrieved DetCondKeyTrans object form the Condition Store");
writeGeoAlignHandle.addDependency(readLArAlignHandle); writeGeoAlignHandle.addDependency(readLArAlignHandle);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment