ATLAS Offline Software
Loading...
Searching...
No Matches
GeometryContextAlg.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7// PACKAGE
9
10// ATHENA
14
16
17
18using namespace ActsTrk;
19
21
23 ATH_MSG_DEBUG("initialize " << name());
24 ATH_CHECK(m_alignStoreKeys.initialize());
25 ATH_CHECK(m_wchk.initialize());
26 return StatusCode::SUCCESS;
27}
28
29StatusCode GeometryContextAlg::execute(const EventContext& ctx) const {
30 ATH_MSG_DEBUG("execute " << name());
31
32 SG::WriteHandle wch{m_wchk, ctx};
33
34 // create an Acts aware geo alignment store from the one given
35 // (this makes a copy for now, which is not ideal)
36 auto gctx = std::make_unique<GeometryContext>();
37
39 const DetectorAlignStore* alignStore{nullptr};
40 ATH_CHECK(SG::get(alignStore,key, ctx));
41 gctx->setStore(std::make_unique<DetectorAlignStore>(*alignStore));
42 }
43
44 // get a nominal alignment store from the tracking geometry service
45 // and plug it into a geometry context
46 ATH_CHECK(wch.record(std::move(gctx)));
47 ATH_MSG_DEBUG("Recorded new " << wch.key());
48
49 return StatusCode::SUCCESS;
50}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)
Handle class for reading from StoreGate.
Handle class for recording to StoreGate.
StatusCode initialize() override
SG::WriteHandleKey< GeometryContext > m_wchk
SG::ReadHandleKeyArray< DetectorAlignStore > m_alignStoreKeys
StatusCode execute(const EventContext &ctx) const override
Property holding a SG store/key/clid from which a ReadHandle is made.
virtual const std::string & key() const override final
Return the StoreGate ID for the referenced object.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.