Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TGeoDetectorElement.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file TGeoDetectorElement.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2017-2019 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 
15 
16 #include <iostream>
17 #include <memory>
18 #include <string>
19 
20 #include "TGeoManager.h"
21 
22 namespace Acts {
23 
24 class ISurfaceMaterial;
25 class SurfaceBounds;
26 class PlanarBounds;
27 class DiscBounds;
28 class DigitizationModule;
29 class Surface;
30 
41  public:
44 
75  const Identifier& identifier, const TGeoNode& tGeoNode,
76  const TGeoMatrix& tGeoMatrix = TGeoIdentity(),
77  const std::string& axes = "XYZ", double scalor = 10.,
78  std::shared_ptr<const Acts::ISurfaceMaterial> material = nullptr);
79 
90  TGeoDetectorElement(const Identifier& identifier, const TGeoNode& tGeoNode,
91  const Transform3& tgTransform,
92  const std::shared_ptr<const PlanarBounds>& tgBounds,
93  double tgThickness = 0.);
94 
105  TGeoDetectorElement(const Identifier& identifier, const TGeoNode& tGeoNode,
106  const Transform3& tgTransform,
107  const std::shared_ptr<const DiscBounds>& tgBounds,
108  double tgThickness = 0.);
109 
110  ~TGeoDetectorElement() override;
111 
112  Identifier identifier() const final;
113 
117  const Transform3& transform(const GeometryContext& gctx) const override;
118 
120  const Surface& surface() const override;
121 
125  Surface& surface() override;
126 
129  const final {
130  return nullptr;
131  };
132 
134  double thickness() const override;
135 
137  const TGeoNode& tgeoNode() const { return *m_detElement; }
138 
139  private:
141  const TGeoNode* m_detElement{nullptr};
143  Transform3 m_transform = Transform3::Identity();
147  std::shared_ptr<const SurfaceBounds> m_bounds{nullptr};
149  double m_thickness{0.};
151  std::shared_ptr<Surface> m_surface{nullptr};
152 };
153 
155  return m_identifier;
156 }
157 
159  const GeometryContext& /*gctx*/) const {
160  return m_transform;
161 }
162 
163 inline const Surface& TGeoDetectorElement::surface() const {
164  return (*m_surface);
165 }
166 
168  return (*m_surface);
169 }
170 
171 inline double TGeoDetectorElement::thickness() const {
172  return m_thickness;
173 }
174 
175 } // namespace Acts