Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-11-03 08:57:00

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/ApproachDescriptor.hpp"
0013 #include "Acts/Geometry/GeometryContext.hpp"
0014 #include "Acts/Propagator/NavigationTarget.hpp"
0015 #include "Acts/Surfaces/BoundaryTolerance.hpp"
0016 #include "Acts/Surfaces/Surface.hpp"
0017 #include "Acts/Utilities/Helpers.hpp"
0018 
0019 #include <memory>
0020 #include <utility>
0021 #include <vector>
0022 
0023 namespace Acts {
0024 
0025 class Layer;
0026 class Surface;
0027 
0028 /// @class GenericApproachDescriptor
0029 ///
0030 /// Class to decide and return which approaching surface to be taken,
0031 /// it's a generic descriptor for n surfaces
0032 class GenericApproachDescriptor : public ApproachDescriptor {
0033  public:
0034   /// A generic approach descriptor for new Acts::Surface objects
0035   /// passing ownership
0036   ///
0037   /// @param aSurfaces are the approach surfaces
0038   explicit GenericApproachDescriptor(
0039       std::vector<std::shared_ptr<const Surface>> aSurfaces)
0040       : ApproachDescriptor(),
0041         m_surfaces(std::move(aSurfaces)),
0042         m_surfaceCache() {
0043     m_surfaceCache = unpackSmartPointers(m_surfaces);
0044   }
0045 
0046   /// @brief Register the Layer to the surfaces
0047   ///
0048   /// @param lay is the layer to be registered
0049   void registerLayer(const Layer& lay) override;
0050 
0051   /// Get the approach surface to the layer
0052   ///
0053   /// @param gctx The current geometry context object, e.g. alignment
0054   /// @param position The global position to start the approach from
0055   /// @param direction The momentum vector
0056   /// @param boundaryTolerance The boundary check prescription
0057   /// @param nearLimit The minimum distance for an intersection to be considered
0058   /// @param farLimit The maximum distance for an intersection to be considered
0059   ///
0060   /// @return : a @c NavigationTarget
0061   NavigationTarget approachSurface(const GeometryContext& gctx,
0062                                    const Vector3& position,
0063                                    const Vector3& direction,
0064                                    const BoundaryTolerance& boundaryTolerance,
0065                                    double nearLimit,
0066                                    double farLimit) const override;
0067 
0068   /// return all contained surfaces of this approach descriptor
0069   /// @return Const reference to vector of contained surface pointers
0070   const std::vector<const Surface*>& containedSurfaces() const override;
0071 
0072   /// Non-const version
0073   /// @return Mutable reference to vector of contained surface pointers
0074   std::vector<const Surface*>& containedSurfaces() override;
0075 
0076  private:
0077   /// approach surfaces with ownership control
0078   std::vector<std::shared_ptr<const Surface>> m_surfaces;
0079 
0080   /// the surface container cache
0081   ///
0082   /// We will need to mutate those surfaces in registerLayer, but the C++ type
0083   /// system has no const-correct way of expressing this constraint.
0084   ///
0085   std::vector<const Surface*> m_surfaceCache;
0086 };
0087 
0088 }  // namespace Acts