Class Acts::Experimental::Portal

class Portal : public std::enable_shared_from_this<Portal>

A portal description between the detector volumes.

It has a Surface representation for navigation and propagation and guides from one volume to the next.

The surface can carry material to allow mapping onto portal positions if required.

Public Types

using AttachedDetectorVolumes = std::array<std::vector<std::shared_ptr<DetectorVolume>>, 2u>

The vector of attached volumes forward/backward, this is useful in the geometry building.

using DetectorVolumeUpdators = std::array<DetectorVolumeUpdator, 2u>

The volume links forward/backward with respect to the surface normal.

Public Functions

Portal() = delete
virtual ~Portal() = default
void assignDetectorVolumeUpdator(NavigationDirection nDir, DetectorVolumeUpdator &&dVolumeUpdator, const std::vector<std::shared_ptr<DetectorVolume>> &attachedVolumes)

Update the volume link.

Note

this overwrites the existing link

Parameters
  • nDir – the navigation direction for the link

  • dVolumeUpdator – is the mangaged volume updator delegate

  • attachedVolumes – is the list of attached volumes for book keeping

void assignDetectorVolumeUpdator(DetectorVolumeUpdator &&dVolumeUpdator, const std::vector<std::shared_ptr<DetectorVolume>> &attachedVolumes) noexcept(false)

Update the volume link, w/o directive, i.e.

it relies that there’s only one remaining link to be set, throws an exception if that’s not the case

Note

this overwrites the existing link

Parameters
  • dVolumeUpdator – is the mangaged volume updator delegate

  • attachedVolumes – is the list of attached volumes for book keeping

void assignGeometryId(const GeometryIdentifier &geometryId)

Set the geometry identifier (to the underlying surface)

Parameters

geometryId – the geometry identifier to be assigned

inline AttachedDetectorVolumes &attachedDetectorVolumes()
inline const DetectorVolumeUpdators &detectorVolumeUpdators() const
void fuse(std::shared_ptr<Portal> &other) noexcept(false)

Fuse with another portal, this one is kept.

Note

this will move the portal links from the other into this volume, it will throw an exception if the portals are not fusable

Note

that other will be overwritten to point to this

Parameters

other – is the portal that will be fused

std::shared_ptr<Portal> getSharedPtr()

Retrieve a std::shared_ptr for this surface (non-const version)

Note

Will error if this was not created through the makeShared factory since it needs access to the original reference. In C++14 this is undefined behavior (but most likely implemented as a bad_weak_ptr exception), in C++17 it is defined as that exception.

Note

Only call this if you need shared ownership of this object.

Returns

The shared pointer

std::shared_ptr<const Portal> getSharedPtr() const

Retrieve a std::shared_ptr for this surface (const version)

Note

Will error if this was not created through the makeShared factory since it needs access to the original reference. In C++14 this is undefined behavior, but most likely implemented as a bad_weak_ptr exception, in C++17 it is defined as that exception.

Note

Only call this if you need shared ownership of this object.

Returns

The shared pointer

inline const Surface &surface() const

Const access to the surface representation.

inline Surface &surface()

Non-const access to the surface reference.

void updateDetectorVolume(const GeometryContext &gctx, NavigationState &nState) const noexcept(false)

Update the current volume.

Parameters
  • gctx – is the Geometry context of this call

  • nState – [in,out] the navigation state for the volume to be updated

Public Static Functions

template<typename ...Args>
static inline std::shared_ptr<Portal> makeShared(Args&&... args)

Factory for producing memory managed instances of Portal.

Will forward all parameters and will attempt to find a suitable constructor.

Friends

friend class DetectorVolume