EIC 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 
17 
18 #include <optional>
19 
20 namespace Acts {
21 
22 namespace Test {
23 struct LayerCreatorFixture;
24 }
25 class Surface;
26 class Layer;
27 using MutableLayerPtr = std::shared_ptr<Layer>;
28 
34 class LayerCreator {
35  public:
40  struct Config {
42  std::shared_ptr<const SurfaceArrayCreator> surfaceArrayCreator = nullptr;
44  double cylinderZtolerance{10.};
46  double cylinderPhiTolerance{0.1};
48  Config() = default;
49  };
50 
55  LayerCreator(const Config& lcConfig,
56  std::unique_ptr<const Logger> logger =
57  getDefaultLogger("LayerCreator", Logging::INFO));
58 
60  ~LayerCreator() = default;
61 
80  const GeometryContext& gctx,
81  std::vector<std::shared_ptr<const Surface>> surfaces, size_t binsPhi,
82  size_t binsZ, std::optional<ProtoLayer> _protoLayer = std::nullopt,
84  std::unique_ptr<ApproachDescriptor> ad = nullptr) const;
85 
104  const GeometryContext& gctx,
105  std::vector<std::shared_ptr<const Surface>> surfaces,
106  BinningType bTypePhi, BinningType bTypeZ,
107  std::optional<ProtoLayer> _protoLayer = std::nullopt,
109  std::unique_ptr<ApproachDescriptor> ad = nullptr) const;
110 
129  const GeometryContext& gctx,
130  std::vector<std::shared_ptr<const Surface>> surfaces, size_t binsR,
131  size_t binsPhi, std::optional<ProtoLayer> _protoLayer = std::nullopt,
133  std::unique_ptr<ApproachDescriptor> ad = nullptr) const;
134 
153  const GeometryContext& gctx,
154  std::vector<std::shared_ptr<const Surface>> surfaces, BinningType bTypeR,
155  BinningType bTypePhi,
156  std::optional<ProtoLayer> _protoLayer = std::nullopt,
158  std::unique_ptr<ApproachDescriptor> ad = nullptr) const;
159 
182  const GeometryContext& gctx,
183  std::vector<std::shared_ptr<const Surface>> surfaces, size_t bins1,
184  size_t bins2, BinningValue bValue,
185  std::optional<ProtoLayer> _protoLayer = std::nullopt,
187  std::unique_ptr<ApproachDescriptor> ad = nullptr) const;
188 
191  void setConfiguration(const Config& lcConfig);
192 
194  Config getConfiguration() const;
195 
198  void setLogger(std::unique_ptr<const Logger> newLogger);
199 
200  // associate surfaces contained by this layer to this layer
201  void associateSurfacesToLayer(Layer& layer) const;
202 
203  private:
209  bool checkBinning(const GeometryContext& gctx,
210  const SurfaceArray& sArray) const;
211 
214 
216  const Logger& logger() const { return *m_logger; }
217 
219  std::unique_ptr<const Logger> m_logger;
220 };
221 
223  return m_cfg;
224 }
225 
226 } // namespace Acts