File DetectorVolume.hpp¶
-
namespace Acts
Note
This file is foreseen for the
Geometry
module to replaceExtent
-
namespace Experimental
-
struct AllPortalsExtractor¶
- #include <Acts/Detector/DetectorVolume.hpp>
Helper extractors: all portals.
Public Static Functions
Extract the portals from the volume.
- Parameters
gctx – the geometry contextfor this extraction call
nState – is the current navigation state
- Returns
a vector of raw Portal pointers
-
struct AllSubVolumesExtractor¶
- #include <Acts/Detector/DetectorVolume.hpp>
Helper extractors: all sub volumes of a volume.
Public Static Functions
Extract the sub volumes from the volume.
- Parameters
gctx – the geometry contextfor this extraction call
nState – is the current navigation state
indices – are access indices into the volume store (ignored)
- Returns
a vector of raw DetectorVolume pointers
-
struct AllSurfacesExtractor¶
- #include <Acts/Detector/DetectorVolume.hpp>
Helper extractors: all surfaces.
Public Static Functions
Extract the surfaces from the volume.
- Parameters
gctx – the geometry contextfor this extraction call
nState – is the current navigation state
indices – is an ignored index vector
- Returns
a vector of raw Surface pointers
-
class DetectorVolume : public std::enable_shared_from_this<DetectorVolume>
- #include <Acts/Detector/DetectorVolume.hpp>
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
-
void assignDetector(const Detector &detector)
Assign Detector to this volume (for back navigation issues)
- Parameters
detector – the parenting detector class
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
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
-
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.
-
const Detector *detector() const
Const access to the detector.
-
const DetectorVolumeUpdator &detectorVolumeUpdator() const
Const access to the detector volume updator.
-
bool exclusivelyInside(const GeometryContext &gctx, const Vector3 &position) const
Check if a point is exclusively inside this volume i.e.
this point is not inside a subvolume.
- Parameters
gctx – the geometry context
position – the position for the inside check
- Returns
a bool to indicate inside/outside
-
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
-
const GeometryIdentifier &geometryId() const
- Returns
the geometry identifier
-
const BoundingBox &getBoundingBox() const
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 abad_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
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 abad_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) const
Check if a point is inside this volume.
Subvolumes will not be checked.
- Parameters
gctx – the geometry context
position – the position for the inside check
- Returns
a bool to indicate inside/outside
-
const std::string &name() const
- Returns
the name of the volume
-
std::vector<std::shared_ptr<Portal>> &portalPtrs()
Non-const access to the portals.
- Returns
the portal shared pointer store
-
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
-
const SurfaceCandidatesUpdator &surfaceCandidatesUpdator() const
Const access to the navigation state updator.
-
std::vector<std::shared_ptr<Surface>> &surfacePtrs()
Non-const access to the surfaces.
- Returns
the surfaces shared pointer store
-
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
-
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
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
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
-
const VolumeBounds &volumeBounds() const
Const access to the volume bounds.
- Returns
const reference to the volume bounds object
-
const IVolumeMaterial *volumeMaterial() const
Const access to the volume amterial.
-
std::shared_ptr<IVolumeMaterial> volumeMaterialPtr()
Non-const access to the voume material (for scaling, e.g.)
-
std::vector<std::shared_ptr<DetectorVolume>> &volumePtrs()
Non-const access to the volumes.
- Returns
the volumes shared pointer store
-
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
Protected Functions
Create a detector volume - with surfaces and/or inserted volumes.
Note
throws exception if misconfigured: no bounds
Note
throws exception if ghe portal general or navigation state updator delegates are not connected
- Parameters
gctx – the geometry context while building - for future contextual store
name – the volume name
transform – the transform defining the volume position
bounds – the volume bounds
surfaces – are the contained surfaces of this volume
volumes – are the containes volumes of this volume
detectorVolumeUpdator – is a Delegate to find the assocaited volume
surfaceCandidateUpdator – the navigation state updator for surfaces/portals
-
DetectorVolume(const GeometryContext &gctx, const std::string &name, const Transform3 &transform, std::unique_ptr<VolumeBounds> bounds, SurfaceCandidatesUpdator &&surfaceCandidateUpdator) noexcept(false)¶
Create a detector volume - empty/gap volume constructor.
Note
throws exception if misconfigured: no bounds
Note
throws exception if ghe portal general or navigation state updator delegates are not connected
- Parameters
gctx – the geometry context while building - for future contextual store
name – the volume name
transform – the transform defining the volume position
bounds – the volume bounds
surfaceCandidateUpdator – the navigation state updator for surfaces/portals
Protected Static Functions
Private Functions
-
bool checkContainment(const GeometryContext &gctx, size_t nseg = 1) const¶
- Parameters
gctx – the current geometry context object, e.g. alignment
nseg – is the number of segements to approximate
- Returns
a boolean indicating if the objects are properly contained
-
void construct(const GeometryContext &gctx, const PortalGenerator &portalGenerator) noexcept(false)¶
Internal construction method that calls the portal generator.
Note
throws exception if provided parameters are inconsistent
- Parameters
gctx – the current geometry context object, e.g. alignment
portalGenerator – the generator for portals
-
void createBoundingBox(const GeometryContext &gctx)¶
build the bounding box
Private Members
-
std::shared_ptr<const BoundingBox> m_boundingBox¶
BoundingBox.
-
std::unique_ptr<VolumeBounds> m_bounds = nullptr¶
Volume boundaries.
-
DetectorVolumeUpdator m_detectorVolumeUpdator¶
-
GeometryIdentifier m_geometryId = {0}¶
GeometryIdentifier of this volume.
-
std::string m_name = "Unnamed"¶
Name of the volume.
-
ObjectStore<std::shared_ptr<Portal>> m_portals¶
Portal store (internal/external)
-
SurfaceCandidatesUpdator m_surfaceCandidatesUpdator¶
The navigation state updator.
-
ObjectStore<std::shared_ptr<Surface>> m_surfaces¶
Surface store (internal/external)
-
Transform3 m_transform = Transform3::Identity()¶
Transform to place the bolume.
-
std::shared_ptr<IVolumeMaterial> m_volumeMaterial = nullptr¶
Volume material (optional)
-
ObjectStore<std::shared_ptr<DetectorVolume>> m_volumes¶
Volume store (internal/external)
Friends
- friend class DetectorVolumeFactory
-
template<typename internal_type>
struct ObjectStore - #include <Acts/Detector/DetectorVolume.hpp>
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(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.
-
using BoundingBox = Acts::AxisAlignedBoundingBox<Acts::Experimental::DetectorVolume, Acts::ActsScalar, 3>
-
class DetectorVolumeFactory
- #include <Acts/Detector/DetectorVolume.hpp>
A detector volume factory which first constructs the detector volume and then constructs the portals.
This ensures that the std::shared_ptr holding the detector volume is not weak when assigning to the portals.
Public Static Functions
Create a detector volume - from factory.
-
static inline std::shared_ptr<DetectorVolume> construct(const PortalGenerator &portalGenerator, const GeometryContext &gctx, const std::string &name, const Transform3 &transform, std::unique_ptr<VolumeBounds> bounds, SurfaceCandidatesUpdator &&surfaceCandidateUpdator)
Create a detector volume - from factory.
-
struct IndexedSubVolumesExtractor¶
- #include <Acts/Detector/DetectorVolume.hpp>
Helper extractors: indexed sub volume of a volume.
Public Static Functions
Extract the sub volumes from the volume.
- Parameters
gctx – the geometry contextfor this extraction call
nState – is the current navigation state
indices – are access indices into the volume store
- Returns
a vector of raw DetectorVolume pointers
-
struct IndexedSurfacesExtractor¶
- #include <Acts/Detector/DetectorVolume.hpp>
Helper extractors: indexed surfaces.
Public Static Functions
Extract the surfaces from the volume.
- Parameters
gctx – the geometry contextfor this extraction call
nState – is the current navigation state
indices – are access indices into the surfaces store
- Returns
a vector of raw Surface pointers
-
struct AllPortalsExtractor¶
-
namespace Experimental