ATLAS Offline Software
Loading...
Searching...
No Matches
TransformCache.h
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_H
5#define ActsGeoUtils_TransformCache_H
6
7#include <shared_mutex>
8#include <type_traits>
9#include <ActsGeoUtils/Defs.h>
13
14namespace ActsTrk {
15 /*** @brief: The TransformCache holds the local -> global transformations associated with a tracking surface
16 * from the Readout geometry. The cache establishes the connection with the GeometryContext or more
17 * precisely with its DetectorAlignStore to provide the transformations of an aligned surface.
18 * As soon as the alignment store is accessed, the nominal surface is released from memory.
19 * In order to be used for each detector technology, the virtual <fetchTransform> needs to
20 * be defined further downstream. The method is called everytime when a new cache is invoked. */
22 public:
23 TransformCacheBase(const IdentifierHash& cacheHash,
24 const DetectorType type);
26 TransformCacheBase(const TransformCacheBase& other) noexcept = delete;
28 TransformCacheBase& operator=(const TransformCacheBase& other) noexcept = delete;
30 TransformCacheBase(TransformCacheBase&& other) noexcept = delete;
34 virtual ~TransformCacheBase();
47 bool storeTransform(DetectorAlignStore& store) const;
48#ifndef SIMULATIONBASE
50 const Amg::Transform3D& getTransform(const Acts::GeometryContext& gctx) const;
51#endif
53 virtual void releaseNominalCache() const;
56 protected:
57 virtual Amg::Transform3D fetchTransform(const DetectorAlignStore* store) const = 0;
58 private:
64 };
65
66
69 public:
73 virtual Identifier identify() const = 0;
75 virtual const IDetectorElement* parent() const = 0;
78 virtual void releaseNominalCache() const final;
79 };
80
81 template<typename CachingDetectorEle>
83 public:
88 const CachingDetectorEle* parentEle);
89
90 const IDetectorElement* parent() const override final;
91 Identifier identify() const override final;
92 private:
94 const CachingDetectorEle* m_parent{nullptr};
95 };
96
97}
99#endif
Cached unique_ptr with atomic update.
Eigen::Affine3d Transform3D
Base class interface for the actual readout elements.
TransformCacheBase(const IdentifierHash &cacheHash, const DetectorType type)
const DetectorType m_type
TransformCacheBase & operator=(TransformCacheBase &other) noexcept=delete
Delete the move assignment operator.
CxxUtils::CachedUniquePtrT< Amg::Transform3D > m_nomCache ATLAS_THREAD_SAFE
bool storeTransform(DetectorAlignStore &store) const
Store the final transform in the mutable alignment store.
IdentifierHash hash() const
Returns the sensor hash of this transformation cache.
TransformCacheBase(TransformCacheBase &&other) noexcept=delete
Delete the move constructor.
virtual void releaseNominalCache() const
resets the nominal cache associated with the detector element
const Amg::Transform3D & getTransform(const DetectorAlignStore *store) const
Returns the matching transformation from the alignment store.
const unsigned int m_clientNo
TransformCacheBase & operator=(const TransformCacheBase &other) noexcept=delete
Delete the copy assignment operator.
const Amg::Transform3D & getTransform(const Acts::GeometryContext &gctx) const
returns the cached transform from the Acts Geometry context
detail::TrfStoreTicketCounter TicketCounter
virtual ~TransformCacheBase()
Default destructors.
DetectorType detectorType() const
returns the detector type of the cache
virtual Amg::Transform3D fetchTransform(const DetectorAlignStore *store) const =0
TransformCacheBase(const TransformCacheBase &other) noexcept=delete
Delete the copy constructor.
const IdentifierHash m_hash
const CachingDetectorEle * m_parent
TransformCacheDetEle(const IdentifierHash &hash, const CachingDetectorEle *parentEle)
: Standard constructor taking the hash of the sensor element and and the TransformMaker expressed usu...
Amg::Transform3D fetchTransform(const DetectorAlignStore *store) const override final
const IDetectorElement * parent() const override final
Returns the parent IDetectorElement owning the cache.
Identifier identify() const override final
Returns the Identifier of the transform cache.
Implementation used for the Detector elements.
TransformCacheBase(const IdentifierHash &cacheHash, const DetectorType type)
Copy the constructors from the base class.
virtual Identifier identify() const =0
Returns the Identifier of the transform cache.
virtual void releaseNominalCache() const final
Release the nominal cache and release the transform from the.
virtual const IDetectorElement * parent() const =0
Returns the parent IDetectorElement owning the cache.
In order that the TransformStore is able to provide enough memory to store the transform centrally,...
static unsigned int drawTicket(const DetectorType detType)
Returns a unique ID to the client under which the client can store its transfomrm inside the containe...
Cached pointer with atomic update.
This is a "hash" representation of an Identifier.
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
DetectorType
Simple enum to Identify the Type of the ACTS sub detector.
@ UnDefined
Small Thing Gap chambers (NSW).
Definition of ATLAS Math & Geometry primitives (Amg).
Eigen::Affine3d Transform3D
#define private