Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DD4hepLayerBuilder.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file DD4hepLayerBuilder.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 
20 
21 #include <memory>
22 #include <string>
23 #include <vector>
24 
25 #include "DD4hep/DetElement.h"
26 
27 class TGeoMatrix;
28 
29 namespace Acts {
30 class LayerCreator;
31 class Logger;
32 class Surface;
33 
40 
42  public:
45  struct Config {
49  std::shared_ptr<const LayerCreator> layerCreator = nullptr;
63  std::vector<dd4hep::DetElement> negativeLayers;
66  std::vector<dd4hep::DetElement> centralLayers;
71  std::vector<dd4hep::DetElement> positiveLayers;
83  };
84 
89  std::unique_ptr<const Logger> logger);
91  ~DD4hepLayerBuilder() override;
92 
98  const LayerVector negativeLayers(const GeometryContext& gctx) const final;
99 
105  const LayerVector centralLayers(const GeometryContext& gctx) const final;
106 
112  const LayerVector positiveLayers(const GeometryContext& gctx) const final;
113 
116  const std::string& identification() const final;
117 
120  void setConfiguration(const Config& config);
121 
123  Config getConfiguration() const;
124 
126  void setLogger(std::unique_ptr<const Logger> logger);
127 
128  private:
131 
133  std::unique_ptr<const Logger> m_logger;
134 
136  const Logger& logger() const { return *m_logger; }
137 
146  const GeometryContext& gctx,
147  const std::vector<dd4hep::DetElement>& dendcapLayers,
148  const std::string& side) const;
149 
155  void resolveSensitive(
156  const dd4hep::DetElement& detElement,
157  std::vector<std::shared_ptr<const Acts::Surface>>& surfaces) const;
158 
165  std::shared_ptr<const Acts::Surface> createSensitiveSurface(
166  const dd4hep::DetElement& detElement, bool isDisc = false) const;
167 
168  // Private helper function to convert the TGeo transformation matrix into
169  // an Acts transformation matrix
170  // @param tGeoTrans TGeo transformation matrix which should be converted
171  Acts::Transform3 convertTransform(const TGeoMatrix* tGeoTrans) const;
172 };
173 
175  return m_cfg.configurationName;
176 }
177 
179  return m_cfg;
180 }
181 
182 } // namespace Acts