ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
ActsTrk::SurfaceCache Class Reference

: Helper class to connect the aligned transformations of each active sensor(layer) with the Acts::Surfaces. More...

#include <SurfaceCache.h>

Inheritance diagram for ActsTrk::SurfaceCache:
Collaboration diagram for ActsTrk::SurfaceCache:

Public Member Functions

 SurfaceCache (const TransformCache *transformCache)
 : Standard constructor taking the tranasform cache of the element and the detector type. More...
 
const Acts::Transform3 & transform (const Acts::GeometryContext &gctx) const override final
 Returns the transformation stored in the TransformCache. More...
 
const Acts::Surface & surface () const override final
 Returns the dereferenced pointer cache. More...
 
Acts::Surface & surface () override final
 
double thickness () const override final
 Dummy override to satisfy the interface of the Acts::DetElementBase. More...
 
void setSurface (const std::shared_ptr< Acts::Surface > surface)
 Cache the pointer to the surface that's constructed from this cache. More...
 
std::shared_ptr< Acts::Surface > getSurface () const
 Returns the pointer to the cached surface. More...
 
IdentifierHash hash () const
 Hash of the SurfaceCache which is the same as the one of the TransformCache. More...
 
Identifier identify () const override final
 Returns the identifier of the Surface. More...
 
DetectorType detectorType () const override final
 Returns the detector type. More...
 
const TransformCachetransformCache () const
 Returns the associated transform cache. More...
 

Private Attributes

const TransformCachem_transformCache {nullptr}
 
std::shared_ptr< Acts::Surface > m_surface {nullptr}
 

Detailed Description

: Helper class to connect the aligned transformations of each active sensor(layer) with the Acts::Surfaces.

It's actively used in the surface factories of the MuonReadoutElement. The SurfaceCache takes a pointer to the TransformCache managing the local to global transformation of the corresponding layer and the DetectorType. The latter is needed to pass the proper AlignmentStore from the Geometry context to the transform cache. Once constructed, the TransformCache is parsed to the surface construction mechanism of the Acts::Surface. The resulting shared_ptr is then parsed to the SurfaceCache.

Definition at line 23 of file Tracking/Acts/ActsGeoUtils/ActsGeoUtils/SurfaceCache.h.

Constructor & Destructor Documentation

◆ SurfaceCache()

ActsTrk::SurfaceCache::SurfaceCache ( const TransformCache transformCache)

: Standard constructor taking the tranasform cache of the element and the detector type.

Definition at line 12 of file SurfaceCache.cxx.

Member Function Documentation

◆ detectorType()

DetectorType ActsTrk::SurfaceCache::detectorType ( ) const
finaloverridevirtual

Returns the detector type.

Implements ActsTrk::IDetectorElementBase.

Definition at line 32 of file SurfaceCache.cxx.

32 { return m_transformCache->detectorType(); }

◆ getSurface()

std::shared_ptr< Acts::Surface > ActsTrk::SurfaceCache::getSurface ( ) const

Returns the pointer to the cached surface.

Definition at line 27 of file SurfaceCache.cxx.

27 { return m_surface; }

◆ hash()

IdentifierHash ActsTrk::SurfaceCache::hash ( ) const

Hash of the SurfaceCache which is the same as the one of the TransformCache.

Definition at line 30 of file SurfaceCache.cxx.

30 { return m_transformCache->hash(); }

◆ identify()

Identifier ActsTrk::SurfaceCache::identify ( ) const
finaloverridevirtual

Returns the identifier of the Surface.

Implements ActsTrk::IDetectorElementBase.

Definition at line 31 of file SurfaceCache.cxx.

31 { return m_transformCache->identify(); }

◆ setSurface()

void ActsTrk::SurfaceCache::setSurface ( const std::shared_ptr< Acts::Surface >  surface)

Cache the pointer to the surface that's constructed from this cache.

Definition at line 29 of file SurfaceCache.cxx.

29 { m_surface = surface; }

◆ surface() [1/2]

const Acts::Surface & ActsTrk::SurfaceCache::surface ( ) const
finaloverride

Returns the dereferenced pointer cache.

Definition at line 19 of file SurfaceCache.cxx.

19  {
20  if (!m_surface) THROW_EXCEPTION("Surface has not been set before");
21  return *m_surface;
22  }

◆ surface() [2/2]

Acts::Surface & ActsTrk::SurfaceCache::surface ( )
finaloverride

Definition at line 23 of file SurfaceCache.cxx.

23  {
24  if (!m_surface) THROW_EXCEPTION("Surface has not been set before");
25  return *m_surface;
26  }

◆ thickness()

double ActsTrk::SurfaceCache::thickness ( ) const
finaloverride

Dummy override to satisfy the interface of the Acts::DetElementBase.

Definition at line 28 of file SurfaceCache.cxx.

28 { return 0.; }

◆ transform()

const Acts::Transform3 & ActsTrk::SurfaceCache::transform ( const Acts::GeometryContext &  gctx) const
finaloverride

Returns the transformation stored in the TransformCache.

Definition at line 16 of file SurfaceCache.cxx.

16  {
17  return m_transformCache->transform(anygctx);
18  }

◆ transformCache()

const TransformCache * ActsTrk::SurfaceCache::transformCache ( ) const

Returns the associated transform cache.

Definition at line 15 of file SurfaceCache.cxx.

15 { return m_transformCache; }

Member Data Documentation

◆ m_surface

std::shared_ptr<Acts::Surface> ActsTrk::SurfaceCache::m_surface {nullptr}
private

◆ m_transformCache

const TransformCache* ActsTrk::SurfaceCache::m_transformCache {nullptr}
private

The documentation for this class was generated from the following files:
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::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::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::TransformCache::detectorType
DetectorType detectorType() const
returns the detector type of the cache
Definition: TransformCache.cxx:23
ActsTrk::TransformCache::transform
const Amg::Transform3D & transform(const Acts::GeometryContext &gctx) const
returns the cached transform from the Acts Geometry context