File indexing completed on 2025-08-06 08:11:29
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/Definitions/Algebra.hpp"
0012 #include "Acts/Geometry/GeometryContext.hpp"
0013 #include "Acts/Surfaces/InfiniteBounds.hpp" //to get s_noBounds
0014 #include "Acts/Surfaces/PlanarBounds.hpp"
0015 #include "Acts/Surfaces/RegularSurface.hpp"
0016 #include "Acts/Surfaces/Surface.hpp"
0017 #include "Acts/Surfaces/SurfaceConcept.hpp"
0018 #include "Acts/Utilities/Concepts.hpp"
0019 #include "Acts/Utilities/Intersection.hpp"
0020
0021 namespace Acts {
0022
0023 class SurfaceStub : public RegularSurface {
0024 public:
0025 SurfaceStub(const Transform3& htrans = Transform3::Identity())
0026 : GeometryObject(), RegularSurface(htrans) {}
0027 SurfaceStub(const GeometryContext& gctx, const SurfaceStub& sf,
0028 const Transform3& transf)
0029 : GeometryObject(), RegularSurface(gctx, sf, transf) {}
0030 SurfaceStub(const DetectorElementBase& detelement)
0031 : GeometryObject(), RegularSurface(detelement) {}
0032
0033 ~SurfaceStub() override = default;
0034
0035
0036 SurfaceType type() const final { return Surface::Other; }
0037
0038
0039 Vector3 normal(const GeometryContext& ,
0040 const Vector3& ) const final {
0041 return Vector3{0., 0., 0.};
0042 }
0043
0044 Vector3 normal(const GeometryContext& ,
0045 const Vector2& ) const final {
0046 return Vector3{0., 0., 0.};
0047 }
0048
0049 using RegularSurface::normal;
0050
0051
0052 const SurfaceBounds& bounds() const final {
0053 return s_noBounds;
0054 }
0055
0056
0057 Vector3 localToGlobal(const GeometryContext& , const Vector2&
0058 ) const final {
0059 return Vector3(0., 0., 0.);
0060 }
0061
0062 using RegularSurface::localToGlobal;
0063
0064
0065 Result<Vector2> globalToLocal(const GeometryContext& ,
0066 const Vector3& ,
0067 double ) const final {
0068 return Result<Vector2>::success(Vector2{20., 20.});
0069 }
0070
0071 using RegularSurface::globalToLocal;
0072
0073
0074 double pathCorrection(const GeometryContext& , const Vector3& ,
0075 const Vector3& ) const final {
0076 return 0.0;
0077 }
0078
0079
0080 Vector3 binningPosition(const GeometryContext& ,
0081 BinningValue ) const final {
0082 const Vector3 v{0.0, 0.0, 0.0};
0083 return v;
0084 }
0085
0086
0087 SurfaceMultiIntersection intersect(
0088 const GeometryContext& , const Vector3& ,
0089 const Vector3& , const BoundaryCheck& ,
0090 const ActsScalar ) const final {
0091 Intersection3D stubIntersection(Vector3(20., 0., 0.), 20.,
0092 Intersection3D::Status::reachable);
0093 return SurfaceMultiIntersection(
0094 {stubIntersection, Intersection3D::invalid()}, this);
0095 }
0096
0097
0098 std::string name() const final { return std::string("SurfaceStub"); }
0099
0100
0101 bool constructedOk() const { return true; }
0102
0103
0104 Polyhedron polyhedronRepresentation(const GeometryContext& ,
0105 std::size_t ) const final {
0106 std::vector<Vector3> vertices;
0107 std::vector<std::vector<std::size_t>> faces;
0108 std::vector<std::vector<std::size_t>> triangularMesh;
0109
0110 return Polyhedron(vertices, faces, triangularMesh);
0111 }
0112
0113
0114 ActsMatrix<2, 3> localCartesianToBoundLocalDerivative(
0115 const GeometryContext& ,
0116 const Vector3& ) const final {
0117 return ActsMatrix<2, 3>::Identity();
0118 };
0119
0120 private:
0121
0122 std::shared_ptr<const PlanarBounds> m_bounds;
0123 };
0124
0125 ACTS_STATIC_CHECK_CONCEPT(RegularSurfaceConcept, SurfaceStub);
0126
0127 }