Back to home page

EIC code displayed by LXR

 
 

    


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

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