Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-20 08:16:39

0001 // This file is part of the ACTS project.
0002 //
0003 // Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
0008 
0009 #pragma once
0010 
0011 #include "Acts/Definitions/Algebra.hpp"
0012 #include "Acts/Geometry/BoundarySurfaceFace.hpp"
0013 #include "Acts/Geometry/BoundarySurfaceT.hpp"
0014 #include "Acts/Geometry/GeometryContext.hpp"
0015 #include "Acts/Geometry/GeometryIdentifier.hpp"
0016 #include "Acts/Geometry/Layer.hpp"
0017 #include "Acts/Geometry/Portal.hpp"
0018 #include "Acts/Geometry/TrackingGeometryVisitor.hpp"
0019 #include "Acts/Geometry/TrackingVolumeVisitorConcept.hpp"
0020 #include "Acts/Geometry/Volume.hpp"
0021 #include "Acts/Material/IVolumeMaterial.hpp"
0022 #include "Acts/Navigation/NavigationDelegate.hpp"
0023 #include "Acts/Navigation/NavigationStream.hpp"
0024 #include "Acts/Propagator/NavigationTarget.hpp"
0025 #include "Acts/Surfaces/Surface.hpp"
0026 #include "Acts/Surfaces/SurfaceVisitorConcept.hpp"
0027 #include "Acts/Utilities/BinnedArray.hpp"
0028 #include "Acts/Utilities/Logger.hpp"
0029 #include "Acts/Utilities/TransformRange.hpp"
0030 #include "Acts/Utilities/TypeTraits.hpp"
0031 #include "Acts/Visualization/ViewConfig.hpp"
0032 
0033 #include <cstddef>
0034 #include <iterator>
0035 #include <memory>
0036 #include <ranges>
0037 #include <span>
0038 #include <string>
0039 #include <type_traits>
0040 #include <utility>
0041 #include <vector>
0042 
0043 #include <boost/container/container_fwd.hpp>
0044 
0045 namespace Acts {
0046 
0047 class GlueVolumesDescriptor;
0048 class VolumeBounds;
0049 template <typename object_t>
0050 struct NavigationOptions;
0051 class IMaterialDecorator;
0052 class ISurfaceMaterial;
0053 class IVolumeMaterial;
0054 class Surface;
0055 class TrackingVolume;
0056 struct GeometryIdentifierHook;
0057 class Portal;
0058 class INavigationPolicy;
0059 /// Interface types of the Gen1 geometry model
0060 /// @note This interface is being replaced, and is subject to removal
0061 /// @{
0062 
0063 // master typedefs
0064 using TrackingVolumePtr = std::shared_ptr<const TrackingVolume>;
0065 using MutableTrackingVolumePtr = std::shared_ptr<TrackingVolume>;
0066 
0067 /// @typedef TrackingVolumeBoundaryPtr
0068 /// Shared pointer to a constant BoundarySurfaceT of a TrackingVolume.
0069 using TrackingVolumeBoundaryPtr =
0070     std::shared_ptr<const BoundarySurfaceT<TrackingVolume>>;
0071 /// Type alias for collection of tracking volume boundaries
0072 using TrackingVolumeBoundaries = std::vector<TrackingVolumeBoundaryPtr>;
0073 
0074 // possible contained
0075 using TrackingVolumeArray = BinnedArray<TrackingVolumePtr>;
0076 using TrackingVolumeVector = std::vector<TrackingVolumePtr>;
0077 using MutableTrackingVolumeVector = std::vector<MutableTrackingVolumePtr>;
0078 using LayerArray = BinnedArray<LayerPtr>;
0079 using LayerVector = std::vector<LayerPtr>;
0080 
0081 /// @}
0082 
0083 /// @class TrackingVolume
0084 ///
0085 /// Full Volume description used in Tracking,
0086 /// it inherits from Volume to get the geometrical structure.
0087 ///
0088 ///     A TrackingVolume at navigation level can provide the (layer) material
0089 /// information / internal navigation with in
0090 ///     5 different ways:
0091 ///
0092 ///         --- a) Static confinement of Layers
0093 ///         --- b) detached sub volumes
0094 ///         --- b) unordered (arbitrarily oriented) layers
0095 ///         --- d) unordered sub volumes
0096 ///         --- e) unordered layers AND unordered subvolumes
0097 ///
0098 ///    The TrackingVolume can also be a simple container of other
0099 ///    TrackingVolumes
0100 ///
0101 /// In addition it is capable of holding a subarray of Layers and
0102 /// TrackingVolumes.
0103 ///
0104 class TrackingVolume : public Volume {
0105   friend class TrackingGeometry;
0106 
0107  public:
0108   TrackingVolume() = delete;
0109   ~TrackingVolume() override;
0110   TrackingVolume(const TrackingVolume&) = delete;
0111   TrackingVolume& operator=(const TrackingVolume&) = delete;
0112 
0113   // The move constructors are declared here and defined in the .cpp file to
0114   // enable forward declarations.
0115 
0116   /// Move constructor for transferring ownership of tracking volume resources.
0117   TrackingVolume(TrackingVolume&&) noexcept;
0118   /// Move assignment operator for transferring ownership of tracking volume
0119   /// resources.
0120   /// @return Reference to this TrackingVolume after move assignment
0121   TrackingVolume& operator=(TrackingVolume&&) noexcept;
0122 
0123   /// Constructor for an aligned container volume container Volume
0124   /// - vacuum filled volume either as a for other tracking volumes
0125   ///
0126   /// @param placement is the volume placement object dynamically positioning
0127   ///                  the volume in space
0128   /// @param volbounds is the description of the volume boundaries
0129   /// @param volumeName is a string identifier
0130   TrackingVolume(VolumePlacementBase& placement,
0131                  std::shared_ptr<VolumeBounds> volbounds,
0132                  const std::string& volumeName = "undefined");
0133 
0134   /// Constructor for a container Volume
0135   /// - vacuum filled volume either as a for other tracking volumes
0136   ///
0137   /// @param transform is the global 3D transform to position the volume in
0138   /// space
0139   /// @param volbounds is the description of the volume boundaries
0140   /// @param volumeName is a string identifier
0141   TrackingVolume(const Transform3& transform,
0142                  std::shared_ptr<VolumeBounds> volbounds,
0143                  const std::string& volumeName = "undefined");
0144 
0145   /// Constructor for a full equipped Tracking Volume
0146   ///
0147   /// @param transform is the global 3D transform to position the volume in
0148   /// space
0149   /// @param volumeBounds is the description of the volume boundaries
0150   /// @param volumeMaterial is are materials of the tracking volume
0151   /// @param staticLayerArray is the confined layer array (optional)
0152   /// @param containedVolumeArray are the sub volumes if the volume is a
0153   /// container
0154   /// @param denseVolumeVector  The contained dense volumes
0155   /// @param volumeName is a string identifier
0156   TrackingVolume(
0157       const Transform3& transform, std::shared_ptr<VolumeBounds> volumeBounds,
0158       std::shared_ptr<const IVolumeMaterial> volumeMaterial,
0159       std::unique_ptr<const LayerArray> staticLayerArray = nullptr,
0160       std::shared_ptr<const TrackingVolumeArray> containedVolumeArray = nullptr,
0161       MutableTrackingVolumeVector denseVolumeVector = {},
0162       const std::string& volumeName = "undefined");
0163 
0164   /// Constructor from a regular volume
0165   /// @param volume is the volume to be converted
0166   /// @param volumeName is a string identifier
0167   explicit TrackingVolume(const Volume& volume,
0168                           const std::string& volumeName = "undefined");
0169 
0170   /// Return the associated sub Volume, returns THIS if no subVolume exists
0171   /// @param gctx The current geometry context object, e.g. alignment
0172   /// @param position is the global position associated with that search
0173   /// @param tol Search position tolerance for dense volumes
0174   ///
0175   /// @return plain pointer to associated with the position
0176   const TrackingVolume* lowestTrackingVolume(const GeometryContext& gctx,
0177                                              const Vector3& position,
0178                                              const double tol = 0.) const;
0179 
0180   /// @brief Visit all reachable surfaces
0181   ///
0182   /// @tparam visitor_t Type of the callable visitor
0183   ///
0184   /// @param visitor The callable. Will be called for each reachable surface
0185   /// that is found, a selection of the surfaces can be done in the visitor
0186   /// @param restrictToSensitives If true, only sensitive surfaces are visited
0187   ///
0188   /// @note If a context is needed for the visit, the vistitor has to provide
0189   /// this, e.g. as a private member
0190   template <SurfaceVisitor visitor_t>
0191   void visitSurfaces(visitor_t&& visitor, bool restrictToSensitives) const {
0192     if (restrictToSensitives) {
0193       apply([&visitor](const Surface& surface) {
0194         if (surface.geometryId().sensitive() == 0) {
0195           return;
0196         }
0197         visitor(&surface);
0198       });
0199 
0200     } else {
0201       apply(overloaded{
0202           [&visitor](const Surface& surface) { visitor(&surface); },
0203           [&visitor](const Portal& portal) { visitor(&portal.surface()); },
0204           [&visitor](const BoundarySurface& bs) {
0205             visitor(&bs.surfaceRepresentation());
0206           }});
0207     }
0208   }
0209 
0210   /// @brief Visit all sensitive surfaces
0211   ///
0212   /// @tparam visitor_t Type of the callable visitor
0213   ///
0214   /// @param visitor The callable. Will be called for each sensitive surface
0215   /// that is found, a selection of the surfaces can be done in the visitor
0216   ///
0217   /// @note If a context is needed for the visit, the vistitor has to provide
0218   /// this, e.g. as a private member
0219   template <SurfaceVisitor visitor_t>
0220   void visitSurfaces(visitor_t&& visitor) const {
0221     visitSurfaces(std::forward<visitor_t>(visitor), true);
0222   }
0223 
0224   /// @brief Visit all reachable tracking volumes
0225   ///
0226   /// @tparam visitor_t Type of the callable visitor
0227   ///
0228   /// @param visitor The callable. Will be called for each reachable volume
0229   /// that is found, a selection of the volumes can be done in the visitor
0230   ///
0231   /// @note If a context is needed for the visit, the vistitor has to provide
0232   /// this, e.g. as a private member
0233   template <TrackingVolumeVisitor visitor_t>
0234   void visitVolumes(visitor_t&& visitor) const {
0235     apply([&visitor](const TrackingVolume& volume) { visitor(&volume); });
0236   }
0237 
0238   /// @brief Apply a visitor to the tracking volume
0239   ///
0240   /// @param visitor The visitor to apply
0241   ///
0242   void apply(TrackingGeometryVisitor& visitor) const;
0243 
0244   /// @brief Apply a mutable visitor to the tracking volume
0245   ///
0246   /// @param visitor The visitor to apply
0247   ///
0248   void apply(TrackingGeometryMutableVisitor& visitor);
0249 
0250   /// @brief Apply an arbitrary callable as a visitor to the tracking volume
0251   ///
0252   /// @param callable The callable to apply
0253   ///
0254   /// @note The visitor can be overloaded on any of the arguments that
0255   ///       the methods in @c TrackingGeometryVisitor receive.
0256   template <typename Callable>
0257   void apply(Callable&& callable)
0258     requires(detail::callableWithAnyMutable<Callable>() &&
0259              !detail::callableWithAnyConst<Callable>())
0260   {
0261     detail::TrackingGeometryLambdaMutableVisitor visitor{
0262         std::forward<Callable>(callable)};
0263     apply(visitor);
0264   }
0265 
0266   /// @brief Apply an arbitrary callable as a visitor to the tracking volume
0267   ///
0268   /// @param callable The callable to apply
0269   ///
0270   /// @note The visitor can be overloaded on any of the arguments that
0271   ///       the methods in @c TrackingGeometryMutableVisitor receive.
0272   template <typename Callable>
0273   void apply(Callable&& callable) const
0274     requires(detail::callableWithAnyConst<Callable>())
0275   {
0276     detail::TrackingGeometryLambdaVisitor visitor{
0277         std::forward<Callable>(callable)};
0278     apply(visitor);
0279   }
0280 
0281   /// Returns the VolumeName - for debug reason, might be depreciated later
0282   /// @return Reference to the volume name string
0283   const std::string& volumeName() const;
0284 
0285   /// Set the volume name to @p volumeName
0286   /// @param volumeName is the new name of
0287   void setVolumeName(std::string_view volumeName);
0288 
0289   /// Check if the volume has an associated material description
0290   /// @return True if the volume has an associated material, false otherwise
0291   bool hasMaterial() const;
0292 
0293   /// Return the material of the volume
0294   /// @return Pointer to volume material or nullptr if no material assigned
0295   const IVolumeMaterial* volumeMaterial() const;
0296 
0297   /// Return the material of the volume as shared pointer
0298   /// @return Shared pointer to volume material
0299   const std::shared_ptr<const IVolumeMaterial>& volumeMaterialPtr() const;
0300 
0301   /// Set the volume material description
0302   ///
0303   /// The material is usually derived in a complicated way and loaded from
0304   /// a framework given source. As various volumes could potentially share the
0305   /// the same material description, it is provided as a shared object
0306   ///
0307   /// @param material Material description of this volume
0308   void assignVolumeMaterial(std::shared_ptr<const IVolumeMaterial> material);
0309 
0310   /// Return the MotherVolume - if it exists
0311   /// @return Pointer to mother volume or nullptr if this is the root volume
0312   const TrackingVolume* motherVolume() const;
0313 
0314   /// Return the MotherVolume - if it exists
0315   /// @return Mutable pointer to mother volume or nullptr if this is the root volume
0316   TrackingVolume* motherVolume();
0317 
0318   /// Set the MotherVolume
0319   ///
0320   /// @param mvol is the mother volume
0321   void setMotherVolume(TrackingVolume* mvol);
0322 
0323   /// Type alias for mutable range of tracking volumes in container
0324   using MutableVolumeRange =
0325       detail::TransformRange<detail::Dereference,
0326                              std::vector<std::unique_ptr<TrackingVolume>>>;
0327   /// Type alias for const range of tracking volumes in container
0328   using VolumeRange = detail::TransformRange<
0329       detail::ConstDereference,
0330       const std::vector<std::unique_ptr<TrackingVolume>>>;
0331 
0332   /// Return all volumes registered under this tracking volume
0333   /// @return the range of volumes
0334   VolumeRange volumes() const;
0335 
0336   /// Return mutable view of the registered volumes under this tracking volume
0337   /// @return the range of volumes
0338   MutableVolumeRange volumes();
0339 
0340   /// Type alias for mutable range of portals in tracking volume
0341   using MutablePortalRange =
0342       detail::TransformRange<detail::Dereference,
0343                              std::vector<std::shared_ptr<Portal>>>;
0344 
0345   /// Type alias for const range of portals in tracking volume
0346   using PortalRange =
0347       detail::TransformRange<detail::ConstDereference,
0348                              const std::vector<std::shared_ptr<Portal>>>;
0349   /// Abrivation of the shared ptr variant holding the placements
0350   using PlacementOwnPtr =
0351       std::variant<std::shared_ptr<const VolumePlacementBase>,
0352                    std::shared_ptr<const SurfacePlacementBase>>;
0353   /// Return all portals registered under this tracking volume
0354   /// @return the range of portals
0355   PortalRange portals() const;
0356 
0357   /// Return mutable view of the registered portals under this tracking volume
0358   /// @return the range of portals
0359   MutablePortalRange portals();
0360 
0361   /// Add a portal to this tracking volume
0362   /// @param portal The portal to add
0363   void addPortal(std::shared_ptr<Portal> portal);
0364 
0365   /// Type alias for mutable range of surfaces in tracking volume
0366   using MutableSurfaceRange =
0367       detail::TransformRange<detail::Dereference,
0368                              std::vector<std::shared_ptr<Surface>>>;
0369   /// Type alias for const range of surfaces in tracking volume
0370   using SurfaceRange =
0371       detail::TransformRange<detail::ConstDereference,
0372                              const std::vector<std::shared_ptr<Surface>>>;
0373 
0374   /// Return all surfaces registered under this tracking volume
0375   /// @return the range of surfaces
0376   SurfaceRange surfaces() const;
0377 
0378   /// Return mutable view of the registered surfaces under this tracking volume
0379   /// @return the range of surfaces
0380   MutableSurfaceRange surfaces();
0381 
0382   /// Add a surface to this tracking volume
0383   /// @param surface The surface to add
0384   /// @note The volume takes shared ownership of the placement
0385   void addSurface(std::shared_ptr<Surface> surface);
0386 
0387   /// Add a child volume to this tracking volume
0388   /// @param volume The volume to add
0389   /// @note The @p volume will have its mother volume assigned to @p this.
0390   ///       It will throw if @p volume already has a mother volume set
0391   /// @return Reference to the added volume
0392   TrackingVolume& addVolume(std::unique_ptr<TrackingVolume> volume);
0393 
0394   /// Interface of @c TrackingVolume in the Gen1 geometry model
0395   /// @note This interface is being replaced, and is subject to removal
0396   ///
0397   /// @{
0398 
0399   /// Return the associated Layer to the global position
0400   ///
0401   /// @param gctx The current geometry context object, e.g. alignment
0402   /// @param position is the associated global position
0403   ///
0404   /// @return plain pointer to layer object
0405   const Layer* associatedLayer(const GeometryContext& gctx,
0406                                const Vector3& position) const;
0407 
0408   /// @brief Resolves the volume into (compatible) Layers
0409   ///
0410   /// This is the method for the propagator/extrapolator
0411   /// @tparam options_t Type of navigation options object for decomposition
0412   ///
0413   /// @param gctx The current geometry context object, e.g. alignment
0414   /// @param position Position for the search
0415   /// @param direction Direction for the search
0416   /// @param options The templated navigation options
0417   ///
0418   /// @return vector of compatible intersections with layers
0419   boost::container::small_vector<NavigationTarget, 10> compatibleLayers(
0420       const GeometryContext& gctx, const Vector3& position,
0421       const Vector3& direction, const NavigationOptions<Layer>& options) const;
0422 
0423   /// @brief Returns all boundary surfaces sorted by the user.
0424   ///
0425   /// @tparam options_t Type of navigation options object for decomposition
0426   /// @tparam sorter_t Type of the boundary surface sorter
0427   ///
0428   /// @param gctx The current geometry context object, e.g. alignment
0429   /// @param position The position for searching
0430   /// @param direction The direction for searching
0431   /// @param options The templated navigation options
0432   /// @param logger A @c Logger instance
0433   ///
0434   /// @return is the templated boundary intersection
0435   boost::container::small_vector<NavigationTarget, 4> compatibleBoundaries(
0436       const GeometryContext& gctx, const Vector3& position,
0437       const Vector3& direction, const NavigationOptions<Surface>& options,
0438       const Logger& logger = getDummyLogger()) const;
0439 
0440   /// Return the confined static layer array - if it exists
0441   /// @return the BinnedArray of static layers if exists
0442   const LayerArray* confinedLayers() const;
0443 
0444   /// Return the confined volumes of this container array - if it exists
0445   /// @return Shared pointer to array of contained tracking volumes or nullptr
0446   std::shared_ptr<const TrackingVolumeArray> confinedVolumes() const;
0447 
0448   /// Return the confined dense volumes
0449   /// @return Vector of pointers to dense tracking volumes
0450   MutableTrackingVolumeVector denseVolumes() const;
0451 
0452   /// Method to return the BoundarySurfaces
0453   /// @return Reference to vector of boundary surface pointers
0454   const TrackingVolumeBoundaries& boundarySurfaces() const;
0455 
0456   /// Set the boundary surface material description
0457   ///
0458   /// The material is usually derived in a complicated way and loaded from
0459   /// a framework given source. As various volumes could potentially share the
0460   /// the same material description, it is provided as a shared object
0461   ///
0462   /// @param surfaceMaterial Material description of this volume
0463   /// @param bsFace Specifies which boundary surface to assign the material to
0464   void assignBoundaryMaterial(
0465       std::shared_ptr<const ISurfaceMaterial> surfaceMaterial,
0466       BoundarySurfaceFace bsFace);
0467 
0468   /// Glue another tracking volume to this one
0469   ///  - if common face is set the glued volumes are sharing the boundary, down
0470   /// to the last navigation volume
0471   ///
0472   /// @param gctx The current geometry context object, e.g. alignment
0473   /// @param bsfMine is the boundary face indicator where to glue
0474   /// @param neighbor is the TrackingVolume to be glued
0475   /// @param bsfNeighbor is the boundary surface of the neighbor
0476   void glueTrackingVolume(const GeometryContext& gctx,
0477                           BoundarySurfaceFace bsfMine, TrackingVolume* neighbor,
0478                           BoundarySurfaceFace bsfNeighbor);
0479 
0480   /// Glue another tracking volume to this one
0481   ///  - if common face is set the glued volumes are sharing the boundary, down
0482   /// to the last navigation volume
0483   ///
0484   /// @param gctx The current geometry context object, e.g. alignment
0485   /// @param bsfMine is the boundary face indicator where to glue
0486   /// @param neighbors are the TrackingVolumes to be glued
0487   /// @param bsfNeighbor are the boundary surface of the neighbors
0488   void glueTrackingVolumes(
0489       const GeometryContext& gctx, BoundarySurfaceFace bsfMine,
0490       const std::shared_ptr<TrackingVolumeArray>& neighbors,
0491       BoundarySurfaceFace bsfNeighbor);
0492 
0493   /// Provide a new BoundarySurface from the glueing
0494   ///
0495   /// @param bsf is the boundary face indicator where to glue
0496   /// @param bs is the new boundary surface
0497   /// @param checkmaterial is a flag how to deal with material, if true:
0498   /// - if the old boundary surface had a material description
0499   ///   but the new one has not, keep the current one
0500   /// - in all other cases just assign the new boundary surface
0501   void updateBoundarySurface(
0502       BoundarySurfaceFace bsf,
0503       std::shared_ptr<const BoundarySurfaceT<TrackingVolume>> bs,
0504       bool checkmaterial = true);
0505 
0506   /// Register the outside glue volumes -
0507   /// ordering is in the TrackingVolume Frame:
0508   ///  - negativeFaceXY
0509   ///  - (faces YZ, ZY, radial faces)
0510   ///  - positiveFaceXY
0511   ///
0512   /// @param gvd register a new GlueVolumeDescriptor
0513   void registerGlueVolumeDescriptor(std::unique_ptr<GlueVolumesDescriptor> gvd);
0514 
0515   /// Clear boundary surfaces for this tracking volume
0516   void clearBoundarySurfaces();
0517 
0518   /// Register the outside glue volumes -
0519   /// ordering is in the TrackingVolume Frame:
0520   ///  - negativeFaceXY
0521   ///  - (faces YZ, ZY, radial faces)
0522   ///  - positiveFaceXY
0523   /// @return Reference to the glue volumes descriptor
0524   GlueVolumesDescriptor& glueVolumesDescriptor();
0525 
0526   /// Produces a 3D visualization of this tracking volume
0527   /// @param helper The visualization helper describing the output format
0528   /// @param gctx The geometry context
0529   /// @param viewConfig The view configuration
0530   /// @param portalViewConfig View configuration for portals
0531   /// @param sensitiveViewConfig View configuration for sensitive surfaces
0532   void visualize(IVisualization3D& helper, const GeometryContext& gctx,
0533                  const ViewConfig& viewConfig,
0534                  const ViewConfig& portalViewConfig,
0535                  const ViewConfig& sensitiveViewConfig) const;
0536 
0537   /// @cond
0538   using Volume::visualize;
0539   /// @endcond
0540 
0541   /// Access the navigation policy if any that is registered on this volume
0542   /// @return a pointer to the navigation policy, or nullptr if none is set
0543   const INavigationPolicy* navigationPolicy() const;
0544 
0545   /// Access the navigation policy if any that is registered on this volume
0546   /// @return a pointer to the navigation policy, or nullptr if none is set
0547   INavigationPolicy* navigationPolicy();
0548 
0549   /// Register a navigation policy with this volume. The argument can not be
0550   /// nullptr.
0551   /// @param policy is the navigation policy to be registered
0552   void setNavigationPolicy(std::unique_ptr<INavigationPolicy> policy);
0553 
0554   /// Populate the navigation stream with navigation candidates from this
0555   /// volume. Internally, this consults the registered navigation policy, where
0556   /// the default is a noop.
0557   /// @param gctx The current geometry context object, e.g. alignment
0558   /// @param args are the navigation arguments
0559   /// @param state is the navigation policy state
0560   /// @param stream is the navigation stream to be updated
0561   /// @param logger is the logger
0562   void initializeNavigationCandidates(const GeometryContext& gctx,
0563                                       const NavigationArguments& args,
0564                                       NavigationPolicyState& state,
0565                                       AppendOnlyNavigationStream& stream,
0566                                       const Logger& logger) const;
0567 
0568   /// Pass over a (Volume / Surface) placement to share owner ship
0569   /// with the volume
0570   /// @param placement: Pointer to the placement to be managed by the
0571   ///                   tracking volume
0572   void retainPlacement(PlacementOwnPtr placement) {
0573     m_placements.emplace_back(std::move(placement));
0574   }
0575 
0576   /// Returns the view on all the placements owned by the tracking volume
0577   /// @returns The const view on all the placements owned by this volume
0578   std::span<const PlacementOwnPtr> placements() const;
0579 
0580  private:
0581   void connectDenseBoundarySurfaces(
0582       MutableTrackingVolumeVector& confinedDenseVolumes);
0583 
0584   /// interlink the layers in this TrackingVolume
0585   void interlinkLayers();
0586 
0587   /// Create Boundary Surface
0588   void createBoundarySurfaces();
0589 
0590   /// method to synchronize the layers with potentially updated volume bounds:
0591   /// - adapts the layer dimensions to the new volumebounds + envelope
0592   ///
0593   /// @param envelope is the clearance between volume boundary and layer
0594   void synchronizeLayers(double envelope = 1.) const;
0595 
0596   // the boundary surfaces
0597   std::vector<TrackingVolumeBoundaryPtr> m_boundarySurfaces;
0598 
0599   ///(a) static configuration ordered by Binned arrays
0600   /// static layers
0601   std::unique_ptr<const LayerArray> m_confinedLayers = nullptr;
0602 
0603   /// Array of Volumes inside the Volume when acting as container
0604   std::shared_ptr<const TrackingVolumeArray> m_confinedVolumes = nullptr;
0605 
0606   /// confined dense
0607   MutableTrackingVolumeVector m_confinedDenseVolumes;
0608 
0609   /// Volumes to glue Volumes from the outside
0610   std::unique_ptr<GlueVolumesDescriptor> m_glueVolumeDescriptor{nullptr};
0611 
0612   /// @}
0613 
0614   /// The volume based material the TrackingVolume consists of
0615   std::shared_ptr<const IVolumeMaterial> m_volumeMaterial{nullptr};
0616 
0617   /// Remember the mother volume
0618   TrackingVolume* m_motherVolume{nullptr};
0619 
0620   /// Volume name for debug reasons & screen output
0621   std::string m_name;
0622 
0623   std::vector<std::unique_ptr<TrackingVolume>> m_volumes;
0624   std::vector<std::shared_ptr<Portal>> m_portals;
0625   std::vector<std::shared_ptr<Surface>> m_surfaces;
0626   std::vector<PlacementOwnPtr> m_placements;
0627 
0628   std::unique_ptr<INavigationPolicy> m_navigationPolicy;
0629 
0630   NavigationDelegate m_navigationDelegate{};
0631 };
0632 
0633 }  // namespace Acts