Skip to content

Commit

Permalink
fix surface stub
Browse files Browse the repository at this point in the history
  • Loading branch information
paulgessinger committed Nov 9, 2023
1 parent c5da2d7 commit 66767c3
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions Tests/UnitTests/Core/Surfaces/SurfaceStub.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,48 +12,54 @@
#include "Acts/Geometry/GeometryContext.hpp"
#include "Acts/Surfaces/InfiniteBounds.hpp" //to get s_noBounds
#include "Acts/Surfaces/PlanarBounds.hpp"
#include "Acts/Surfaces/RegularSurface.hpp"
#include "Acts/Surfaces/Surface.hpp"
#include "Acts/Utilities/Intersection.hpp"

namespace Acts {
/// Surface derived class stub
class SurfaceStub : public Surface {
class SurfaceStub : public RegularSurface {
public:
SurfaceStub(const Transform3& htrans = Transform3::Identity())
: GeometryObject(), Surface(htrans) {}
: GeometryObject(), RegularSurface(htrans) {}
SurfaceStub(const GeometryContext& gctx, const SurfaceStub& sf,
const Transform3& transf)
: GeometryObject(), Surface(gctx, sf, transf) {}
: GeometryObject(), RegularSurface(gctx, sf, transf) {}
SurfaceStub(const DetectorElementBase& detelement)
: GeometryObject(), Surface(detelement) {}
: GeometryObject(), RegularSurface(detelement) {}

~SurfaceStub() override = default;

/// Return method for the Surface type to avoid dynamic casts
SurfaceType type() const final { return Surface::Other; }

/// Return method for the normal vector of the surface
Vector3 normal(const GeometryContext& /*gctx*/, const Vector3& /*position*/,
const Vector3& /*direction*/) const final {
Vector3 normal(const GeometryContext& /*gctx*/,
const Vector3& /*position*/) const final {
return Vector3{0., 0., 0.};
}

Vector3 normal(const GeometryContext& /*gctx*/,
const Vector2& /*lposition*/) const final {
return Vector3{0., 0., 0.};
}

using RegularSurface::normal;

/// Return method for SurfaceBounds
const SurfaceBounds& bounds() const final {
return s_noBounds; // need to improve this for meaningful test
}

/// Local to global transformation
Vector3 localToGlobal(const GeometryContext& /*gctx*/,
const Vector2& /*lpos*/,
const Vector3& /*gmom*/) const final {
Vector3 localToGlobal(const GeometryContext& /*gctx*/, const Vector2& /*lpos*/
) const final {
return Vector3(0., 0., 0.);
}

/// Global to local transformation
Result<Vector2> globalToLocal(const GeometryContext& /*cxt*/,
const Vector3& /*gpos*/,
const Vector3& /*gmom*/,
double /*tolerance*/) const final {
return Result<Vector2>::success(Vector2{20., 20.});
}
Expand Down

0 comments on commit 66767c3

Please sign in to comment.