ATLAS Offline Software
Loading...
Searching...
No Matches
Tracking
Acts
ActsAlignmentAlgs
src
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
5
#include "
GeometryContextAlg.h
"
6
7
// PACKAGE
8
#include "
ActsGeometryInterfaces/GeometryContext.h
"
9
10
// ATHENA
11
#include "
AthenaKernel/IOVInfiniteRange.h
"
12
#include "
StoreGate/ReadHandle.h
"
13
#include "
StoreGate/WriteHandle.h
"
14
15
#include "
StoreGate/WriteCondHandle.h
"
16
17
18
using namespace
ActsTrk
;
19
20
GeometryContextAlg::~GeometryContextAlg
() =
default
;
21
22
StatusCode
GeometryContextAlg::initialize
() {
23
ATH_MSG_DEBUG
(
"initialize "
<< name());
24
ATH_CHECK
(
m_alignStoreKeys
.initialize());
25
ATH_CHECK
(
m_wchk
.initialize());
26
return
StatusCode::SUCCESS;
27
}
28
29
StatusCode
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
38
for
(
const
SG::ReadHandleKey<DetectorAlignStore>
& key :
m_alignStoreKeys
) {
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
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition
AthMsgStreamMacros.h:34
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
GeometryContextAlg.h
GeometryContext.h
IOVInfiniteRange.h
ReadHandle.h
Handle class for reading from StoreGate.
WriteHandle.h
Handle class for recording to StoreGate.
WriteCondHandle.h
ActsTrk::GeometryContextAlg::initialize
StatusCode initialize() override
Definition
GeometryContextAlg.cxx:22
ActsTrk::GeometryContextAlg::m_wchk
SG::WriteHandleKey< GeometryContext > m_wchk
Definition
GeometryContextAlg.h:30
ActsTrk::GeometryContextAlg::~GeometryContextAlg
virtual ~GeometryContextAlg()
ActsTrk::GeometryContextAlg::m_alignStoreKeys
SG::ReadHandleKeyArray< DetectorAlignStore > m_alignStoreKeys
Definition
GeometryContextAlg.h:28
ActsTrk::GeometryContextAlg::execute
StatusCode execute(const EventContext &ctx) const override
Definition
GeometryContextAlg.cxx:29
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition
StoreGate/StoreGate/ReadHandleKey.h:40
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
SG::VarHandleBase::key
virtual const std::string & key() const override final
Return the StoreGate ID for the referenced object.
Definition
AthToolSupport/AsgDataHandles/Root/VarHandleBase.cxx:64
SG::WriteHandle
Definition
StoreGate/StoreGate/WriteHandle.h:73
SG::WriteHandle::record
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
ActsTrk
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Definition
MdtCalibInput.h:31
Generated on
for ATLAS Offline Software by
1.14.0