Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /acts/Core/include/Acts/Geometry/NavigationLayer.hpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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 #include "Acts/Geometry/Layer.hpp"
0014 #include "Acts/Surfaces/BoundaryTolerance.hpp"
0015 #include "Acts/Surfaces/Surface.hpp"
0016 #include "Acts/Utilities/AxisDefinitions.hpp"
0017 
0018 #include <memory>
0019 #include <utility>
0020 
0021 namespace Acts {
0022 
0023 /// @class NavigationLayer
0024 ///
0025 /// Class to be used for gaps in Volumes as a navigational link.
0026 /// Navigation Layers have a surface representation, but should usually never be
0027 /// propagated to.
0028 class NavigationLayer : public Layer {
0029  public:
0030   ///  Factory Constructor - the surface representation is given by pointer
0031   /// (ownership passed)
0032   ///
0033   /// @param sRepresentation is the representation for extrapolation
0034   /// @param thickness is the thickness for the binning
0035   /// @return Shared pointer to the created navigation layer
0036   static LayerPtr create(std::shared_ptr<const Surface> sRepresentation,
0037                          double thickness = 0.) {
0038     return LayerPtr(new NavigationLayer(std::move(sRepresentation), thickness));
0039   }
0040 
0041   /// Destructor
0042   ~NavigationLayer() override;
0043 
0044   /// The binning position method
0045   ///
0046   /// @param gctx The current geometry context object, e.g. alignment
0047   /// @param aDir is the axis direction for which the reference position is requested
0048   ///  - as default the center is given, but may be overloaded
0049   ///
0050   /// @return The return vector can be used for binning in a TrackingVolume
0051   Vector3 referencePosition(const GeometryContext& gctx,
0052                             AxisDirection aDir) const final;
0053 
0054   /// Default Constructor - deleted
0055   NavigationLayer() = delete;
0056 
0057   /// Copy Constructor - deleted
0058   NavigationLayer(const NavigationLayer&) = delete;
0059 
0060   /// Assignment operator - deleted
0061   NavigationLayer& operator=(const NavigationLayer&) = delete;
0062 
0063   /// Transforms the layer into a Surface representation for extrapolation
0064   /// In general, extrapolation to a surface should be avoided
0065   /// @return Const reference to the navigation surface
0066   const Surface& surfaceRepresentation() const final;
0067 
0068   /// Non-const version of surface representation access
0069   /// @return Mutable reference to the navigation surface
0070   Surface& surfaceRepresentation() final;
0071 
0072   /// Geometric isOnLayer() method
0073   /// using isOnSurface() with Layer specific tolerance
0074   ///
0075   /// @param gctx The current geometry context object, e.g. alignment
0076   /// @param gp is the global position for the check
0077   /// @param boundaryTolerance is the boundary check directive
0078   ///
0079   /// @return boolean that indicates if the position is on surface
0080   bool isOnLayer(const GeometryContext& gctx, const Vector3& gp,
0081                  const BoundaryTolerance& boundaryTolerance =
0082                      BoundaryTolerance::None()) const final;
0083 
0084   /// Accept layer according to the following collection directives
0085   ///
0086   /// @param resolveSensitive is the prescription to find the sensitive surfaces
0087   /// @param resolveMaterial is the precription to find material surfaces
0088   /// @param resolvePassive is the prescription to find all passive surfaces
0089   ///
0090   /// @note navigation layers are never accepted
0091   ///
0092   /// @return a boolean whether the layer is accepted for processing
0093   bool resolve(bool resolveSensitive, bool resolveMaterial,
0094                bool resolvePassive) const final;
0095 
0096  protected:
0097   /// Private Constructor
0098   /// - this is called by the creat(args*) method
0099   /// passed spacer layer if needed
0100   ///
0101   /// @param surfaceRepresentation is the surface of the layer
0102   /// @param thickness ithe layer thickness
0103   NavigationLayer(std::shared_ptr<const Surface> surfaceRepresentation,
0104                   double thickness);
0105 
0106   /// for the navigation Volume the surface
0107   ///
0108   /// We will need to mutate this surface during the geometry building process,
0109   /// but the C++ type system has no const-correct way of expressing this.
0110   ///
0111   std::shared_ptr<const Surface> m_surfaceRepresentation;
0112 };
0113 
0114 inline const Surface& NavigationLayer::surfaceRepresentation() const {
0115   return (*m_surfaceRepresentation);
0116 }
0117 
0118 inline Surface& NavigationLayer::surfaceRepresentation() {
0119   return *(const_cast<Surface*>(m_surfaceRepresentation.get()));
0120 }
0121 
0122 inline Vector3 NavigationLayer::referencePosition(const GeometryContext& gctx,
0123                                                   AxisDirection aDir) const {
0124   return m_surfaceRepresentation->referencePosition(gctx, aDir);
0125 }
0126 
0127 inline bool NavigationLayer::isOnLayer(
0128     const GeometryContext& gctx, const Vector3& gp,
0129     const BoundaryTolerance& boundaryTolerance) const {
0130   return m_surfaceRepresentation->isOnSurface(gctx, gp, Vector3::Zero(),
0131                                               boundaryTolerance);
0132 }
0133 
0134 inline bool NavigationLayer::resolve(bool /*resolveSensitive*/,
0135                                      bool /*resolveMaterial*/,
0136                                      bool /*reolvePassive*/) const {
0137   return false;
0138 }
0139 
0140 }  // namespace Acts