ECCE @ EIC 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 
10 // TGeoDetectorElement.hpp, Acts project, TGeoDetector plugin
12 
13 #pragma once
14 #include <iostream>
18 #include "TGeoManager.h"
19 
20 namespace Acts {
21 
22 class ISurfaceMaterial;
23 class SurfaceBounds;
24 class DigitizationModule;
25 
36  public:
39 
72  const Identifier& identifier, TGeoNode* tGeoDetElement,
73  const TGeoMatrix* mGlobal = nullptr, const std::string& axes = "XYZ",
74  double scalor = 1., bool isDisc = false,
75  std::shared_ptr<const Acts::ISurfaceMaterial> material = nullptr,
76  std::shared_ptr<const Acts::DigitizationModule> digitizationModule =
77  nullptr);
78 
118  const Identifier& identifier, const TGeoMatrix& transform,
119  TGeoNode* tGeoDetElement, const std::string& axes = "XYZ",
120  double scalor = 1., bool isDisc = false,
121  std::shared_ptr<const Acts::ISurfaceMaterial> material = nullptr,
122  std::shared_ptr<const Acts::DigitizationModule> digitizationModule =
123  nullptr);
124 
126  ~TGeoDetectorElement() override;
127 
129  Identifier identifier() const final;
130 
134  const Transform3D& transform(const GeometryContext& gctx) const final;
135 
137  const Surface& surface() const final;
138 
140  double thickness() const final;
141 
143  const std::shared_ptr<const Acts::DigitizationModule> digitizationModule()
144  const final;
145 
146  protected:
149  void construct(
150  const Double_t* rotation = nullptr, const Double_t* translation = nullptr,
151  const std::string& axes = "XYZ", double scalor = 1., bool isDisc = false,
152  std::shared_ptr<const Acts::ISurfaceMaterial> material = nullptr);
153 
154  private:
156  TGeoNode* m_detElement{nullptr};
158  std::shared_ptr<const Acts::Transform3D> m_transform{nullptr};
160  std::shared_ptr<const Vector3D> m_center{nullptr};
162  std::shared_ptr<const Vector3D> m_normal{nullptr};
166  std::shared_ptr<const SurfaceBounds> m_bounds{nullptr};
168  double m_thickness{0.}; //@todo implement thickness from TGeoMode
170  std::shared_ptr<const Surface> m_surface{nullptr};
172  std::shared_ptr<const Acts::DigitizationModule> m_digitizationModule{nullptr};
173 };
174 
176  return m_identifier;
177 }
178 
180  const GeometryContext& /*gctx*/) const {
181  return (*m_transform);
182 }
183 
184 inline const Surface& TGeoDetectorElement::surface() const {
185  return (*m_surface);
186 }
187 
188 inline double TGeoDetectorElement::thickness() const {
189  return m_thickness;
190 }
191 
192 inline const std::shared_ptr<const Acts::DigitizationModule>
194  return m_digitizationModule;
195 }
196 } // namespace Acts