EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SurfaceStub.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file SurfaceStub.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2017-2018 CERN for the benefit of the Acts project
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
9 #pragma once
10 
12 #include "Acts/Surfaces/InfiniteBounds.hpp" //to get s_noBounds
16 
17 namespace Acts {
19 class SurfaceStub : public Surface {
20  public:
21  SurfaceStub(const Transform3D& htrans = Transform3D::Identity())
22  : GeometryObject(), Surface(htrans) {}
24  const Transform3D& transf)
25  : GeometryObject(), Surface(gctx, sf, transf) {}
26  SurfaceStub(const DetectorElementBase& detelement)
27  : GeometryObject(), Surface(detelement) {}
28 
29  ~SurfaceStub() override { /*nop */
30  }
31 
33  SurfaceType type() const final { return Surface::Other; }
34 
37  const Vector2D& /*lpos*/) const final {
38  return normal(gctx);
39  }
40 
41  Vector3D normal(const GeometryContext& gctx, const Vector3D&) const final {
42  return normal(gctx);
43  }
44 
45  Vector3D normal(const GeometryContext& /*gctx*/) const final {
46  return Vector3D{0., 0., 0.};
47  }
48 
50  const SurfaceBounds& bounds() const final {
51  return s_noBounds; // need to improve this for meaningful test
52  }
53 
56  const Vector2D& /*lpos*/,
57  const Vector3D& /*gmom*/) const final {
58  return Vector3D(0., 0., 0.);
59  }
60 
63  const Vector3D& /*gpos*/,
64  const Vector3D& /*gmom*/) const final {
65  return Result<Vector2D>::success(Vector2D{20., 20.});
66  }
67 
69  double pathCorrection(const GeometryContext& /*cxt*/,
70  const Vector3D& /*gpos*/,
71  const Vector3D& /*gmom*/) const final {
72  return 0.0;
73  }
74 
77  BinningValue /*bValue*/) const final {
78  const Vector3D v{0.0, 0.0, 0.0};
79  return v;
80  }
81 
84  const Vector3D& /*position*/,
85  const Vector3D& /*direction*/,
86  const BoundaryCheck& /*bcheck*/) const final {
87  Intersection3D stubIntersection(Vector3D(20., 0., 0.), 20.,
88  Intersection3D::Status::reachable);
89  return SurfaceIntersection(stubIntersection, this);
90  }
91 
93  std::string name() const final { return std::string("SurfaceStub"); }
94 
96  bool constructedOk() const { return true; }
97 
100  size_t /*lseg */) const final {
101  std::vector<Vector3D> vertices;
102  std::vector<std::vector<size_t>> faces;
103  std::vector<std::vector<size_t>> triangularMesh;
104 
105  return Polyhedron(vertices, faces, triangularMesh);
106  }
107 
108  // Cartesian 3D to local bound derivative
110  const GeometryContext& /*unused*/,
111  const Vector3D& /*unused*/) const final {
112  return LocalCartesianToBoundLocalMatrix::Identity();
113  };
114 
115  private:
117  std::shared_ptr<const PlanarBounds> m_bounds;
118 };
119 } // namespace Acts