|
ACTS
Experiment-independent tracking
|
A portal connects two or more neighboring volumes. More...
#include <Acts/Geometry/Portal.hpp>
Classes | |
| struct | Arguments |
| Helper struct for the arguments to the portal constructor below using designated initializers. More... | |
Public Member Functions | |
| Portal (const GeometryContext &gctx, Arguments &&args) | |
| Constructor that takes a geometry context and an rvalue reference to a helper struct from above. | |
| Portal (const GeometryContext &gctx, std::unique_ptr< PortalLinkBase > alongNormal, std::unique_ptr< PortalLinkBase > oppositeNormal) | |
| Constructor for a portal from two links. | |
| Portal (Direction direction, std::shared_ptr< RegularSurface > surface, TrackingVolume &volume) | |
| Constructor for a portal from a surface and volume, where a trivial portal link is automatically constructed. | |
| Portal (Direction direction, std::unique_ptr< PortalLinkBase > link) | |
| Constructor for a portal from a single link. | |
| void | fill (TrackingVolume &volume) |
| Create and attach a trivial portal link to the empty slot of this portal. | |
| const PortalLinkBase * | getLink (Direction direction) const |
Get the link associated with the direction. | |
| bool | isValid () const |
| Returns true if the portal is valid, that means it has at least one non-null link associated.Portals can be in an invalid state after they get merged or fused with other portals. | |
| Result< const TrackingVolume * > | resolveVolume (const GeometryContext &gctx, const Vector3 &position, const Vector3 &direction) const |
Resolve the volume for a 3D position and a direction The direction is used to select the right portal link, if it is set. | |
| void | setLink (const GeometryContext &gctx, Direction direction, std::shared_ptr< RegularSurface > surface, TrackingVolume &volume) |
| Helper function create a trivial portal link based on a surface. | |
| void | setLink (const GeometryContext &gctx, Direction direction, std::unique_ptr< PortalLinkBase > link) |
| Set a link on the portal into the slot specified by the direction. | |
| RegularSurface & | surface () |
| Access the portal surface that is shared between the two links. | |
| const RegularSurface & | surface () const |
| Access the portal surface that is shared between the two links. | |
Static Public Member Functions | |
| static Portal | fuse (const GeometryContext &gctx, Portal &aPortal, Portal &bPortal, const Logger &logger=getDummyLogger()) |
| Fuse two portals together. | |
| static Portal | merge (const GeometryContext &gctx, Portal &aPortal, Portal &bPortal, AxisDirection direction, const Logger &logger=getDummyLogger()) |
| Merge two adjacent portals with each other to produce a new portal that encompasses both inputs. | |
A portal connects two or more neighboring volumes.
Each volume has a set of portals that describes which volumes lie behind the portal in that direction. Portals use associated portal links to perform lookups of target volumes. Each portal has two links (at least one non-null), and a corresponding surface. One link is associated with the direction along the surface's normal vector, and one with the opposite direction.
| Acts::Portal::Portal | ( | Direction | direction, |
| std::unique_ptr< PortalLinkBase > | link ) |
Constructor for a portal from a single link.
| direction | The direction of the link |
| link | The portal link |
| Acts::Portal::Portal | ( | Direction | direction, |
| std::shared_ptr< RegularSurface > | surface, | ||
| TrackingVolume & | volume ) |
Constructor for a portal from a surface and volume, where a trivial portal link is automatically constructed.
| direction | The direction of the link |
| surface | The surface from which to create the portal link |
| volume | The volume this portal connects to in the direction relative to the normal of surface. |
| Acts::Portal::Portal | ( | const GeometryContext & | gctx, |
| std::unique_ptr< PortalLinkBase > | alongNormal, | ||
| std::unique_ptr< PortalLinkBase > | oppositeNormal ) |
Constructor for a portal from two links.
One of the links can be nullptr, but at least one of them needs to be set. If both are set, they need to be valid compatible links that can be fused.
| gctx | The geometry context |
| alongNormal | The link along the normal of the surface |
| oppositeNormal | The link opposite to the normal of the |
| Acts::Portal::Portal | ( | const GeometryContext & | gctx, |
| Arguments && | args ) |
Constructor that takes a geometry context and an rvalue reference to a helper struct from above.
This pattern allows you to use designated initializers to construct this object like:
| gctx | The geometry context |
| args | The struct containing the arguments |
| void Acts::Portal::fill | ( | TrackingVolume & | volume | ) |
Create and attach a trivial portal link to the empty slot of this portal.
| volume | The target volume to connect to |
|
static |
Fuse two portals together.
Fusing is the combination of two portal links on the same logical surfaces. The actual surface instances can be different, as long as they are geometrically equivalent (within numerical precision). The resulting portal will have one portal along the shared surface's normal vector, and one opposite that vector.
| gctx | The geometry context |
| aPortal | The first portal |
| bPortal | The second portal |
| logger | The logger to push output to |
| const PortalLinkBase * Acts::Portal::getLink | ( | Direction | direction | ) | const |
Get the link associated with the direction.
Can be null if the associated link is unset.
| direction | The direction |
| bool Acts::Portal::isValid | ( | ) | const |
Returns true if the portal is valid, that means it has at least one non-null link associated.Portals can be in an invalid state after they get merged or fused with other portals.
|
static |
Merge two adjacent portals with each other to produce a new portal that encompasses both inputs.
It is the complementary operation to the fusing of portals. To be able to merge portals, the surfaces of their associated links need to be mergeable, and the portal links need to be compatible. This means that both portals need to have a link along the portal surface normal, opposite the normal, or both. If the equipped links are opposite relative to one another (e.g. one along one opposite), the function will throw an exception.
| gctx | The geometry context |
| aPortal | The first portal |
| bPortal | The second portal |
| direction | The direction of the merge (e.g. along z) |
| logger | The logger to push output to |
| Result< const TrackingVolume * > Acts::Portal::resolveVolume | ( | const GeometryContext & | gctx, |
| const Vector3 & | position, | ||
| const Vector3 & | direction ) const |
Resolve the volume for a 3D position and a direction The direction is used to select the right portal link, if it is set.
In case no link is found in the specified direction, a nullptr is returned.
| gctx | The geometry context |
| position | The 3D position |
| direction | The direction |
| void Acts::Portal::setLink | ( | const GeometryContext & | gctx, |
| Direction | direction, | ||
| std::shared_ptr< RegularSurface > | surface, | ||
| TrackingVolume & | volume ) |
Helper function create a trivial portal link based on a surface.
| gctx | The geometry context |
| direction | The direction of the link to create |
| surface | The surface |
surface must be logically equivalent to the one of the link that's already set on the portal. | volume | The target volume |
| void Acts::Portal::setLink | ( | const GeometryContext & | gctx, |
| Direction | direction, | ||
| std::unique_ptr< PortalLinkBase > | link ) |
Set a link on the portal into the slot specified by the direction.
link must be logically equivalent to the one of the link that's already set on the portal. | gctx | The geometry context |
| direction | The direction |
| link | The link to set |
| RegularSurface & Acts::Portal::surface | ( | ) |
Access the portal surface that is shared between the two links.
| const RegularSurface & Acts::Portal::surface | ( | ) | const |
Access the portal surface that is shared between the two links.