EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DetectorElementStub.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file DetectorElementStub.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 
10 // DetectorElementStub.h, Acts project, Generic Detector plugin
12 
13 #pragma once
14 
20 
21 namespace Acts {
22 
23 class PlanarBounds;
24 class DiscBounds;
25 class ISurfaceMaterial;
26 class LineBounds;
27 
28 namespace Test {
29 
35  public:
37 
39  : DetectorElementBase(), m_elementTransform(std::move(transform)) {}
40 
49  const Transform3D& transform, std::shared_ptr<const PlanarBounds> pBounds,
50  double thickness,
51  std::shared_ptr<const ISurfaceMaterial> material = nullptr)
53  m_elementTransform(transform),
54  m_elementThickness(thickness) {
55  auto mutableSurface = Surface::makeShared<PlaneSurface>(pBounds, *this);
56  mutableSurface->assignSurfaceMaterial(material);
57  m_elementSurface = mutableSurface;
58  }
59 
68  const Transform3D& transform, std::shared_ptr<const LineBounds> lBounds,
69  double thickness,
70  std::shared_ptr<const ISurfaceMaterial> material = nullptr)
72  m_elementTransform(transform),
73  m_elementThickness(thickness) {
74  auto mutableSurface = Surface::makeShared<LineSurfaceStub>(lBounds, *this);
75  mutableSurface->assignSurfaceMaterial(material);
76  m_elementSurface = mutableSurface;
77  }
78 
80  ~DetectorElementStub() override { /*nop */
81  }
82 
88  const Transform3D& transform(const GeometryContext& gctx) const override;
89 
91  const Surface& surface() const override;
92 
94  double thickness() const override;
95 
96  private:
100  std::shared_ptr<const Surface> m_elementSurface{nullptr};
102  double m_elementThickness{0.};
103 };
104 
106  const GeometryContext& /*gctx*/) const {
107  return m_elementTransform;
108 }
109 
110 inline const Surface& DetectorElementStub::surface() const {
111  return *m_elementSurface;
112 }
113 
114 inline double DetectorElementStub::thickness() const {
115  return m_elementThickness;
116 }
117 } // namespace Test
118 } // namespace Acts