ATLAS Offline Software
SurfaceCache.cxx
Go to the documentation of this file.
1 
2 /*
3  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
4 */
6 #ifndef SIMULATIONBASE
7 #include <Acts/Surfaces/Surface.hpp>
8 #include <GeoModelHelpers/throwExcept.h>
9 
10 namespace ActsTrk{
11 
12  SurfaceCache::SurfaceCache(const TransformCache* transformCache):
13  m_transformCache{transformCache}{}
14 
16  const Acts::Transform3& SurfaceCache::transform(const Acts::GeometryContext& anygctx) const {
17  return m_transformCache->transform(anygctx);
18  }
19  const Acts::Surface& SurfaceCache::surface() const {
20  if (!m_surface) THROW_EXCEPTION("Surface has not been set before");
21  return *m_surface;
22  }
23  Acts::Surface& SurfaceCache::surface() {
24  if (!m_surface) THROW_EXCEPTION("Surface has not been set before");
25  return *m_surface;
26  }
27  std::shared_ptr<Acts::Surface> SurfaceCache::getSurface() const { return m_surface; }
28  double SurfaceCache::thickness() const { return 0.; }
29  void SurfaceCache::setSurface(std::shared_ptr<Acts::Surface> surface) { m_surface = surface; }
31 }
32 #endif
ActsTrk::SurfaceCache::m_transformCache
const TransformCache * m_transformCache
Definition: Tracking/Acts/ActsGeoUtils/ActsGeoUtils/SurfaceCache.h:52
ActsTrk::SurfaceCache::transformCache
const TransformCache * transformCache() const
Returns the associated transform cache.
Definition: SurfaceCache.cxx:15
SurfaceCache.h
THROW_EXCEPTION
#define THROW_EXCEPTION(MSG)
Definition: MMReadoutElement.cxx:48
ActsTrk::SurfaceCache::setSurface
void setSurface(const std::shared_ptr< Acts::Surface > surface)
Cache the pointer to the surface that's constructed from this cache.
Definition: SurfaceCache.cxx:29
ActsTrk::SurfaceCache::m_surface
std::shared_ptr< Acts::Surface > m_surface
Definition: Tracking/Acts/ActsGeoUtils/ActsGeoUtils/SurfaceCache.h:53
ActsTrk::SurfaceCache::surface
const Acts::Surface & surface() const override final
Returns the dereferenced pointer cache.
Definition: SurfaceCache.cxx:19
ActsTrk::TransformCache::hash
IdentifierHash hash() const
Returns the sensor hash of this transformation cache.
ActsTrk::SurfaceCache::SurfaceCache
SurfaceCache(const TransformCache *transformCache)
: Standard constructor taking the tranasform cache of the element and the detector type.
Definition: SurfaceCache.cxx:12
ActsTrk::SurfaceCache::hash
IdentifierHash hash() const
Hash of the SurfaceCache which is the same as the one of the TransformCache.
Definition: SurfaceCache.cxx:30
ActsTrk::SurfaceCache::getSurface
std::shared_ptr< Acts::Surface > getSurface() const
Returns the pointer to the cached surface.
Definition: SurfaceCache.cxx:27
ActsTrk::SurfaceCache::thickness
double thickness() const override final
Dummy override to satisfy the interface of the Acts::DetElementBase.
Definition: SurfaceCache.cxx:28
ActsTrk
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Definition: MuonDetectorBuilderTool.cxx:34
ActsTrk::SurfaceCache::transform
const Acts::Transform3 & transform(const Acts::GeometryContext &gctx) const override final
Returns the transformation stored in the TransformCache.
Definition: SurfaceCache.cxx:16
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