From b4e9433dce231ba1cfb55e756f17ed2ca29ba206 Mon Sep 17 00:00:00 2001
From: Andreas Salzburger <Andreas.Salzburger@cern.ch>
Date: Mon, 25 Nov 2019 15:13:18 +0100
Subject: [PATCH] fixing MR comments

---
 Core/include/Acts/Surfaces/TrapezoidBounds.hpp        |  2 +-
 Core/include/Acts/Surfaces/TriangleBounds.hpp         |  2 +-
 Core/include/Acts/Surfaces/detail/ConeSurface.ipp     | 11 ++++-------
 Core/include/Acts/Surfaces/detail/CylinderSurface.ipp |  6 +++---
 Core/include/Acts/Surfaces/detail/PlanarHelper.hpp    |  2 +-
 Core/include/Acts/Utilities/Intersection.hpp          |  2 +-
 Core/src/Geometry/GenericApproachDescriptor.cpp       |  2 +-
 Tests/Core/Surfaces/SurfaceIntersectionTests.cpp      |  6 +++---
 8 files changed, 15 insertions(+), 18 deletions(-)

diff --git a/Core/include/Acts/Surfaces/TrapezoidBounds.hpp b/Core/include/Acts/Surfaces/TrapezoidBounds.hpp
index 45280c83e..d948f616f 100644
--- a/Core/include/Acts/Surfaces/TrapezoidBounds.hpp
+++ b/Core/include/Acts/Surfaces/TrapezoidBounds.hpp
@@ -61,7 +61,7 @@ class TrapezoidBounds : public PlanarBounds {
   /// intersects
   /// with the negative @f$ y @f$ - axis of the local frame.
   ///
-  /// @param lpos is the local position to be checked (carthesian local frame)
+  /// @param lpos is the local position to be checked (Cartesian local frame)
   /// @param bcheck is the boundary check directive
   ///
   /// <br>
diff --git a/Core/include/Acts/Surfaces/TriangleBounds.hpp b/Core/include/Acts/Surfaces/TriangleBounds.hpp
index 2430cbaa0..000f4c0a6 100644
--- a/Core/include/Acts/Surfaces/TriangleBounds.hpp
+++ b/Core/include/Acts/Surfaces/TriangleBounds.hpp
@@ -58,7 +58,7 @@ class TriangleBounds : public PlanarBounds {
   /// This method checks if the provided local coordinates are inside the
   /// surface bounds
   ///
-  /// @param lposition local position in 2D local carthesian frame
+  /// @param lposition local position in 2D local Cartesian frame
   /// @param bcheck is the boundary check directive
   /// @return boolean indicator for the success of this operation
   bool inside(const Vector2D& lposition,
diff --git a/Core/include/Acts/Surfaces/detail/ConeSurface.ipp b/Core/include/Acts/Surfaces/detail/ConeSurface.ipp
index ab9f44de6..ab7e6f3e5 100644
--- a/Core/include/Acts/Surfaces/detail/ConeSurface.ipp
+++ b/Core/include/Acts/Surfaces/detail/ConeSurface.ipp
@@ -13,14 +13,11 @@
 inline detail::RealQuadraticEquation ConeSurface::intersectionSolver(
     const GeometryContext& gctx, const Vector3D& position,
     const Vector3D& direction) const {
-  // Create the points
-  Vector3D point1 = position;
-  Vector3D dir1 = direction;
 
   // Transform into the local frame
   Transform3D invTrans = transform(gctx).inverse();
-  point1 = invTrans * position;
-  dir1 = invTrans.linear() * direction;
+  Vector3D point1 = invTrans * position;
+  Vector3Ddir1 = invTrans.linear() * direction;
 
   // See file header for the formula derivation
   double tan2Alpha = bounds().tanAlpha() * bounds().tanAlpha(),
@@ -69,7 +66,7 @@ inline Intersection ConeSurface::intersectionEstimate(
 inline SurfaceIntersection ConeSurface::intersect(
     const GeometryContext& gctx, const Vector3D& position,
     const Vector3D& direction, const BoundaryCheck& bcheck) const {
-  // Solve the quadratic euation
+  // Solve the quadratic equation
   auto qe = intersectionSolver(gctx, position, direction);
 
   // If no valid solution return a non-valid surfaceIntersection
@@ -88,7 +85,7 @@ inline SurfaceIntersection ConeSurface::intersect(
     status1 = Intersection::Status::missed;
   }
 
-  // Check the validity of the secind solution
+  // Check the validity of the second solution
   Vector3D solution2 = position + qe.first * direction;
   Intersection::Status status2 =
       (qe.second * qe.second < s_onSurfaceTolerance * s_onSurfaceTolerance)
diff --git a/Core/include/Acts/Surfaces/detail/CylinderSurface.ipp b/Core/include/Acts/Surfaces/detail/CylinderSurface.ipp
index c7433b399..f5bf742e2 100644
--- a/Core/include/Acts/Surfaces/detail/CylinderSurface.ipp
+++ b/Core/include/Acts/Surfaces/detail/CylinderSurface.ipp
@@ -41,7 +41,7 @@ inline detail::RealQuadraticEquation CylinderSurface::intersectionSolver(
 inline Intersection CylinderSurface::intersectionEstimate(
     const GeometryContext& gctx, const Vector3D& position,
     const Vector3D& direction, const BoundaryCheck& bcheck) const {
-  // Solve the quadratic euation
+  // Solve the quadratic equation
   auto qe = intersectionSolver(gctx, position, direction);
 
   // If no valid solution return a non-valid intersection
@@ -70,7 +70,7 @@ inline Intersection CylinderSurface::intersectionEstimate(
 inline SurfaceIntersection CylinderSurface::intersect(
     const GeometryContext& gctx, const Vector3D& position,
     const Vector3D& direction, const BoundaryCheck& bcheck) const {
-  // Solve the quadratic euation
+  // Solve the quadratic equation
   auto qe = intersectionSolver(gctx, position, direction);
 
   // If no valid solution return a non-valid surfaceIntersection
@@ -88,7 +88,7 @@ inline SurfaceIntersection CylinderSurface::intersect(
     status1 = Intersection::Status::missed;
   }
 
-  // Check the validity of second the solution
+  // Check the validity of the second solution
   Vector3D solution2 = position + qe.second * direction;
   Intersection::Status status2 =
       qe.second * qe.second < s_onSurfaceTolerance * s_onSurfaceTolerance
diff --git a/Core/include/Acts/Surfaces/detail/PlanarHelper.hpp b/Core/include/Acts/Surfaces/detail/PlanarHelper.hpp
index 5d9280801..303a61ef8 100644
--- a/Core/include/Acts/Surfaces/detail/PlanarHelper.hpp
+++ b/Core/include/Acts/Surfaces/detail/PlanarHelper.hpp
@@ -28,7 +28,7 @@ namespace PlanarHelper {
 static Intersection intersectionEstimate(const Transform3D& transform,
                                          const Vector3D& position,
                                          const Vector3D& direction) {
-  // Get the matrix form the transform (faster access)
+  // Get the matrix from the transform (faster access)
   const auto& tMatrix = transform.matrix();
   const Vector3D pnormal = tMatrix.block<3, 1>(0, 2).transpose();
   const Vector3D pcenter = tMatrix.block<3, 1>(0, 3).transpose();
diff --git a/Core/include/Acts/Utilities/Intersection.hpp b/Core/include/Acts/Utilities/Intersection.hpp
index 8e6af984b..b8b42f2ee 100644
--- a/Core/include/Acts/Utilities/Intersection.hpp
+++ b/Core/include/Acts/Utilities/Intersection.hpp
@@ -30,7 +30,7 @@ struct Intersection {
 
   /// Position of the intersection
   Vector3D position{0., 0., 0.};
-  /// Singed path length to the intersection (if valid)
+  /// Signed path length to the intersection (if valid)
   double pathLength{std::numeric_limits<double>::infinity()};
   /// The Status of the intersection
   Status status{Status::unreachable};
diff --git a/Core/src/Geometry/GenericApproachDescriptor.cpp b/Core/src/Geometry/GenericApproachDescriptor.cpp
index 5f720d132..42f87cf25 100644
--- a/Core/src/Geometry/GenericApproachDescriptor.cpp
+++ b/Core/src/Geometry/GenericApproachDescriptor.cpp
@@ -31,7 +31,7 @@ Acts::GenericApproachDescriptor::approachSurface(
         sf->intersectionEstimate(gctx, position, direction, bcheck);
     sIntersections.push_back(ObjectIntersection<Surface>(intersection, sf));
   }
-  // Sor them & return the closest
+  // Sort them & return the closest
   std::sort(sIntersections.begin(), sIntersections.end());
   return (*sIntersections.begin());
 }
diff --git a/Tests/Core/Surfaces/SurfaceIntersectionTests.cpp b/Tests/Core/Surfaces/SurfaceIntersectionTests.cpp
index 4ea02f4f0..33b4444a3 100644
--- a/Tests/Core/Surfaces/SurfaceIntersectionTests.cpp
+++ b/Tests/Core/Surfaces/SurfaceIntersectionTests.cpp
@@ -229,7 +229,7 @@ BOOST_AUTO_TEST_CASE(ConeIntersectionTest) {
 
 /// This tests the interseciton with planar surfaces (plane, disk)
 /// as those share the same PlanarHelper methods, only one test is
-/// sufficienct
+/// sufficient
 /// - it looks for valid, non-valid, solutions
 BOOST_AUTO_TEST_CASE(PlanarIntersectionTest) {
   double halfX = 1_m;
@@ -323,7 +323,7 @@ BOOST_AUTO_TEST_CASE(PlanarIntersectionTest) {
 
 /// This tests the interseciton with line like surfaces (straw, perigee)
 /// as those share the same methods, only one test is
-/// sufficienct
+/// sufficient
 /// - it looks for valid, non-valid, solutions
 BOOST_AUTO_TEST_CASE(LineIntersectionTest) {
   double radius = 1_m;
@@ -373,7 +373,7 @@ BOOST_AUTO_TEST_CASE(LineIntersectionTest) {
     // The intersection MUST be unique
     BOOST_CHECK(oIntersection.alternatives.size() == 0);
 
-    // On surface intersecion - offise the straw but normal vecot
+    // On surface intersecion - on the surface with normal vector
     oIntersection = aLine->intersect(tgContext, onitP, normalP, true);
     // The intersection MUST be valid
     BOOST_CHECK(oIntersection);
-- 
GitLab