ATLAS Offline Software
Loading...
Searching...
No Matches
TransformCache.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 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 TransformCache(const IdentifierHash& cacheHash,
24 const DetectorType type);
25
26 TransformCache(const TransformCache& other) = delete;
27 TransformCache& operator=(const TransformCache& other) = delete;
28
29 virtual ~TransformCache();
30
31
33 virtual Identifier identify() const = 0;
37 virtual const IDetectorElement* parent() const = 0;
38
45
46#ifndef SIMULATIONBASE
48 const Amg::Transform3D& transform(const Acts::GeometryContext& gctx) const;
49#endif
51 void releaseNominalCache() const;
54 protected:
55 virtual Amg::Transform3D fetchTransform(const DetectorAlignStore* store) const = 0;
56 private:
61 mutable std::shared_mutex m_mutex ATLAS_THREAD_SAFE{};
63 };
64
65
66
67 template<typename CachingDetectorEle>
69 public:
74 const CachingDetectorEle* parentEle);
75
76 const IDetectorElement* parent() const override final;
77 Identifier identify() const override final;
78 private:
80 const CachingDetectorEle* m_parent{nullptr};
81 };
82
83}
85#endif
Cached unique_ptr with atomic update.
Eigen::Affine3d Transform3D
Store holding the transfomations used by the Acts algorithms.
static unsigned int drawTicket(const DetectorType detType)
Returns a unique ID to the client under which the client can store its transformation inside the cont...
Base class interface for the actual readout elements.
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.
std::shared_mutex m_mutex ATLAS_THREAD_SAFE
DetectorType detectorType() const
returns the detector type of the cache
IdentifierHash hash() const
Returns the sensor hash of this transformation cache.
const DetectorType m_type
TransformCache(const TransformCache &other)=delete
DetectorAlignStore::TrackingAlignStore TicketCounter
TransformCache & operator=(const TransformCache &other)=delete
const IdentifierHash m_hash
virtual Identifier identify() const =0
Returns the Identifier of the transform cache.
TransformCache(const IdentifierHash &cacheHash, const DetectorType type)
const Amg::Transform3D & getTransform(const DetectorAlignStore *store) const
Returns the matching transformation from the alignment store.
const unsigned int m_clientNo
void releaseNominalCache() const
resets the nominal cache associated with the detector element
virtual Amg::Transform3D fetchTransform(const DetectorAlignStore *store) const =0
const Amg::Transform3D & transform(const Acts::GeometryContext &gctx) const
returns the cached transform from the Acts Geometry context
virtual const IDetectorElement * parent() const =0
Returns the parent IDetectorElement owning the cache.
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