Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-10-23 08:19:41

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/GeometryContext.hpp"
0013 
0014 #include <functional>
0015 #include <memory>
0016 
0017 namespace Acts {
0018 class Logger;
0019 class TrackingVolume;
0020 
0021 /// Immutable point-to-volume lookup policy owned by a TrackingVolume.
0022 /// Implementations must preserve lowestTrackingVolume containment, tolerance,
0023 /// first-matching-sibling precedence and parent fallback semantics. Referenced
0024 /// volumes must outlive the policy and retain their addresses. Queries must
0025 /// support concurrent readers; install policies before concurrent use.
0026 class IVolumeLookup {
0027  public:
0028   virtual ~IVolumeLookup() = default;
0029 
0030   /// Find the lowest containing volume, or nullptr outside the bound root
0031   /// volume. Respect explicit descendant lookups as delegation boundaries.
0032   /// @param gctx Geometry context for containment checks
0033   /// @param position Global query position
0034   /// @param tolerance Containment tolerance
0035   /// @return Containing tracking volume
0036   virtual const TrackingVolume* findLowest(const GeometryContext& gctx,
0037                                            const Vector3& position,
0038                                            double tolerance) const = 0;
0039 };
0040 /// Construct a non-null lookup for a volume after its descendants are
0041 /// finalized.
0042 using VolumeLookupFactory = std::function<std::unique_ptr<IVolumeLookup>(
0043     const GeometryContext&, const TrackingVolume&, const Logger&)>;
0044 }  // namespace Acts