Analysis Software
Documentation for sPHENIX simulation 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 
9 #pragma once
10 
18 
19 namespace Acts {
20 
21 class PlanarBounds;
22 class DiscBounds;
23 class ISurfaceMaterial;
24 class LineBounds;
25 
26 namespace Test {
27 
33  public:
35 
37  : DetectorElementBase(), m_elementTransform(transform) {}
38 
47  const Transform3& transform,
48  std::shared_ptr<const CylinderBounds> cBounds, double thickness,
49  std::shared_ptr<const ISurfaceMaterial> material = nullptr)
51  m_elementTransform(transform),
52  m_elementThickness(thickness) {
54  Surface::makeShared<CylinderSurface>(std::move(cBounds), *this);
55  m_elementSurface->assignSurfaceMaterial(std::move(material));
56  }
57 
66  const Transform3& transform, std::shared_ptr<const PlanarBounds> pBounds,
67  double thickness,
68  std::shared_ptr<const ISurfaceMaterial> material = nullptr)
70  m_elementTransform(transform),
71  m_elementThickness(thickness) {
73  Surface::makeShared<PlaneSurface>(std::move(pBounds), *this);
74  m_elementSurface->assignSurfaceMaterial(std::move(material));
75  }
76 
85  const Transform3& transform, std::shared_ptr<const LineBounds> lBounds,
86  double thickness,
87  std::shared_ptr<const ISurfaceMaterial> material = nullptr)
89  m_elementTransform(transform),
90  m_elementThickness(thickness) {
92  Surface::makeShared<LineSurfaceStub>(std::move(lBounds), *this);
93  m_elementSurface->assignSurfaceMaterial(std::move(material));
94  }
95 
97  ~DetectorElementStub() override = default;
98 
104  const Transform3& transform(const GeometryContext& gctx) const override;
105 
107  const Surface& surface() const override;
108 
110  Surface& surface() override;
111 
113  double thickness() const override;
114 
115  private:
119  std::shared_ptr<Surface> m_elementSurface{nullptr};
121  double m_elementThickness{0.};
122 };
123 
125  const GeometryContext& /*gctx*/) const {
126  return m_elementTransform;
127 }
128 
129 inline const Surface& DetectorElementStub::surface() const {
130  return *m_elementSurface;
131 }
132 
134  return *m_elementSurface;
135 }
136 
137 inline double DetectorElementStub::thickness() const {
138  return m_elementThickness;
139 }
140 } // namespace Test
141 } // namespace Acts