ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
Acts::PortalLinkBase Class Referenceabstract

PortalLinkBase is the abstract base class for all portal links. More...

#include <Acts/Geometry/PortalLinkBase.hpp>

Inheritance diagram for Acts::PortalLinkBase:
[legend]
Collaboration diagram for Acts::PortalLinkBase:
[legend]

Public Member Functions

virtual ~PortalLinkBase ()=default
 Virtual destructor in case the object is held as a derived.
virtual Result< const TrackingVolume * > resolveVolume (const GeometryContext &gctx, const Vector2 &position, double tolerance=s_onSurfaceTolerance) const =0
 Resolve a volume given a local position.
virtual Result< const TrackingVolume * > resolveVolume (const GeometryContext &gctx, const Vector3 &position, double tolerance=s_onSurfaceTolerance) const =0
 Resolve a volume given a global position.
void setSurface (std::shared_ptr< RegularSurface > surface)
 Setter for the surface.
const RegularSurfacesurface () const
 Getter for the associated surface.
const std::shared_ptr< RegularSurface > & surfacePtr () const
 Getter for the underlying shared pointer.
virtual void toStream (std::ostream &os) const =0
 Stream output function.

Static Public Member Functions

static std::unique_ptr< PortalLinkBasemerge (std::unique_ptr< PortalLinkBase > a, std::unique_ptr< PortalLinkBase > b, AxisDirection direction, const Logger &logger=getDummyLogger())
 Merge two portal link into a single one.

Protected Member Functions

 PortalLinkBase (std::shared_ptr< RegularSurface > surface)
 Constructor from a surface.

Static Protected Member Functions

static void checkMergePreconditions (const PortalLinkBase &a, const PortalLinkBase &b, AxisDirection direction)
 Helper function to check a number of preconditions before merging is executed.

Protected Attributes

std::shared_ptr< RegularSurfacem_surface
 Surface associated with this portal link.

Detailed Description

PortalLinkBase is the abstract base class for all portal links.

A portal link is a mapping between a surface and a point on the surface and a destination tracking volume. The derived classes implement different ways to resolve a volume

Constructor & Destructor Documentation

◆ PortalLinkBase()

Acts::PortalLinkBase::PortalLinkBase ( std::shared_ptr< RegularSurface > surface)
explicitprotected

Constructor from a surface.

This constructor is only called from derived classes

Parameters
surfaceThe surface

◆ ~PortalLinkBase()

virtual Acts::PortalLinkBase::~PortalLinkBase ( )
virtualdefault

Virtual destructor in case the object is held as a derived.

Member Function Documentation

◆ checkMergePreconditions()

void Acts::PortalLinkBase::checkMergePreconditions ( const PortalLinkBase & a,
const PortalLinkBase & b,
AxisDirection direction )
staticprotected

Helper function to check a number of preconditions before merging is executed.

Parameters
aThe first portal link
bThe second portal link
directionThe axis direction for merging

◆ merge()

std::unique_ptr< PortalLinkBase > Acts::PortalLinkBase::merge ( std::unique_ptr< PortalLinkBase > a,
std::unique_ptr< PortalLinkBase > b,
AxisDirection direction,
const Logger & logger = getDummyLogger() )
static

Merge two portal link into a single one.

The merge can resolve combinations of difference derived classes, and will try to flatten and deep merge given links if possible.

Parameters
aThe first portal link
bThe second portal link
directionThe binning direction in which to merge. Valid values are depend on the surface types associated with the links.
loggerThe logger to use for messages
Returns
The merged portal link

◆ resolveVolume() [1/2]

virtual Result< const TrackingVolume * > Acts::PortalLinkBase::resolveVolume ( const GeometryContext & gctx,
const Vector2 & position,
double tolerance = s_onSurfaceTolerance ) const
pure virtual

Resolve a volume given a local position.

The local position is assumed to be on surface.

Parameters
gctxThe geometry context
positionThe local position
toleranceThe tolerance for the lookup
Returns
The tracking volume or null if no connection was found

Implemented in Acts::CompositePortalLink, Acts::GridPortalLinkT< Axes >, and Acts::TrivialPortalLink.

◆ resolveVolume() [2/2]

virtual Result< const TrackingVolume * > Acts::PortalLinkBase::resolveVolume ( const GeometryContext & gctx,
const Vector3 & position,
double tolerance = s_onSurfaceTolerance ) const
pure virtual

Resolve a volume given a global position.

Depending on the derived class, the global position might be converted to a local position before lookup.

Parameters
gctxThe geometry context
positionThe global position
toleranceThe tolerance for the lookup
Returns
The tracking volume or null if no connection was found

Implemented in Acts::CompositePortalLink, Acts::GridPortalLinkT< Axes >, and Acts::TrivialPortalLink.

◆ setSurface()

void Acts::PortalLinkBase::setSurface ( std::shared_ptr< RegularSurface > surface)

Setter for the surface.

Parameters
surfaceThe surface

◆ surface()

const RegularSurface & Acts::PortalLinkBase::surface ( ) const

Getter for the associated surface.

Returns
The surface

◆ surfacePtr()

const std::shared_ptr< RegularSurface > & Acts::PortalLinkBase::surfacePtr ( ) const

Getter for the underlying shared pointer.

Returns
The shared pointer to the surface

◆ toStream()

virtual void Acts::PortalLinkBase::toStream ( std::ostream & os) const
pure virtual

Stream output function.

Parameters
osThe output stream

Implemented in Acts::CompositePortalLink, Acts::GridPortalLinkT< Axes >, and Acts::TrivialPortalLink.

Member Data Documentation

◆ m_surface

std::shared_ptr<RegularSurface> Acts::PortalLinkBase::m_surface
protected

Surface associated with this portal link.