File indexing completed on 2025-01-18 09:12:52
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/Intersection.hpp"
0019
0020 namespace Acts {
0021
0022 class SurfaceStub : public RegularSurface {
0023 public:
0024 SurfaceStub(const Transform3& htrans = Transform3::Identity())
0025 : GeometryObject(), RegularSurface(htrans) {}
0026 SurfaceStub(const GeometryContext& gctx, const SurfaceStub& sf,
0027 const Transform3& transf)
0028 : GeometryObject(), RegularSurface(gctx, sf, transf) {}
0029 SurfaceStub(const DetectorElementBase& detelement)
0030 : GeometryObject(), RegularSurface(detelement) {}
0031
0032 ~SurfaceStub() override = default;
0033
0034
0035 SurfaceType type() const final { return Surface::Other; }
0036
0037
0038 Vector3 normal(const GeometryContext& ,
0039 const Vector3& ) const final {
0040 return Vector3{0., 0., 0.};
0041 }
0042
0043 Vector3 normal(const GeometryContext& ,
0044 const Vector2& ) const final {
0045 return Vector3{0., 0., 0.};
0046 }
0047
0048 using RegularSurface::normal;
0049
0050
0051 const SurfaceBounds& bounds() const final {
0052 return s_noBounds;
0053 }
0054
0055
0056 Vector3 localToGlobal(const GeometryContext& , const Vector2&
0057 ) const final {
0058 return Vector3(0., 0., 0.);
0059 }
0060
0061 using RegularSurface::localToGlobal;
0062
0063
0064 Result<Vector2> globalToLocal(const GeometryContext& ,
0065 const Vector3& ,
0066 double ) const final {
0067 return Result<Vector2>::success(Vector2{20., 20.});
0068 }
0069
0070 using RegularSurface::globalToLocal;
0071
0072
0073 double pathCorrection(const GeometryContext& , const Vector3& ,
0074 const Vector3& ) const final {
0075 return 0.0;
0076 }
0077
0078
0079 Vector3 referencePosition(const GeometryContext& ,
0080 AxisDirection ) const final {
0081 const Vector3 v{0., 0., 0.};
0082 return v;
0083 }
0084
0085
0086 SurfaceMultiIntersection intersect(
0087 const GeometryContext& , const Vector3& ,
0088 const Vector3& ,
0089 const BoundaryTolerance& ,
0090 const double ) const final {
0091 Intersection3D stubIntersection(Vector3(20., 0., 0.), 20.,
0092 IntersectionStatus::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 unsigned int ) 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 static_assert(RegularSurfaceConcept<SurfaceStub>,
0126 "SurfaceStub does not fulfill RegularSurfaceConcept");
0127
0128 }