Analysis Software
Documentation for sPHENIX simulation 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 
13 #include "Acts/Surfaces/InfiniteBounds.hpp" //to get s_noBounds
17 
18 namespace Acts {
20 class SurfaceStub : public Surface {
21  public:
22  SurfaceStub(const Transform3& htrans = Transform3::Identity())
23  : GeometryObject(), Surface(htrans) {}
25  const Transform3& transf)
26  : GeometryObject(), Surface(gctx, sf, transf) {}
27  SurfaceStub(const DetectorElementBase& detelement)
28  : GeometryObject(), Surface(detelement) {}
29 
30  ~SurfaceStub() override = default;
31 
33  SurfaceType type() const final { return Surface::Other; }
34 
37  const Vector2& /*lpos*/) const final {
38  return normal(gctx);
39  }
40 
42  const Vector3& /*position*/) const final {
43  return normal(gctx);
44  }
45 
46  Vector3 normal(const GeometryContext& /*gctx*/) const final {
47  return Vector3{0., 0., 0.};
48  }
49 
51  const SurfaceBounds& bounds() const final {
52  return s_noBounds; // need to improve this for meaningful test
53  }
54 
57  const Vector2& /*lpos*/,
58  const Vector3& /*gmom*/) const final {
59  return Vector3(0., 0., 0.);
60  }
61 
64  const Vector3& /*gpos*/,
65  const Vector3& /*gmom*/,
66  double /*tolerance*/) const final {
67  return Result<Vector2>::success(Vector2{20., 20.});
68  }
69 
71  double pathCorrection(const GeometryContext& /*cxt*/, const Vector3& /*gpos*/,
72  const Vector3& /*gmom*/) const final {
73  return 0.0;
74  }
75 
78  BinningValue /*bValue*/) const final {
79  const Vector3 v{0.0, 0.0, 0.0};
80  return v;
81  }
82 
85  const GeometryContext& /*gctx*/, const Vector3& /*position*/,
86  const Vector3& /*direction*/, const BoundaryCheck& /*bcheck*/,
87  const ActsScalar /*tolerance*/) const final {
88  Intersection3D stubIntersection(Vector3(20., 0., 0.), 20.,
89  Intersection3D::Status::reachable);
91  {stubIntersection, Intersection3D::invalid()}, this);
92  }
93 
95  std::string name() const final { return std::string("SurfaceStub"); }
96 
98  bool constructedOk() const { return true; }
99 
102  size_t /*lseg */) const final {
103  std::vector<Vector3> vertices;
104  std::vector<std::vector<size_t>> faces;
105  std::vector<std::vector<size_t>> triangularMesh;
106 
107  return Polyhedron(vertices, faces, triangularMesh);
108  }
109 
110  // Cartesian 3D to local bound derivative
112  const GeometryContext& /*gctx*/,
113  const Vector3& /*position*/) const final {
115  };
116 
117  private:
119  std::shared_ptr<const PlanarBounds> m_bounds;
120 };
121 } // namespace Acts