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 <GeoModelKernel/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; }
33 }
34 #endif
ActsTrk::SurfaceCache::m_transformCache
const TransformCache * m_transformCache
Definition: Tracking/Acts/ActsGeoUtils/ActsGeoUtils/SurfaceCache.h:55
ActsTrk::SurfaceCache::transformCache
const TransformCache * transformCache() const
Returns the associated transform cache.
Definition: SurfaceCache.cxx:15
ActsTrk::SurfaceCache::identify
Identifier identify() const override final
Returns the identifier of the Surface.
Definition: SurfaceCache.cxx:31
SurfaceCache.h
ActsTrk::DetectorType
DetectorType
Simple enum to Identify the Type of the ACTS sub detector.
Definition: GeometryDefs.h:17
ActsTrk::SurfaceCache::detectorType
DetectorType detectorType() const override final
Returns the detector type.
Definition: SurfaceCache.cxx:32
ActsTrk::TransformCache::identify
virtual Identifier identify() const =0
Returns the Identifier of the transform cache.
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:56
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::TransformCache::detectorType
DetectorType detectorType() const
returns the detector type of the cache
Definition: TransformCache.cxx:23
ActsTrk
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Definition: MuonDetectorBuilderTool.cxx:54
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
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
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
Identifier
Definition: IdentifierFieldParser.cxx:14