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::Transform3D& 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;
76 bool storeTransform(DetectorAlignStore& store) const;
77#ifndef SIMULATIONBASE
81 const Amg::Transform3D& getTransform(const Acts::GeometryContext& tgContext) const;
82#endif
84 virtual void releaseNominalCache() const;
87 protected:
88 virtual Amg::Transform3D fetchTransform(const DetectorAlignStore* store) const = 0;
89 private:
100 };
101
102
112 public:
118 virtual Identifier identify() const = 0;
120 virtual const IDetectorElement* parent() const = 0;
122 virtual void releaseNominalCache() const final;
123
124 #ifndef SIMULATIONBASE
125 friend class SurfacePlacement;
127 const SurfacePlacement* placement() const;
128 private:
130 std::shared_ptr<Acts::Surface> m_surface{};
132 std::shared_ptr<SurfacePlacement> m_placement{};
133 #endif
134
135 };
136
155 template<typename CachingDetectorEle>
157 public:
162 const CachingDetectorEle* parentEle);
164 const CachingDetectorEle* parent() const override final;
166 Identifier identify() const override final;
167 private:
170 const CachingDetectorEle* m_parent{nullptr};
171 };
172
173}
175#endif
Cached unique_ptr with atomic update.
Eigen::Affine3d Transform3D
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.
const Amg::Transform3D & getTransform(const DetectorAlignStore *store) const
Returns the matching transformation from the alignment store.
const Amg::Transform3D & getTransform(const GeometryContext &gctx) const
returns the cached transform from the Acts Geometry context
IdentifierHash hash() const
Returns the sensor hash of this transformation cache.
AlignableGeoPositioning(AlignableGeoPositioning &&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 Acts::GeometryContext &tgContext) const
returns the cached transform from the Acts Geometry context
DetectorType detectorType() const
returns the detector type of the cache
bool storeTransform(DetectorAlignStore &store) const
Store the final transform in the mutable 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
AlignableGeoPositioning(const IdentifierHash &cacheHash, const DetectorType type)
Standard constrcutor.
AlignableGeoPositioning & operator=(AlignableGeoPositioning &other) noexcept=delete
Delete the move assignment operator.
CxxUtils::CachedUniquePtrT< Amg::Transform3D > m_nomCache ATLAS_THREAD_SAFE
Cache to hold the nominal transform, if no DetectorAlignStore is provided The cache is automatically ...
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
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::Affine3d Transform3D
#define private
Definition testRead.cxx:27