|
|
|||
File indexing completed on 2026-11-05 09:57:54
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/Definitions/Alignment.hpp" 0013 #include "Acts/Definitions/Tolerance.hpp" 0014 #include "Acts/Geometry/GeometryContext.hpp" 0015 #include "Acts/Geometry/Polyhedron.hpp" 0016 #include "Acts/Surfaces/BoundaryTolerance.hpp" 0017 #include "Acts/Surfaces/ConeBounds.hpp" 0018 #include "Acts/Surfaces/RegularSurface.hpp" 0019 #include "Acts/Surfaces/Surface.hpp" 0020 #include "Acts/Surfaces/SurfaceConcept.hpp" 0021 #include "Acts/Utilities/AxisDefinitions.hpp" 0022 #include "Acts/Utilities/Result.hpp" 0023 #include "Acts/Utilities/detail/RealQuadraticEquation.hpp" 0024 0025 #include <memory> 0026 #include <numbers> 0027 #include <string> 0028 0029 namespace Acts { 0030 0031 /// @class ConeSurface 0032 /// 0033 /// Class for a conical surface in the Tracking geometry. 0034 /// It inherits from Surface. 0035 /// 0036 /// The ConeSurface is special since no corresponding 0037 /// Track parameters exist since they're numerical instable 0038 /// at the tip of the cone. 0039 /// Propagations to a cone surface will be returned in 0040 /// curvilinear coordinates. 0041 /// 0042 class ConeSurface : public RegularSurface { 0043 friend class Surface; 0044 0045 protected: 0046 /// Constructor form HepTransform and an opening angle 0047 /// 0048 /// @param transform is the transform to place to cone in a 3D frame 0049 /// @param alpha is the opening angle of the cone 0050 /// @param symmetric indicates if the cones are built to +/1 z 0051 ConeSurface(const Transform3& transform, double alpha, 0052 bool symmetric = false); 0053 0054 /// Constructor form HepTransform and an opening angle 0055 /// 0056 /// @param transform is the transform that places the cone in the global frame 0057 /// @param alpha is the opening angle of the cone 0058 /// @param zmin is the z range over which the cone spans 0059 /// @param zmax is the z range over which the cone spans 0060 /// @param halfPhi is the opening angle for cone ssectors 0061 ConeSurface(const Transform3& transform, double alpha, double zmin, 0062 double zmax, double halfPhi = std::numbers::pi); 0063 0064 /// Constructor from HepTransform and ConeBounds 0065 /// 0066 /// @param transform is the transform that places the cone in the global frame 0067 /// @param cbounds is the boundary class, the bounds must exit 0068 ConeSurface(const Transform3& transform, 0069 std::shared_ptr<const ConeBounds> cbounds); 0070 0071 /// Copy constructor 0072 /// 0073 /// @param other is the source cone surface 0074 ConeSurface(const ConeSurface& other); 0075 0076 /// Copy constructor - with shift 0077 /// 0078 /// @param gctx The current geometry context object, e.g. alignment 0079 /// @param other is the source cone surface 0080 /// @param shift is the additional transform applied after copying 0081 ConeSurface(const GeometryContext& gctx, const ConeSurface& other, 0082 const Transform3& shift); 0083 0084 public: 0085 ~ConeSurface() override = default; 0086 0087 /// Assignment operator 0088 /// 0089 /// @param other is the source surface for the assignment 0090 /// @return Reference to this ConeSurface after assignment 0091 ConeSurface& operator=(const ConeSurface& other); 0092 0093 /// The binning position method - is overloaded for r-type binning 0094 /// 0095 /// @param gctx The current geometry context object, e.g. alignment 0096 /// @param aDir defines the direction of binning applied in the global frame 0097 /// 0098 /// @return The return type is a vector for positioning in the global frame 0099 Vector3 referencePosition(const GeometryContext& gctx, 0100 AxisDirection aDir) const final; 0101 0102 /// Return the surface type 0103 /// @return Surface type identifier 0104 SurfaceType type() const override; 0105 0106 /// Return the measurement frame - this is needed for alignment, in particular 0107 /// for StraightLine and Perigee Surface 0108 /// - the default implementation is the RotationMatrix3 of the transform 0109 /// 0110 /// @param gctx The current geometry context object, e.g. alignment 0111 /// @param position is the global position where the measurement frame is 0112 /// constructed 0113 /// @param direction is the momentum direction used for the measurement frame 0114 /// construction 0115 /// @return matrix that indicates the measurement frame 0116 RotationMatrix3 referenceFrame(const GeometryContext& gctx, 0117 const Vector3& position, 0118 const Vector3& direction) const final; 0119 0120 /// Return method for surface normal information 0121 /// 0122 /// @param gctx The current geometry context object, e.g. alignment 0123 /// @param lposition is the local position at normal vector request 0124 /// @return Vector3 normal vector in global frame 0125 Vector3 normal(const GeometryContext& gctx, 0126 const Vector2& lposition) const final; 0127 0128 /// Return method for surface normal information 0129 /// 0130 /// @param gctx The current geometry context object, e.g. alignment 0131 /// @param position is the global position as normal vector base 0132 /// @return Vector3 normal vector in global frame 0133 Vector3 normal(const GeometryContext& gctx, 0134 const Vector3& position) const final; 0135 0136 // Return method for the rotational symmetry axis 0137 /// 0138 /// @param gctx The current geometry context object, e.g. alignment 0139 /// 0140 /// @return The local z axis vector 0141 virtual Vector3 rotSymmetryAxis(const GeometryContext& gctx) const; 0142 0143 /// This method returns the ConeBounds by reference 0144 /// @return Reference to the cone bounds 0145 const ConeBounds& bounds() const final; 0146 /// This method returns the shared_ptr to the ConeBounds 0147 /// @return Shared pointer to the cone bounds 0148 const std::shared_ptr<const ConeBounds>& boundsPtr() const; 0149 /// Overwrite the existing surface bounds with new ones 0150 /// @param newBounds: Pointer to the new bounds 0151 void assignSurfaceBounds(std::shared_ptr<const ConeBounds> newBounds); 0152 0153 /// Local to global transformation 0154 /// 0155 /// @param gctx The current geometry context object, e.g. alignment 0156 /// @param lposition is the local position to be transformed 0157 /// 0158 /// @return The global position by value 0159 Vector3 localToGlobal(const GeometryContext& gctx, 0160 const Vector2& lposition) const final; 0161 0162 // Use overloads from `RegularSurface` 0163 using RegularSurface::globalToLocal; 0164 using RegularSurface::localToGlobal; 0165 using RegularSurface::normal; 0166 0167 /// Global to local transformation 0168 /// 0169 /// @param gctx The current geometry context object, e.g. alignment 0170 /// @param position is the global position to be transformed 0171 /// @param tolerance optional tolerance within which a point is considered 0172 /// valid on surface 0173 /// 0174 /// @return a Result<Vector2> which can be !ok() if the operation fails 0175 Result<Vector2> globalToLocal( 0176 const GeometryContext& gctx, const Vector3& position, 0177 double tolerance = s_onSurfaceTolerance) const final; 0178 0179 /// Straight line intersection schema from position/direction 0180 /// 0181 /// @param gctx The current geometry context object, e.g. alignment 0182 /// @param position The position to start from 0183 /// @param direction The direction at start 0184 /// @param boundaryTolerance the Boundary Check 0185 /// @param tolerance the tolerance used for the intersection 0186 /// 0187 /// If possible returns both solutions for the cylinder 0188 /// 0189 /// @return @c MultiIntersection3D object (contains intersection & surface) 0190 MultiIntersection3D intersect( 0191 const GeometryContext& gctx, const Vector3& position, 0192 const Vector3& direction, 0193 const BoundaryTolerance& boundaryTolerance = 0194 BoundaryTolerance::Infinite(), 0195 double tolerance = s_onSurfaceTolerance) const final; 0196 0197 /// The pathCorrection for derived classes with thickness 0198 /// 0199 /// @param gctx The current geometry context object, e.g. alignment 0200 /// @param position is the global potion at the correction point 0201 /// @param direction is the momentum direction at the correction point 0202 /// @return is the path correction due to incident angle 0203 double pathCorrection(const GeometryContext& gctx, const Vector3& position, 0204 const Vector3& direction) const final; 0205 0206 /// Return a Polyhedron for the surfaces 0207 /// 0208 /// @param gctx The current geometry context object, e.g. alignment 0209 /// @param quarterSegments Number of segments used to approximate a quarter 0210 /// 0211 /// @note The phi extrema points at (-pi, -1/2 pi, 0, 1/2 pi) that fall within 0212 /// the surface will be inserted to guarantee an appropriate extent 0213 /// measurement in x and y 0214 /// 0215 /// @return A list of vertices and a face/facett description of it 0216 Polyhedron polyhedronRepresentation( 0217 const GeometryContext& gctx, 0218 unsigned int quarterSegments = 2u) const override; 0219 0220 /// Return properly formatted class name for screen output 0221 /// @return String representation of the class name 0222 std::string name() const override; 0223 0224 /// Calculate the derivative of path length at the geometry constraint or 0225 /// point-of-closest-approach w.r.t. alignment parameters of the surface (i.e. 0226 /// local frame origin in global 3D Cartesian coordinates and its rotation 0227 /// represented with extrinsic Euler angles) 0228 /// 0229 /// @param gctx The current geometry context object, e.g. alignment 0230 /// @param position global 3D position 0231 /// @param direction global 3D momentum direction 0232 /// 0233 /// @return Derivative of path length w.r.t. the alignment parameters 0234 AlignmentToPathMatrix alignmentToPathDerivative( 0235 const GeometryContext& gctx, const Vector3& position, 0236 const Vector3& direction) const final; 0237 0238 /// Calculate the derivative of bound track parameters local position w.r.t. 0239 /// position in local 3D Cartesian coordinates 0240 /// 0241 /// @param gctx The current geometry context object, e.g. alignment 0242 /// @param position The position of the parameters in global 0243 /// 0244 /// @return Derivative of bound local position w.r.t. position in local 3D 0245 /// cartesian coordinates 0246 Matrix<2, 3> localCartesianToBoundLocalDerivative( 0247 const GeometryContext& gctx, const Vector3& position) const final; 0248 0249 protected: 0250 std::shared_ptr<const ConeBounds> m_bounds; ///< bounds (shared) 0251 0252 /// @copydoc Surface::localAxes 0253 std::array<AxisDirection, 2> localAxes() const override { 0254 return {AxisDirection::AxisRPhi, AxisDirection::AxisZ}; 0255 } 0256 0257 private: 0258 /// Implementation of the intersection solver 0259 /// 0260 /// <b>mathematical motivation:</b> 0261 /// 0262 /// The calculation will be done in the 3-dim frame of the cone, 0263 /// i.e. the symmetry axis of the cone is the z-axis, x- and y-axis are 0264 /// perpendicular 0265 /// to the z-axis. In this frame the cone is centered around the origin. 0266 /// Therefore the two points describing the line have to be first 0267 /// recalculated 0268 /// into the new frame. 0269 /// Suppose, this is done, the points of intersection can be 0270 /// obtained as follows:<br> 0271 /// 0272 /// The cone is described by the implicit equation 0273 /// @f$x^2 + y^2 = z^2 \tan \alpha@f$ 0274 /// where @f$\alpha@f$ is opening half-angle of the cone the and 0275 /// the line by the parameter equation (with @f$t@f$ the 0276 /// parameter and @f$x_1@f$ and @f$x_2@f$ are points on the line) 0277 /// @f$(x,y,z) = \vec x_1 + (\vec x_2 - \vec x_2) t @f$. 0278 /// The intersection is the given to the value of @f$t@f$ where 0279 /// the @f$(x,y,z)@f$ coordinates of the line satisfy the implicit 0280 /// equation of the cone. Inserting the expression for the points 0281 /// on the line into the equation of the cone and rearranging to 0282 /// the form of a gives (letting @f$ \vec x_d = \frac{\vec x_2 - \vec 0283 /// x_1}{|\vec x_2 - \vec x_1|} @f$): 0284 /// @f$t^2 (x_d^2 + y_d^2 - z_d^2 \tan^2 \alpha) + 2 t (x_1 x_d + 0285 /// y_1 y_d - z_1 z_d \tan^2 \alpha) + (x_1^2 + y_1^2 - z_1^2 0286 /// \tan^2 \alpha) = 0 @f$ 0287 /// Solving the above for @f$t@f$ and putting the values into the 0288 /// equation of the line gives the points of intersection. @f$t@f$ 0289 /// is also the length of the path, since we normalized @f$x_d@f$ 0290 /// to be unit length. 0291 /// 0292 /// @return the quadratic equation 0293 detail::RealQuadraticEquation intersectionSolver( 0294 const GeometryContext& gctx, const Vector3& position, 0295 const Vector3& direction) const; 0296 }; 0297 0298 static_assert(RegularSurfaceConcept<ConeSurface>, 0299 "ConeSurface does not fulfill RegularSurfaceConcept"); 0300 0301 } // namespace Acts
| [ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
|
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
|