ATLAS Offline Software
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 
14 namespace 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 ActsGeometryContext 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 
28 
29  virtual ~TransformCache();
30 
34  virtual const IDetectorElement* parent() const = 0;
35 
42 
43 #ifndef SIMULATIONBASE
44 
45  const Amg::Transform3D& transform(const Acts::GeometryContext& gctx) const;
46 #endif
47 
48  void releaseNominalCache() const;
50  DetectorType detectorType() const;
51  protected:
53  private:
58  mutable std::shared_mutex m_mutex ATLAS_THREAD_SAFE{};
60  };
61 
62 
63 
64  template<typename CachingDetectorEle>
66  public:
71  const CachingDetectorEle* parentEle);
72 
73  const IDetectorElement* parent() const override final;
74  private:
76  const CachingDetectorEle* m_parent{nullptr};
77  };
78 
79 }
81 #endif
ActsTrk::TransformCache::ATLAS_THREAD_SAFE
std::shared_mutex m_mutex ATLAS_THREAD_SAFE
Definition: TransformCache.h:58
store
StoreGateSvc * store
Definition: fbtTestBasics.cxx:69
ActsTrk::DetectorType
DetectorType
Simple enum to Identify the Type of the ACTS sub detector.
Definition: GeometryDefs.h:17
ActsTrk::DetectorAlignStore::TrackingAlignStore
Store holding the transfomations used by the Acts algorithms.
Definition: DetectorAlignStore.h:33
ActsTrk::TransformCache::parent
virtual const IDetectorElement * parent() const =0
Returns the parent IDetectorElement owning the cache.
ActsTrk::DetectorAlignStore
Definition: DetectorAlignStore.h:20
ActsTrk::TransformCache::operator=
TransformCache & operator=(const TransformCache &other)=delete
CxxUtils::CachedUniquePtrT< Amg::Transform3D >
ActsTrk::DetectorType::UnDefined
@ UnDefined
Small Thing Gap chambers (NSW)
ActsTrk::TransformCacheDetEle
Definition: TransformCache.h:65
ActsTrk::TransformCache::releaseNominalCache
void releaseNominalCache() const
resets the nominal cache associated with the detector element
Definition: TransformCache.cxx:17
ActsTrk::TransformCache::~TransformCache
virtual ~TransformCache()
Definition: TransformCache.cxx:9
ActsTrk::TransformCacheDetEle::parent
const IDetectorElement * parent() const override final
Returns the parent IDetectorElement owning the cache.
TransformCache.icc
ActsTrk::TransformCacheDetEle::m_parent
const CachingDetectorEle * m_parent
Definition: TransformCache.h:76
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:562
ActsTrk::TransformCache::fetchTransform
virtual Amg::Transform3D fetchTransform(const DetectorAlignStore *store) const =0
ActsTrk::TransformCache::TransformCache
TransformCache(const TransformCache &other)=delete
Defs.h
ActsTrk::TransformCache::m_clientNo
const unsigned int m_clientNo
Definition: TransformCache.h:57
ActsTrk::TransformCache::m_type
const DetectorType m_type
Definition: TransformCache.h:55
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
CachedUniquePtr.h
Cached unique_ptr with atomic update.
ActsTrk::TransformCacheDetEle::TransformCacheDetEle
TransformCacheDetEle(const IdentifierHash &hash, const CachingDetectorEle *parentEle)
: Standard constructor taking the hash of the sensor element and and the TransformMaker expressed usu...
ActsTrk::IDetectorElement
Definition: IDetectorElement.h:28
ActsTrk::TransformCache::hash
IdentifierHash hash() const
Returns the sensor hash of this transformation cache.
ActsTrk::DetectorAlignStore::TrackingAlignStore::drawTicket
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...
Definition: DetectorAlignStore.cxx:24
ActsTrk::TransformCache::TransformCache
TransformCache(const IdentifierHash &cacheHash, const DetectorType type)
Definition: TransformCache.cxx:12
Amg
Definition of ATLAS Math & Geometry primitives (Amg)
Definition: AmgStringHelpers.h:19
private
#define private
Definition: DetDescrConditionsDict_dict_fixes.cxx:13
IdentifierHash.h
ActsTrk::TransformCache::getTransform
const Amg::Transform3D & getTransform(const DetectorAlignStore *store) const
Returns the matching transformation from the alignment store.
ActsTrk::TransformCache::m_hash
const IdentifierHash m_hash
Definition: TransformCache.h:54
ActsTrk::TransformCache::detectorType
DetectorType detectorType() const
returns the detector type of the cache
Definition: TransformCache.cxx:23
ActsTrk::TransformCacheDetEle::fetchTransform
Amg::Transform3D fetchTransform(const DetectorAlignStore *store) const override final
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
IDetectorElement.h
ActsTrk
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Definition: MuonDetectorBuilderTool.cxx:34
IdentifierHash
Definition: IdentifierHash.h:38
ActsTrk::TransformCache
Definition: TransformCache.h:21
ActsTrk::TransformCache::transform
const Amg::Transform3D & transform(const Acts::GeometryContext &gctx) const
returns the cached transform from the Acts Geometry context