ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
Acts::TrackingGeometry Class Reference

The TrackingGeometry class is the owner of the constructed TrackingVolumes. More...

#include <Acts/Geometry/TrackingGeometry.hpp>

Public Types

enum class  GeometryVersion { Gen1 , Gen3 }
 Which type of geometry this represents: Gen1 or Gen3.

Public Member Functions

 TrackingGeometry (const std::shared_ptr< TrackingVolume > &highestVolume, const IMaterialDecorator *materialDecorator=nullptr, const GeometryIdentifierHook &hook={}, const Logger &logger=getDummyLogger(), bool close=true)
 Constructor.
 ~TrackingGeometry ()
 Destructor.
template<typename Callable>
requires (detail::callableWithAnyMutable<Callable>() && !detail::callableWithAnyConst<Callable>())
void apply (Callable &&callable)
 Apply an arbitrary callable as a visitor to the tracking volume.
template<typename Callable>
requires (detail::callableWithAnyConst<Callable>())
void apply (Callable &&callable) const
 Apply an arbitrary callable as a visitor to the tracking volume.
void apply (TrackingGeometryMutableVisitor &visitor)
 Apply a visitor to the tracking volume.
void apply (TrackingGeometryVisitor &visitor) const
 Apply a visitor to the tracking volume.
const LayerassociatedLayer (const GeometryContext &gctx, const Vector3 &gp) const
 Forward the associated Layer information.
const PortalfindPortal (std::string_view tag) const
 Search for a portal that was tagged with the given label during the blueprint construction (see Acts::PortalDesignatorBlueprintNode).
const SurfacefindSurface (GeometryIdentifier id) const
 Search for a surface with the given identifier.
const TrackingVolumefindVolume (GeometryIdentifier id) const
 Search for a volume with the given identifier.
const TrackingVolumefindVolumeByName (std::string_view name) const
 Search for the first volume with the given name.
const std::unordered_map< GeometryIdentifier, const Surface * > & geoIdSurfaceMap () const
 Access to the GeometryIdentifier - Surface association map.
GeometryVersion geometryVersion () const
 Return the generation of this TrackingGeometry.
TrackingVolumehighestTrackingVolume ()
 Access to the world volume.
const TrackingVolumehighestTrackingVolume () const
 Access to the world volume.
std::shared_ptr< const TrackingVolumehighestTrackingVolumePtr () const
 Access to the world volume.
const TrackingVolumelowestTrackingVolume (const GeometryContext &gctx, const Vector3 &gp) const
 return the lowest tracking Volume for a global position
Result< const TrackingVolume * > resolveLowestTrackingVolume (const GeometryContext &gctx, const Vector3 &gp, const std::optional< Vector3 > &direction=std::nullopt, const Surface *associatedSurface=nullptr, double tolerance=s_onSurfaceTolerance) const
 resolve the lowest tracking Volume for a global position
template<SurfaceVisitor visitor_t>
void visitSurfaces (visitor_t &&visitor) const
 Visit all sensitive surfaces.
template<SurfaceVisitor visitor_t>
void visitSurfaces (visitor_t &&visitor, bool restrictToSensitives) const
 Visit all reachable surfaces.
template<TrackingVolumeVisitor visitor_t>
void visitVolumes (visitor_t &&visitor) const
 Visit all reachable tracking volumes.
void visualize (IVisualization3D &helper, const GeometryContext &gctx, const ViewConfig &viewConfig=s_viewVolume, const ViewConfig &portalViewConfig=s_viewPortal, const ViewConfig &sensitiveViewConfig=s_viewSensitive) const
 Visualize a tracking geometry including substructure.

Detailed Description

The TrackingGeometry class is the owner of the constructed TrackingVolumes.

It enables both, a global search for an asociatedVolume (respectively, if existing, a global search of an associated Layer or the next associated Layer), such as a continuous navigation by BoundarySurfaces between the confined TrackingVolumes.

Constructor & Destructor Documentation

◆ TrackingGeometry()

Acts::TrackingGeometry::TrackingGeometry ( const std::shared_ptr< TrackingVolume > & highestVolume,
const IMaterialDecorator * materialDecorator = nullptr,
const GeometryIdentifierHook & hook = {},
const Logger & logger = getDummyLogger(),
bool close = true )
explicit

