Class Acts::Experimental::DetectorVolume

class DetectorVolume : public std::enable_shared_from_this<DetectorVolume>

A detector volume description which can be:

Note

A detector volume holds non-const objects internally that are allowed to be modified as long as the geometry is not yet closed. Using this, material can be attached, and GeometryIdentifier can be set at construction time.

Note

The construction of DetectorVolumes is done via a dedicated factory, this is necessary as then the shared_ptr is non-weak and it can be registred in the portal generator for further geometry processing.

Note

Navigation is always done by plain pointers, while object ownership is done by shared/unique pointers.

Public Types

using BoundingBox = Acts::AxisAlignedBoundingBox<Acts::Experimental::DetectorVolume, Acts::ActsScalar, 3>

Public Functions

inline void assignDetector(const Detector &detector)

Assign Detector to this volume (for back navigation issues)

Parameters

detector – the parenting detector class

void assignSurfaceCandidatesUpdator(SurfaceCandidatesUpdator &&surfaceCandidateUpdator, const std::vector<std::shared_ptr<Surface>> &surfaces = {}, const std::vector<std::shared_ptr<DetectorVolume>> &volumes = {})

This method allows to udate the navigation state updator module.

Parameters
  • surfaceCandidateUpdator – the new navigation state updator for surfaces

  • surfaces – the surfaces the new navigation state updator points to

  • volumes – the volumes the new navigation state updator points to

inline void assignVolumeMaterial(std::shared_ptr<IVolumeMaterial> material)

Assign the volume material description.

This method allows to load a material description during the detector geometry building, and assigning it (potentially multiple) times to detector volumes.

Parameters

material – Material description associated to this volumw

inline Vector3 center(const GeometryContext &gctx = GeometryContext()) const

Const access to the center.

Note

the geometry context is currently ignored, but is a placeholder for eventually misaligned volumes

Parameters

gctx – the geometry contect

Returns

a contextually created center

void closePortals()

Final closing of portal, i.e. this sets the end of world.

inline const Detector *detector() const

Const access to the detector.

Extent extent(const GeometryContext &gctx, size_t nseg = 1) const

The Extent for this volume.

Parameters
  • gctx – is the geometry context

  • nseg – is the number of segements to approximate

Returns

an Extent object

inline const GeometryIdentifier &geometryId() const
Returns

the geometry identifier

const BoundingBox &getBoundingBox() const
std::shared_ptr<DetectorVolume> 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 DetectorVolume> 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

bool inside(const GeometryContext &gctx, const Vector3 &position, bool excludeInserts = true) const

Inside/outside method.

Parameters
  • gctx – the geometry context

  • position – the position for the inside check

  • excludeInserts – steers whether inserted volumes overwrite this

Returns

a bool to indicate inside/outside

inline const std::string &name() const
Returns

the name of the volume

inline std::vector<std::shared_ptr<Portal>> &portalPtrs()

Non-const access to the portals.

Returns

the portal shared pointer store

inline const std::vector<const Portal*> &portals() const

Const access to the detector portals.

Note

an empty vector indicates a container volume that has not been properly connected

Returns

a vector to const Portal raw pointers

inline const SurfaceCandidatesUpdator &surfaceCandidatesUpdator() const

Const access to the navigation state updator.

inline std::vector<std::shared_ptr<Surface>> &surfacePtrs()

Non-const access to the surfaces.

Returns

the surfaces shared pointer store

inline const std::vector<const Surface*> &surfaces() const

Const access to the surfaces.

Note

an empty vector indicates either gap volume or container volume, a non-empty vector indicates a layer volume.

Returns

a vector to const Surface raw pointers

inline const Transform3 &transform(const GeometryContext &gctx = GeometryContext()) const

Const access to the transform.

Note

the geometry context is currently ignored, but is a placeholder for eventually misaligned volumes

Parameters

gctx – the geometry contect

Returns

const reference to the contextual transform

void updateNavigationState(const GeometryContext &gctx, NavigationState &nState) const

Initialize/update the navigation status in this environment.

This method calls:

  • the local navigation delegate for candidate surfaces

  • the portal navigation delegate for candidate exit portals

  • set the current detector volume

Parameters
  • gctx – is the current geometry context

  • nState – [in,out] is the detector navigation state to be updated

void updatePortal(std::shared_ptr<Portal> portal, unsigned int pIndex) noexcept(false)

Update a portal given a portal index.

Note

throws exception if portal index out of bounds

Parameters
  • portal – the portal to be updated

  • pIndex – the portal index

inline const VolumeBounds &volumeBounds() const

Const access to the volume bounds.

Returns

const reference to the volume bounds object

inline const IVolumeMaterial *volumeMaterial() const

Const access to the volume amterial.

inline std::shared_ptr<IVolumeMaterial> volumeMaterialPtr()

Non-const access to the voume material (for scaling, e.g.)

inline std::vector<std::shared_ptr<DetectorVolume>> &volumePtrs()

Non-const access to the volumes.

Returns

the volumes shared pointer store

inline const std::vector<const DetectorVolume*> &volumes() const

Const access to sub volumes.

Note

and empty vector indicates this is either a gap volume or a layer volume, in any case it means the volume is on navigation level and the portals need to be connected

Returns

a vector to const DetectorVolume raw pointers

Friends

friend class DetectorVolumeFactory
template<typename internal_type>
struct ObjectStore

Nested object store that holds the internal (non-const), reference counted objects and provides an external (const raw pointer) access.

Template Parameters

internal_type – is the internal storage representation, has to comply with std::shared_ptr semantics

Public Functions

inline ObjectStore(const std::vector<internal_type> &objects)

Store constructor.

Parameters

objects – are the ones copied into the internal store

ObjectStore() = default

Public Members

std::vector<const typename internal_type::element_type*> external = {}

The external storage vector, const raw pointer.

std::vector<internal_type> internal = {}

The internal storage vector.