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
12
13// Forward declaration
14namespace Acts {
15 class Surface;
16}
17namespace ActsTrk{
18 class SurfacePlacement;
19}
20
21
22namespace ActsTrk {
23 /*** @brief The AlignableGeoPositioning manages the alignable transform handling of a surface from the
24 * readout geometry, of a volume portal surface or of a volume. If the transform belongs to
25 * a surface, it always represents the transform from the local surface frame to the global
26 * ATLAS frame. In the case of volumes, both directions are possible.
27 *
28 * The cache usually interacts with the @ref DetectorAlignStore to forward the aligned
29 * transform to the requesting client. In case that there is no @DetectorAlignStore passed
30 * the class also holds an internal cache for a transform which is lazily populated with the
31 * nominal transform if needed, but also immediatley deleted as soon as a new DetectorAlignStore
32 * instance is shown to the class. If the refernce to the cached transform is queried via
33 *
34 * const Amg::Isometry3D& getTransform(const DetectorAlignStore* store) const;
35 *
36 * it is checked whether the (internal) store already hold the transform. If not, the asembly
37 * of the transform is queried via calling
38 *
39 * Amg::Transform3D fetchTransform(const DetectorAlignStore* store) const
40 *
41 * which is a pure interface function and needs to be implemented downstream */
43 public:
49 explicit AlignableGeoPositioning(const IdentifierHash& cacheHash,
50 const DetectorType type);
52 AlignableGeoPositioning(const AlignableGeoPositioning& other) noexcept = delete;
71 const Amg::Isometry3D& getTransform(const GeometryContext& gctx) const;
76 bool storeTransform(DetectorAlignStore& store) const;
77#ifndef SIMULATIONBASE
81 const Amg::Isometry3D& getTransform(const Acts::GeometryContext& tgContext) const;
82#endif
84 virtual void releaseNominalCache() const;
87 protected:
91 virtual Amg::Transform3D fetchTransform(const DetectorAlignStore* store) const = 0;
92 private:
103 };
104
105
115 public:
121 virtual Identifier identify() const = 0;
123 virtual const IDetectorElement* parent() const = 0;
125 virtual void releaseNominalCache() const final;
126
127 #ifndef SIMULATIONBASE
128 friend class SurfacePlacement;
130 const SurfacePlacement* placement() const;
131 private:
133 std::shared_ptr<Acts::Surface> m_surface{};
135 std::shared_ptr<SurfacePlacement> m_placement{};
136 #endif
137
138 };
139
158 template<typename CachingDetectorEle>
160 public:
165 const CachingDetectorEle* parentEle);
167 const CachingDetectorEle* parent() const override final;
169 Identifier identify() const override final;
170 private:
173 const CachingDetectorEle* m_parent{nullptr};
174 };
175
176}
178#endif
Cached unique_ptr with atomic update.
Eigen::Affine3d Transform3D
const Amg::Isometry3D & getTransform(const GeometryContext &gctx) const
returns the cached transform from the Acts Geometry context
detail::TrfStoreTicketCounter TicketCounter
virtual ~AlignableGeoPositioning()
Default destructors.
const unsigned int m_clientNo
Slot at which the aligned transforms can be put in the external DetectorAlignStore.
CxxUtils::CachedUniquePtrT< Amg::Isometry3D > m_nomCache ATLAS_THREAD_SAFE
Cache to hold the nominal transform, if no DetectorAlignStore is provided The cache is automatically ...
IdentifierHash hash() const
Returns the sensor hash of this transformation cache.
AlignableGeoPositioning(AlignableGeoPositioning &&other) noexcept=delete
Delete the move constructor.
const Amg::Isometry3D & getTransform(const Acts::GeometryContext &tgContext) const
returns the cached transform from the Acts Geometry context
virtual void releaseNominalCache() const
resets the nominal cache associated with the detector element
DetectorType detectorType() const
returns the detector type of the cache
bool storeTransform(DetectorAlignStore &store) const
Store the final transform in the mutable alignment store.
const Amg::Isometry3D & getTransform(const DetectorAlignStore *store) const
Returns the matching transformation from the alignment store.
AlignableGeoPositioning(const AlignableGeoPositioning &other) noexcept=delete
Delete the copy constructor.
AlignableGeoPositioning & operator=(const AlignableGeoPositioning &other) noexcept=delete
Delete the copy assignment operator.
virtual Amg::Transform3D fetchTransform(const DetectorAlignStore *store) const =0
Assembles the transform from the readout geometry.
AlignableGeoPositioning(const IdentifierHash &cacheHash, const DetectorType type)
Standard constrcutor.
AlignableGeoPositioning & operator=(AlignableGeoPositioning &other) noexcept=delete
Delete the move assignment operator.
ATLAS interface of a detector element.
Interface extension for caches used to hold the transforms of surfaces from the readout geometry.
virtual ~IReadoutSurfacePositioning()
Destructor.
const SurfacePlacement * placement() const
Returns the pointer to the associated surface placement.
std::shared_ptr< SurfacePlacement > m_placement
Holder of the surface placement pointer.
std::shared_ptr< Acts::Surface > m_surface
Holder of the surface owned by the surface placement.
virtual Identifier identify() const =0
Returns the Identifier of the.
AlignableGeoPositioning(const IdentifierHash &cacheHash, const DetectorType type)
Copy the constructors from the base class.
virtual void releaseNominalCache() const final
Release the nominal transform stored in the cache.
virtual const IDetectorElement * parent() const =0
Returns the parent IDetectorElement owning the cache.
ReadoutSurfacePositioning(const IdentifierHash &hash, const CachingDetectorEle *parentEle)
: Standard constructor taking the hash of the sensor element and and the TransformMaker expressed usu...
const CachingDetectorEle * parent() const override final
Returns the parent IDetectorElement owning the cache.
Identifier identify() const override final
Returns the Identifier of the.
Amg::Transform3D fetchTransform(const DetectorAlignStore *store) const override final
Assembles the transform from the readout geometry.
const CachingDetectorEle * m_parent
: Helper class to assign a @ActsSurfacePlacementBase to the Acts::Surfaces in order to make them alig...
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::Isometry3d Isometry3D
Eigen::Affine3d Transform3D
#define private
Definition testRead.cxx:27