2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
4#ifndef ActsGeoUtils_TransformCache_ICC
5#define ActsGeoUtils_TransformCache_ICC
7#include <CxxUtils/inline_hints.h>
11 inline const Amg::Transform3D&
12 TransformCacheBase::getTransform(const ActsTrk::DetectorAlignStore* alignStore) const {
13 /// Valid alignment store is given -> Take the transformation from the cache there
15 const Amg::Transform3D* cache = alignStore->trackingAlignment->getTransform(m_clientNo);
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();
24 /// Fall back solution to go onto the nominal cache
26 m_nomCache.set(std::make_unique<Amg::Transform3D>(fetchTransform(alignStore)));
30 inline IdentifierHash TransformCacheBase::hash() const { return m_hash; }
33 inline const Amg::Transform3D& TransformCacheBase::getTransform(const Acts::GeometryContext& anygctx) const {
34 const GeometryContext* gctx = anygctx.get<const GeometryContext*>();
35 // unpack the alignment store from the context
36 return getTransform(gctx->getStore(m_type).get());
42template<typename CachingDetectorEle>
43 TransformCacheDetEle<CachingDetectorEle>::TransformCacheDetEle(const IdentifierHash& hash,
44 const CachingDetectorEle* parentEle):
45 TransformCache{hash, parentEle->detectorType()},
46 m_parent{parentEle} {}
47template<typename CachingDetectorEle>
48 const IDetectorElement* TransformCacheDetEle<CachingDetectorEle>::parent() const {
51template <typename CachingDetectorEle>
52 Identifier TransformCacheDetEle<CachingDetectorEle>::identify() const {
53 return parent()->identify();