Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LayerCreator.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file LayerCreator.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2016-2020 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 #include <cstddef>
20 #include <memory>
21 #include <optional>
22 #include <vector>
23 
24 namespace Acts {
25 
26 namespace Test {
27 struct LayerCreatorFixture;
28 }
29 class Surface;
31 class Layer;
32 
33 using MutableLayerPtr = std::shared_ptr<Layer>;
34 
40 class LayerCreator {
41  public:
46  struct Config {
48  std::shared_ptr<const SurfaceArrayCreator> surfaceArrayCreator = nullptr;
50  double cylinderZtolerance{10.};
52  double cylinderPhiTolerance{0.1};
54  Config() = default;
55  };
56 
61  LayerCreator(const Config& lcConfig,
62  std::unique_ptr<const Logger> logger =
63  getDefaultLogger("LayerCreator", Logging::INFO));
64 
66  ~LayerCreator() = default;
67 
86  const GeometryContext& gctx,
87  std::vector<std::shared_ptr<const Surface>> surfaces, size_t binsPhi,
88  size_t binsZ, std::optional<ProtoLayer> _protoLayer = std::nullopt,
89  const Transform3& transform = Transform3::Identity(),
90  std::unique_ptr<ApproachDescriptor> ad = nullptr) const;
91 
110  const GeometryContext& gctx,
111  std::vector<std::shared_ptr<const Surface>> surfaces,
112  BinningType bTypePhi, BinningType bTypeZ,
113  std::optional<ProtoLayer> _protoLayer = std::nullopt,
114  const Transform3& transform = Transform3::Identity(),
115  std::unique_ptr<ApproachDescriptor> ad = nullptr) const;
116 
135  const GeometryContext& gctx,
136  std::vector<std::shared_ptr<const Surface>> surfaces, size_t binsR,
137  size_t binsPhi, std::optional<ProtoLayer> _protoLayer = std::nullopt,
138  const Transform3& transform = Transform3::Identity(),
139  std::unique_ptr<ApproachDescriptor> ad = nullptr) const;
140 
159  const GeometryContext& gctx,
160  std::vector<std::shared_ptr<const Surface>> surfaces, BinningType bTypeR,
161  BinningType bTypePhi,
162  std::optional<ProtoLayer> _protoLayer = std::nullopt,
163  const Transform3& transform = Transform3::Identity(),
164  std::unique_ptr<ApproachDescriptor> ad = nullptr) const;
165 
188  const GeometryContext& gctx,
189  std::vector<std::shared_ptr<const Surface>> surfaces, size_t bins1,
190  size_t bins2, BinningValue bValue,
191  std::optional<ProtoLayer> _protoLayer = std::nullopt,
192  const Transform3& transform = Transform3::Identity(),
193  std::unique_ptr<ApproachDescriptor> ad = nullptr) const;
194 
197  void setConfiguration(const Config& lcConfig);
198 
200  Config getConfiguration() const;
201 
204  void setLogger(std::unique_ptr<const Logger> newLogger);
205 
207  void associateSurfacesToLayer(Layer& layer) const;
208 
209  private:
215  bool checkBinning(const GeometryContext& gctx,
216  const SurfaceArray& sArray) const;
217 
220 
222  const Logger& logger() const { return *m_logger; }
223 
225  std::unique_ptr<const Logger> m_logger;
226 };
227 
229  return m_cfg;
230 }
231 
232 } // namespace Acts