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 SG::ReadHandle<DetectorAlignStore> alignStore{key, ctx};
40 if (!alignStore.isValid()) {
41 ATH_MSG_FATAL("Failed to retrieve alignment from " << key.fullKey());
42 return StatusCode::FAILURE;
43 }
44 gctx->setStore(std::make_unique<DetectorAlignStore>(*alignStore));
45 }
46
47 // get a nominal alignment store from the tracking geometry service
48 // and plug it into a geometry context
49 ATH_CHECK(wch.record(std::move(gctx)));
50 ATH_MSG_DEBUG("Recorded new " << wch.key());
51
52 return StatusCode::SUCCESS;
53}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_FATAL(x)
#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 bool isValid() override final
Can the handle be successfully dereferenced?
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...