Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-13 08:18:51

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/TrackParametrization.hpp"
0014 #include "Acts/Geometry/GeometryContext.hpp"
0015 #include "Acts/Material/ISurfaceMaterial.hpp"
0016 #include "Acts/Surfaces/BoundaryTolerance.hpp"
0017 #include "Acts/Surfaces/Surface.hpp"
0018 #include "Acts/Surfaces/SurfaceBounds.hpp"
0019 #include "Acts/Surfaces/SurfacePlacementBase.hpp"
0020 #include "Acts/Utilities/Result.hpp"
0021 
0022 namespace Acts {
0023 
0024 template <typename S>
0025 concept SurfaceConcept = requires(S s, const S cs, S s2, const S cs2,
0026                                   GeometryContext gctx,
0027                                   BoundaryTolerance tolerance) {
0028   { cs == s2 } -> std::same_as<bool>;
0029   { cs.type() } -> std::same_as<Surface::SurfaceType>;
0030   { cs.localToGlobalTransform(gctx) } -> std::same_as<const Transform3&>;
0031   { cs.center(gctx) } -> std::same_as<Vector3>;
0032   { cs.normal(gctx, Vector3{}, Vector3{}) } -> std::same_as<Vector3>;
0033   { cs.bounds() } -> std::convertible_to<const SurfaceBounds&>;
0034   { cs.surfacePlacement() } -> std::same_as<const SurfacePlacementBase*>;
0035 
0036   { cs.associatedLayer() } -> std::same_as<const Layer*>;
0037   { s.associateLayer(std::declval<const Layer&>()) } -> std::same_as<void>;
0038 
0039   { cs.surfaceMaterial() } -> std::same_as<const ISurfaceMaterial*>;
0040   {
0041     cs.surfaceMaterialSharedPtr()
0042   } -> std::same_as<const std::shared_ptr<const ISurfaceMaterial>&>;
0043   {
0044     s.assignSurfaceMaterial(
0045         std::declval<std::shared_ptr<const ISurfaceMaterial>>())
0046   } -> std::same_as<void>;
0047   {
0048     cs.isOnSurface(gctx, Vector3{}, Vector3{}, tolerance)
0049   } -> std::same_as<bool>;
0050   { cs.insideBounds(Vector2{}, tolerance) } -> std::same_as<bool>;
0051 
0052   { cs.localToGlobal(gctx, Vector2{}, Vector3{}) } -> std::same_as<Vector3>;
0053 
0054   {
0055     cs.globalToLocal(gctx, Vector3{}, Vector3{}, double{5})
0056   } -> std::same_as<Result<Vector2>>;
0057 
0058   {
0059     cs.referenceFrame(gctx, Vector3{}, Vector3{})
0060   } -> std::same_as<RotationMatrix3>;
0061 
0062   {
0063     cs.boundToFreeJacobian(gctx, Vector3{}, Vector3{})
0064   } -> std::same_as<BoundToFreeMatrix>;
0065 
0066   {
0067     cs.freeToBoundJacobian(gctx, Vector3{}, Vector3{})
0068   } -> std::same_as<FreeToBoundMatrix>;
0069 
0070   {
0071     cs.freeToPathDerivative(gctx, Vector3{}, Vector3{})
0072   } -> std::same_as<FreeToPathMatrix>;
0073 
0074   { cs.pathCorrection(gctx, Vector3{}, Vector3{}) } -> std::same_as<double>;
0075 
0076   {
0077     cs.intersect(gctx, Vector3{}, Vector3{}, tolerance, std::declval<double>())
0078   } -> std::same_as<MultiIntersection3D>;
0079 
0080   { cs.toStream(gctx) } -> std::same_as<GeometryContextOstreamWrapper<Surface>>;
0081 
0082   { cs.toString(gctx) } -> std::same_as<std::string>;
0083 
0084   { cs.name() } -> std::same_as<std::string>;
0085 
0086   {
0087     cs.polyhedronRepresentation(gctx, std::declval<unsigned int>())
0088   } -> std::same_as<Polyhedron>;
0089 
0090   {
0091     cs.alignmentToBoundDerivative(gctx, Vector3{}, Vector3{}, FreeVector{})
0092   } -> std::same_as<AlignmentToBoundMatrix>;
0093 
0094   {
0095     cs.alignmentToPathDerivative(gctx, Vector3{}, Vector3{})
0096   } -> std::same_as<AlignmentToPathMatrix>;
0097 
0098   {
0099     cs.localCartesianToBoundLocalDerivative(gctx, Vector3{})
0100   } -> std::same_as<Matrix<2, 3>>;
0101 };
0102 
0103 template <typename S>
0104 concept RegularSurfaceConcept =
0105     SurfaceConcept<S> && requires(S s, const S cs, GeometryContext gctx,
0106                                   BoundaryTolerance tolerance) {
0107       { cs.normal(gctx, Vector2{}) } -> std::same_as<Vector3>;
0108 
0109       { cs.normal(gctx, Vector3{}) } -> std::same_as<Vector3>;
0110 
0111       {
0112         cs.globalToLocal(gctx, Vector3{}, Vector3{}, std::declval<double>())
0113       } -> std::same_as<Result<Vector2>>;
0114 
0115       { cs.localToGlobal(gctx, Vector2{}) } -> std::same_as<Vector3>;
0116 
0117       { cs.isOnSurface(gctx, Vector3{}, tolerance) } -> std::same_as<bool>;
0118     };
0119 
0120 }  // namespace Acts