ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
Acts::CompositePortalLink Class Referencefinal

Composite portal links can graft together other portal link instances, for example grids that could not be merged due to invalid binnings. More...

#include <Acts/Geometry/CompositePortalLink.hpp>

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

Public Types

using PortalLinkRange
 Type alias for range of portal links with const dereferencing transform.

Public Member Functions

 CompositePortalLink (std::unique_ptr< PortalLinkBase > a, std::unique_ptr< PortalLinkBase > b, AxisDirection direction, bool flatten=true)
 Construct a composite portal from two arbitrary other portal links.
 CompositePortalLink (std::vector< std::unique_ptr< PortalLinkBase > > links, AxisDirection direction, bool flatten=true)
 Construct a composite portal from any number of arbitrary other portal links.
std::size_t depth () const
 Get the depth of the composite tree.
PortalLinkRange links () const
 Get the range of children.
std::unique_ptr< GridPortalLinkmakeGrid (const GeometryContext &gctx, const Logger &logger) const
 (Potentially) create a grid portal link that represents this composite portal link.
Result< const TrackingVolume * > resolveVolume (const GeometryContext &gctx, const Vector2 &position, double tolerance=s_onSurfaceTolerance) const override
 Resolve the volume for a 2D position.
Result< const TrackingVolume * > resolveVolume (const GeometryContext &gctx, const Vector3 &position, double tolerance=s_onSurfaceTolerance) const override
 Resolve the volume for a 3D position.
std::size_t size () const
 Get the number of children.
void toStream (std::ostream &os) const override
 Print the composite portal link.

Additional Inherited Members

Detailed Description

Composite portal links can graft together other portal link instances, for example grids that could not be merged due to invalid binnings.

+-------+ +-------+
| | | |
| | | |
| | | |
+-------+ | |
| | | |
| | + +-------+
| | | |
+-------+ | |
| | | |
| | +-------+
| | | |
+-------+ +-------+

During resolution, it will consult each of it's children and return the result on the first surface where the lookup position is within bounds.

Member Typedef Documentation

◆ PortalLinkRange

Initial value:
detail::TransformRange<
detail::ConstDereference,
const boost::container::small_vector<std::unique_ptr<PortalLinkBase>, 4>>

Type alias for range of portal links with const dereferencing transform.

Constructor & Destructor Documentation

◆ CompositePortalLink() [1/2]

Acts::CompositePortalLink::CompositePortalLink ( std::unique_ptr< PortalLinkBase > a,
std::unique_ptr< PortalLinkBase > b,
AxisDirection direction,
bool flatten = true )

Construct a composite portal from two arbitrary other portal links.

The only requirement is that the portal link surfaces are mergeable.

Parameters
aThe first portal link
bThe second portal link
directionThe binning direction
flattenIf true, the composite will flatten any nested composite

◆ CompositePortalLink() [2/2]

Acts::CompositePortalLink::CompositePortalLink ( std::vector< std::unique_ptr< PortalLinkBase > > links,
AxisDirection direction,
bool flatten = true )

Construct a composite portal from any number of arbitrary other portal links.

The only requirement is that the portal link surfaces are mergeable.

Parameters
linksThe portal links
directionThe binning direction
flattenIf true, the composite will flatten any nested composite

Member Function Documentation

◆ depth()

std::size_t Acts::CompositePortalLink::depth ( ) const

Get the depth of the composite tree.

Returns
The depth

◆ links()

PortalLinkRange Acts::CompositePortalLink::links ( ) const

Get the range of children.

Returns
The range of children

◆ makeGrid()

std::unique_ptr< GridPortalLink > Acts::CompositePortalLink::makeGrid ( const GeometryContext & gctx,
const Logger & logger ) const

(Potentially) create a grid portal link that represents this composite portal link.

Note
This only works, if the composite is flat and only contains trivial portal links. If these preconditions are not met, this function returns a nullptr.
Parameters
gctxThe geometry context
loggerThe logger
Returns
The grid portal link

◆ resolveVolume() [1/2]

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

Resolve the volume for a 2D position.

Note
This will transform the position to global coordinates before consulting its children.
position is assumed to be on surface
Parameters
gctxThe geometry context
positionThe 2D position
toleranceThe on-surface tolerance
Returns
Result containing the resolved tracking volume or error

Implements Acts::PortalLinkBase.

◆ resolveVolume() [2/2]

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

Resolve the volume for a 3D position.

Note
position is assumed to be on surface
Parameters
gctxThe geometry context
positionThe 3D position
toleranceThe tolerance
Returns
Result containing the resolved tracking volume or error

Implements Acts::PortalLinkBase.

◆ size()

std::size_t Acts::CompositePortalLink::size ( ) const

Get the number of children.

Returns
The number of children

◆ toStream()

void Acts::CompositePortalLink::toStream ( std::ostream & os) const
overridevirtual

Print the composite portal link.

Parameters
osThe output stream

Implements Acts::PortalLinkBase.