Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:11:30

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 #include "Acts/Surfaces/RegularSurface.hpp"
0010 
0011 #include "Acts/Definitions/Algebra.hpp"
0012 #include "Acts/Geometry/GeometryContext.hpp"
0013 
0014 namespace Acts {
0015 
0016 Vector3 RegularSurface::normal(const GeometryContext& gctx, const Vector3& pos,
0017                                const Vector3& /*direction*/) const {
0018   return normal(gctx, pos);
0019 }
0020 
0021 Result<Vector2> RegularSurface::globalToLocal(const GeometryContext& gctx,
0022                                               const Vector3& position,
0023                                               const Vector3& /*direction*/,
0024                                               double tolerance) const {
0025   return globalToLocal(gctx, position, tolerance);
0026 }
0027 
0028 Vector3 RegularSurface::localToGlobal(const GeometryContext& gctx,
0029                                       const Vector2& lposition,
0030                                       const Vector3& /*direction*/) const {
0031   return localToGlobal(gctx, lposition);
0032 }
0033 
0034 bool RegularSurface::isOnSurface(const GeometryContext& gctx,
0035                                  const Vector3& position,
0036                                  const BoundaryTolerance& boundaryTolerance,
0037                                  double tolerance) const {
0038   // global to local transformation
0039   auto lpResult = globalToLocal(gctx, position, tolerance);
0040   if (!lpResult.ok()) {
0041     return false;
0042   }
0043   return bounds().inside(lpResult.value(), boundaryTolerance);
0044 }
0045 
0046 }  // namespace Acts