ATLAS Offline Software
Loading...
Searching...
No Matches
TransformCache.icc
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4#ifndef ActsGeoUtils_TransformCache_ICC
5#define ActsGeoUtils_TransformCache_ICC
6
7#include <CxxUtils/inline_hints.h>
8
9namespace ActsTrk {
10 ATH_FLATTEN
11 inline const Amg::Transform3D&
12 AlignableGeoPositioning::getTransform(const ActsTrk::DetectorAlignStore* alignStore) const {
13 /// Valid alignment store is given -> Take the transformation from the cache there
14 if (alignStore) {
15 const Amg::Transform3D* cache = alignStore->trackingAlignment->getTransform(m_clientNo);
16 if (cache) {
17 return *cache;
18 }
19 const Amg::Transform3D& trf{alignStore->trackingAlignment->setTransform(m_clientNo, fetchTransform(alignStore))};
20 /// If an external alignment store is presented release the nominal transformation
21 releaseNominalCache();
22 return trf;
23 }
24 /// Fall back solution to go onto the nominal cache
25 if (!m_nomCache) {
26 m_nomCache.set(std::make_unique<Amg::Transform3D>(fetchTransform(alignStore)));
27 }
28 return (*m_nomCache);
29 }
30 inline IdentifierHash AlignableGeoPositioning::hash() const { return m_hash; }
31#ifndef SIMULATIONBASE
32 ATH_FLATTEN
33 inline const Amg::Transform3D& AlignableGeoPositioning::getTransform(const Acts::GeometryContext& tgContext) const {
34 const GeometryContext* gctx = tgContext.get<const GeometryContext*>();
35 // unpack the alignment store from the context
36 return getTransform(gctx->getStore(m_type).get());
37 }
38 ATH_FLATTEN
39 inline const Amg::Transform3D& AlignableGeoPositioning::getTransform(const GeometryContext& gctx) const {
40 return getTransform(gctx.getStore(m_type).get());
41 }
42#endif
43
44
45template<typename CachingDetectorEle>
46 ReadoutSurfacePositioning<CachingDetectorEle>::ReadoutSurfacePositioning(const IdentifierHash& hash,
47 const CachingDetectorEle* parentEle):
48 IReadoutSurfacePositioning{hash, parentEle->detectorType()},
49 m_parent{parentEle} {}
50template<typename CachingDetectorEle>
51 const CachingDetectorEle* ReadoutSurfacePositioning<CachingDetectorEle>::parent() const {
52 return m_parent;
53 }
54template <typename CachingDetectorEle>
55 Identifier ReadoutSurfacePositioning<CachingDetectorEle>::identify() const {
56 return parent()->identify();
57 }
58}
59#endif