Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-19 09:23:34

0001 // This file is part of the Acts project.
0002 //
0003 // Copyright (C) 2023-2024 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 http://mozilla.org/MPL/2.0/.
0008 
0009 #pragma once
0010 
0011 #include "Acts/Definitions/Algebra.hpp"
0012 #include "Acts/Definitions/TrackParametrization.hpp"
0013 
0014 #include <iosfwd>
0015 #include <memory>
0016 #include <string>
0017 
0018 namespace Acts {
0019 
0020 class Surface;
0021 class PlaneSurface;
0022 
0023 /// @brief Utility class for curvilinear surfaces
0024 ///
0025 class CurvilinearSurface final {
0026  public:
0027   explicit CurvilinearSurface(const Vector3& direction)
0028       : m_direction{direction} {}
0029 
0030   /// Constructor with direction vector
0031   CurvilinearSurface(const Vector3& position, const Vector3& direction)
0032       : m_position{position}, m_direction{direction} {}
0033 
0034   /// Return method for the surface center by reference
0035   /// @note the center is always recalculated in order to not keep a cache
0036   /// @return center position by value
0037   Vector3 center() const { return m_position; }
0038 
0039   /// Return the surface normal at a given @p position and @p direction.
0040   /// This method is fully generic, and valid for all surface types.
0041   /// @note For some surface types, the @p direction is ignored, but
0042   ///       it is **not safe** to pass in a zero vector!
0043   /// @return The normal vector at the given position and direction
0044   Vector3 normal() const { return m_direction; }
0045 
0046   bool isStandardRepresentation() const;
0047 
0048   /// Return method for the reference frame
0049   /// This is the frame in which the covariance matrix is defined (specialized
0050   /// by all surfaces)
0051   ///
0052   /// @return RotationMatrix3 which defines the three axes of the measurement
0053   /// frame
0054   RotationMatrix3 referenceFrame() const;
0055 
0056   /// Return method for the surface Transform3 by reference
0057   /// In case a detector element is associated the surface transform
0058   /// is just forwarded to the detector element in order to keep the
0059   /// (mis-)alignment cache cetrally handled
0060   ///
0061   /// @return the contextual transform
0062   Transform3 transform() const;
0063 
0064   /// Calculate the jacobian from local to global which the surface knows best,
0065   /// hence the calculation is done here.
0066   ///
0067   /// @return Jacobian from local to global
0068   BoundToFreeMatrix boundToFreeJacobian() const;
0069 
0070   /// Calculate the jacobian from global to local which the surface knows best,
0071   /// hence the calculation is done here.
0072   ///
0073   /// @return Jacobian from global to local
0074   FreeToBoundMatrix freeToBoundJacobian() const;
0075 
0076   /// Calculate the derivative of path length at the geometry constraint or
0077   /// point-of-closest-approach w.r.t. free parameters. The calculation is
0078   /// identical for all surfaces where the reference frame does not depend on
0079   /// the direction
0080   ///
0081   /// @return Derivative of path length w.r.t. free parameters
0082   FreeToPathMatrix freeToPathDerivative() const;
0083 
0084   /// Output Method for std::ostream
0085   ///
0086   /// @param sl is the ostream to be dumped into
0087   std::ostream& toStream(std::ostream& sl) const;
0088 
0089   /// Output into a std::string
0090   ///
0091   /// @return the string representation of the curvilinear surface
0092   std::string toString() const;
0093 
0094   /// Return the plane surface representation of the curvilinear surface
0095   ///
0096   /// @return the plane surface representation of the curvilinear surface
0097   std::shared_ptr<PlaneSurface> planeSurface() const;
0098 
0099   /// Return the surface representation of the curvilinear surface
0100   ///
0101   /// @note same as planeSurface() but returns the base class.
0102   ///   This is useful if the type of the surface is not relevant.
0103   ///
0104   /// @return the surface representation of the curvilinear surface
0105   std::shared_ptr<Surface> surface() const;
0106 
0107   /// Output operator
0108   ///
0109   /// @param os is the ostream to be dumped into
0110   /// @param surface is the CurvilinearSurface to be dumped
0111   /// @return the ostream
0112   friend std::ostream& operator<<(std::ostream& os,
0113                                   const CurvilinearSurface& surface);
0114 
0115  private:
0116   Vector3 m_position = Vector3::Zero();
0117   Vector3 m_direction = Vector3::UnitZ();
0118 };
0119 
0120 }  // namespace Acts