ECCE @ 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(std::shared_ptr<const Transform3D> htrans = nullptr)
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 
42  const Vector3D&) const final {
43  return normal(gctx);
44  }
45 
46  const Vector3D normal(const GeometryContext& /*gctx*/) const final {
47  return Vector3D{0., 0., 0.};
48  }
49 
51  const SurfaceBounds& bounds() const final {
52  return s_noBounds; // need to improve this for meaningful test
53  }
54 
56  void localToGlobal(const GeometryContext& /*gctx*/, const Vector2D& /*lpos*/,
57  const Vector3D& /*gmom*/, Vector3D& /*gpos*/) const final {
58  // nop
59  }
60 
62  bool globalToLocal(const GeometryContext& /*cxt*/, const Vector3D& /*gpos*/,
63  const Vector3D& /*gmom*/, Vector2D& lpos) const final {
64  lpos = Vector2D{20., 20.};
65  return true;
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  const GeometryContext& /*cxt*/, const Vector3D& /*gpos*/,
78  const Vector3D& /*gdir*/, const BoundaryCheck& /*bcheck*/) const final {
79  const Intersection is{Vector3D{1, 1, 1}, 20.,
80  Intersection::Status::reachable};
81  return is;
82  }
83 
86  BinningValue /*bValue*/) const final {
87  const Vector3D v{0.0, 0.0, 0.0};
88  return v;
89  }
90 
92  std::string name() const final { return std::string("SurfaceStub"); }
93 
95  bool constructedOk() const { return true; }
96 
99  size_t /*lseg */) const final {
100  std::vector<Vector3D> vertices;
101  std::vector<std::vector<size_t>> faces;
102  std::vector<std::vector<size_t>> triangularMesh;
103 
104  return Polyhedron(vertices, faces, triangularMesh);
105  }
106 
107  private:
109  std::shared_ptr<const PlanarBounds> m_bounds;
110 };
111 } // namespace Acts