Constructor.

Parameters
highestVolumeis the world volume
materialDecoratoris a dediated decorator that can assign surface or volume based material to the TrackingVolume
hookIdentifier hook to be applied to surfaces
loggerinstance of a logger (defaulting to the "silent" one)
closeIf true, run the Gen1 geometry closure

Member Function Documentation

◆ apply() [1/4]

template<typename Callable>
requires (detail::callableWithAnyMutable<Callable>() && !detail::callableWithAnyConst<Callable>())
void Acts::TrackingGeometry::apply ( Callable && callable)

Apply an arbitrary callable as a visitor to the tracking volume.

Parameters
callableThe callable to apply
Note
The visitor can be overloaded on any of the arguments that the methods in TrackingGeometryVisitor receive.

◆ apply() [2/4]

template<typename Callable>
requires (detail::callableWithAnyConst<Callable>())
void Acts::TrackingGeometry::apply ( Callable && callable) const

Apply an arbitrary callable as a visitor to the tracking volume.

Parameters
callableThe callable to apply
Note
The visitor can be overloaded on any of the arguments that the methods in TrackingGeometryMutableVisitor receive.

◆ apply() [3/4]

void Acts::TrackingGeometry::apply ( TrackingGeometryMutableVisitor & visitor)

Apply a visitor to the tracking volume.

Parameters
visitorThe visitor to apply

◆ apply() [4/4]

void Acts::TrackingGeometry::apply ( TrackingGeometryVisitor & visitor) const

Apply a visitor to the tracking volume.

Parameters
visitorThe visitor to apply

◆ associatedLayer()

const Layer * Acts::TrackingGeometry::associatedLayer ( const GeometryContext & gctx,
const Vector3 & gp ) const

Forward the associated Layer information.

Parameters
gctxis the context for this request (e.g. alignment)
gpis the global position of the call
Returns
plain pointer to assocaiated layer

◆ findPortal()

const Portal * Acts::TrackingGeometry::findPortal ( std::string_view tag) const

Search for a portal that was tagged with the given label during the blueprint construction (see Acts::PortalDesignatorBlueprintNode).

Parameters
tagthe tag assigned to the portal
Return values
nullptrif no portal carries the tag
pointerto the tagged portal otherwise.

◆ findSurface()

const Surface * Acts::TrackingGeometry::findSurface ( GeometryIdentifier id) const

Search for a surface with the given identifier.

Parameters
idis the geometry identifier of the surface
Return values
nullptrif no such surface exists
pointerto the found surface otherwise.

◆ findVolume()

const TrackingVolume * Acts::TrackingGeometry::findVolume ( GeometryIdentifier id) const

Search for a volume with the given identifier.

Parameters
idis the geometry identifier of the volume
Return values
nullptrif no such volume exists
pointerto the found volume otherwise.

◆ findVolumeByName()

const TrackingVolume * Acts::TrackingGeometry::findVolumeByName ( std::string_view name) const

Search for the first volume with the given name.

Parameters
nameis the volume name to search for
Return values
nullptrif no volume carries the name
pointerto the first matching volume otherwise.

◆ geoIdSurfaceMap()

const std::unordered_map< GeometryIdentifier, const Surface * > & Acts::TrackingGeometry::geoIdSurfaceMap ( ) const

Access to the GeometryIdentifier - Surface association map.

Returns
Const reference to the geometry ID to surface map

◆ geometryVersion()

GeometryVersion Acts::TrackingGeometry::geometryVersion ( ) const

Return the generation of this TrackingGeometry.

Returns
the generation of this TrackingGeometry

◆ highestTrackingVolume() [1/2]

TrackingVolume * Acts::TrackingGeometry::highestTrackingVolume ( )

Access to the world volume.

Returns
plain pointer to the world volume

◆ highestTrackingVolume() [2/2]

const TrackingVolume * Acts::TrackingGeometry::highestTrackingVolume ( ) const

Access to the world volume.

Returns
plain pointer to the world volume

◆ highestTrackingVolumePtr()

std::shared_ptr< const TrackingVolume > Acts::TrackingGeometry::highestTrackingVolumePtr ( ) const

