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

Interface class to define the transform cache backend for alignable volumes. More...

#include <Acts/Geometry/VolumePlacementBase.hpp>

Public Member Functions

 VolumePlacementBase () noexcept
 Default constructor.
 VolumePlacementBase (const VolumePlacementBase &)=delete
 Delete the copy constructor.
 VolumePlacementBase (VolumePlacementBase &&)=delete
 Delete the move constructor.
virtual ~VolumePlacementBase ()
 Virtual default destructor.
virtual const Transform3globalToLocalTransform (const GeometryContext &gctx) const =0
 Returns the transformation from the experiment's global frame to the local volume coordinate system.
virtual const Transform3localToGlobalTransform (const GeometryContext &gctx) const =0
 Returns the transformation from the local volume coordinates to the experiment's global coordinate system.
virtual void makePortalsAlignable (const GeometryContext &gctx, const std::vector< std::shared_ptr< RegularSurface > > &portalsToAlign)
 Receives the vector of oriented portal surfaces produced by the VolumeBounds and makes them to float with the alignment provided by the volume.
std::size_t nPortalPlacements () const
 Number of registered SurfacePlacement objects aligning the associated portals with the volume.
VolumePlacementBaseoperator= (const VolumePlacementBase &)=delete
 Delete copy assignment.
VolumePlacementBaseoperator= (VolumePlacementBase &&)=delete
 Delete move assignment.
virtual const Transform3portalLocalToGlobal (const GeometryContext &gctx, const std::size_t portalIdx) const =0
 Returns the transform from the portal's frame to the experiment's global frame for the portal surface associated with the volume.
detail::PortalPlacement * portalPlacement (const std::size_t portalIdx)
 Pointer to the SurfacePlacementBase object aligning the i-th portal (May be nullptr if index exceeds the number of portals).
const detail::PortalPlacement * portalPlacement (const std::size_t portalIdx) const
 Pointer to the SurfacePlacementBase object aligning the i-th portal (May be nullptr if index exceeds the number of portals).

Protected Member Functions

Transform3 alignPortal (const GeometryContext &gctx, const std::size_t portalIdx) const
 Constructs the transform from the portal's frame into the experiment's global frame taking the alignment corrections of the associated volume into account.

Detailed Description

Interface class to define the transform cache backend for alignable volumes.

Alignable volumes can be dynamically moved by the client code using the information wrapped into the GeometryContext similar to the alignable surfaces. The challenge is that the boundary surfaces of the volume need to move accordingly and that ACTS does not know anything about the caching of the alignable geometry objects a priori.

A client-based implementation of the VolumePlacementBase can be passed to the constructor of the Volume instead of the fixed transform. The Volume is then querying its global position from the VolumePlacements. The associated bonudary surfaces are also requesting their position in global space. The Volume's transform and the bounds can the no longer be overwritten at a later stage.

An implementation of the VolumePlacementBase needs to satisfy the following interface.

1) Transforms switching from the volume's frame into the global experiment's frame and vice versa:

const Transform3& localToGlobalTransform(const GeometryContext& gctx) const;

const Transform3& localToGlobalTransform(const GeometryContext& gctx) const;

2) At the end of the tracking geometry construction, the portals that are associated to the volume aligned by the VolumePlacementBase are connected to this particular instance. The user may override the makePortalsAlignable method to instantiate a customized transform cache backend. He needs to ensure that the base definition of the method is called from his implementation otherwise the placements aligning the portals are note created.

Every time when the portal is asked for its position in space, it's forwarding the request to the VolumePlacementBase by calling the

const Transform3& portalLocalToGlobal(const GeometryContext& gctx,
                                      const std::size_t portalIdx)
                                      const;

method. The portalIdx is the unique index of the portal and assists the client to return the appropriate transform

3) Every time when the alignment of the volume is updated, the client also needs to cache the transforms of the associated surfaces. After, the central volume has moved, a loop similar to the one below needs to be implemented:

for (std::size_t p = 0 ; p < nPortalPlacements(); ++p) { context.cachePortal(alignPortal(Acts::Geometrycontext{context}, p), p); } context.volGlobToLocal = context.volLocToGlobal.inverse();

The alignPortal is a wrapper method attaching the portal -> volume transform to the aligned local -> global transform of the volume and returning the result via copy.

Member Function Documentation

◆ alignPortal()

Transform3 Acts::VolumePlacementBase::alignPortal ( const GeometryContext & gctx,
const std::size_t portalIdx ) const
protected

Constructs the transform from the portal's frame into the experiment's global frame taking the alignment corrections of the associated volume into account.

Note
: The call of this function is only allowed after the volume itself is moved. A swapped call order probably leads to unaligned portals
Parameters
gctxThe geometry context carrying the current volume alignment
portalIdxIndex of the portal to align
Returns
The aligned localToGlobalTransform of the i-the portal

◆ globalToLocalTransform()

virtual const Transform3 & Acts::VolumePlacementBase::globalToLocalTransform ( const GeometryContext & gctx) const
pure virtual

Returns the transformation from the experiment's global frame to the local volume coordinate system.

Parameters
gctxThe current geometry context object, e.g. alignment
Returns
Reference to the global -> local transform

◆ localToGlobalTransform()

virtual const Transform3 & Acts::VolumePlacementBase::localToGlobalTransform ( const GeometryContext & gctx) const
pure virtual

Returns the transformation from the local volume coordinates to the experiment's global coordinate system.

Parameters
gctxThe current geometry context object, e.g. alignment
Returns
Reference to the local -> global transform

◆ makePortalsAlignable()

virtual void Acts::VolumePlacementBase::makePortalsAlignable ( const GeometryContext & gctx,
const std::vector< std::shared_ptr< RegularSurface > > & portalsToAlign )
virtual

Receives the vector of oriented portal surfaces produced by the VolumeBounds and makes them to float with the alignment provided by the volume.

It then the vector of updated oriented surfaces

Parameters
gctxThe current geometry context object, e.g. alignment
portalsToAlignList of portals to align

◆ nPortalPlacements()

std::size_t Acts::VolumePlacementBase::nPortalPlacements ( ) const

Number of registered SurfacePlacement objects aligning the associated portals with the volume.

Returns
The number of registered portal placements

◆ portalLocalToGlobal()

virtual const Transform3 & Acts::VolumePlacementBase::portalLocalToGlobal ( const GeometryContext & gctx,
const std::size_t portalIdx ) const
pure virtual

Returns the transform from the portal's frame to the experiment's global frame for the portal surface associated with the volume.

Parameters
gctxThe current geometry context object, e.g. alignment
portalIdxInternal index of the portal surface [0 - number of portals)
Returns
Reference to the local -> global transform of the i-th portal

◆ portalPlacement() [1/2]

detail::PortalPlacement * Acts::VolumePlacementBase::portalPlacement ( const std::size_t portalIdx)

Pointer to the SurfacePlacementBase object aligning the i-th portal (May be nullptr if index exceeds the number of portals).

Parameters
portalIdxInternal index of the portal surface [0 - number of portals)
Returns
Pointer to the i-th portal placement

◆ portalPlacement() [2/2]

const detail::PortalPlacement * Acts::VolumePlacementBase::portalPlacement ( const std::size_t portalIdx) const

Pointer to the SurfacePlacementBase object aligning the i-th portal (May be nullptr if index exceeds the number of portals).

Parameters
portalIdxInternal index of the portal surface [0 - number of portals)
Returns
Pointer to the i-th portal placement