Access to the world volume.

Returns
shared pointer to the world volume

◆ lowestTrackingVolume()

const TrackingVolume * Acts::TrackingGeometry::lowestTrackingVolume ( const GeometryContext & gctx,
const Vector3 & gp ) const

return the lowest tracking Volume for a global position

Parameters
gctxThe current geometry context object, e.g. alignment
gpis the global position of the call
Returns
plain pointer to the lowest TrackingVolume, nullptr if there is no volume at the position
Deprecated
Use resolveLowestTrackingVolume instead, which can resolve boundaries along a direction and reports failures instead of returning nullptr.

◆ resolveLowestTrackingVolume()

Result< const TrackingVolume * > Acts::TrackingGeometry::resolveLowestTrackingVolume ( const GeometryContext & gctx,
const Vector3 & gp,
const std::optional< Vector3 > & direction = std::nullopt,
const Surface * associatedSurface = nullptr,
double tolerance = s_onSurfaceTolerance ) const

resolve the lowest tracking Volume for a global position

Without a direction and associatedSurface the lookup is purely position based, and which of the adjacent volumes is returned for a position on a boundary between volumes is unspecified.

If associatedSurface is given and is a boundary surface (Gen1) or a portal surface (Gen3), the boundary ambiguity is resolved along direction: the volume being entered is returned. Otherwise the surface does not act as a boundary and the lookup is position based as above.

Precondition
If associatedSurface is given, the position has to be on it within the given tolerance, ignoring the surface bounds.
Parameters
gctxThe current geometry context object, e.g. alignment
gpis the global position of the call
directionis the direction used to resolve the volume if the position is on a boundary between volumes
associatedSurfaceis the surface the position lies on, used to identify a boundary crossing
toleranceis the search tolerance for the volume lookup and the on-surface check of the associated surface
Returns
plain pointer to the lowest TrackingVolume, nullptr if there is no volume at the position (or in the given direction)
Return values
SurfaceError::GlobalPositionNotOnSurfaceif associatedSurface is a boundary surface or portal, but the position is outside of its bounds. This can happen for positions grazing a volume edge within the lookup tolerance.

◆ visitSurfaces() [1/2]

template<SurfaceVisitor visitor_t>
void Acts::TrackingGeometry::visitSurfaces ( visitor_t && visitor) const

Visit all sensitive surfaces.

Template Parameters
visitor_tType of the callable visitor
Parameters
visitorThe callable. Will be called for each sensitive surface that is found, a selection of the surfaces can be done in the visitor
Note
If a context is needed for the visit, the visitor has to provide this, e.g. as a private member

◆ visitSurfaces() [2/2]

template<SurfaceVisitor visitor_t>
void Acts::TrackingGeometry::visitSurfaces ( visitor_t && visitor,
bool restrictToSensitives ) const

Visit all reachable surfaces.

Template Parameters
visitor_tType of the callable visitor
Parameters
visitorThe callable. Will be called for each reachable surface that is found, a selection of the surfaces can be done in the visitor
restrictToSensitivesIf true, only sensitive surfaces are visited
Note
If a context is needed for the visit, the visitor has to provide this, e.g. as a private member

◆ visitVolumes()

template<TrackingVolumeVisitor visitor_t>
void Acts::TrackingGeometry::visitVolumes ( visitor_t && visitor) const

Visit all reachable tracking volumes.

Template Parameters
visitor_tType of the callable visitor
Parameters
visitorThe callable. Will be called for each reachable volume that is found, a selection of the volumes can be done in the visitor
Note
If a context is needed for the visit, the visitor has to provide this, e.g. as a private member

◆ visualize()

void Acts::TrackingGeometry::visualize ( IVisualization3D & helper,
const GeometryContext & gctx,
const ViewConfig & viewConfig = s_viewVolume,
const ViewConfig & portalViewConfig = s_viewPortal,
const ViewConfig & sensitiveViewConfig = s_viewSensitive ) const

Visualize a tracking geometry including substructure.

Parameters
helperThe visualization helper that implement the output
gctxThe geometry context
viewConfigGlobal view config
portalViewConfigView config for portals
sensitiveViewConfigView configuration for sensitive surfaces