ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LayerArrayCreator.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file LayerArrayCreator.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2016-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 
10 // LayerArrayCreator.h, Acts project
12 
13 #pragma once
14 #ifndef ACTS_TOOLS_TAKESMALLERBIGGER
15 #define ACTS_TOOLS_TAKESMALLERBIGGER
16 #define takeSmaller(current, test) current = current < test ? current : test
17 #define takeBigger(current, test) current = current > test ? current : test
18 #define takeSmallerBigger(cSmallest, cBiggest, test) \
19  takeSmaller(cSmallest, test); \
20  takeBigger(cBiggest, test)
21 #endif
22 
23 #include <algorithm>
28 
29 namespace Acts {
30 
31 class Surface;
32 class Layer;
33 
43 
45  public:
47  struct Config {};
48 
52  LayerArrayCreator(const Config& /*cfg*/,
53  std::unique_ptr<const Logger> logger =
54  getDefaultLogger("LayerArrayCreator", Logging::INFO))
55  : m_logger(std::move(logger)) {}
56 
58  ~LayerArrayCreator() override = default;
59 
70  std::unique_ptr<const LayerArray> layerArray(
71  const GeometryContext& gctx, const LayerVector& layersInput, double min,
72  double max, BinningType bType = arbitrary,
73  BinningValue bValue = binX) const override;
74 
76  void setLogger(std::unique_ptr<const Logger> logger) {
77  m_logger = std::move(logger);
78  }
79 
80  private:
82  const Logger& logger() const { return *m_logger; }
83 
85  std::unique_ptr<const Logger> m_logger = nullptr;
86 
94  std::shared_ptr<Surface> createNavigationSurface(const GeometryContext& gctx,
95  const Layer& layer,
96  BinningValue bValue,
97  double offset) const;
98 };
99 
100 } // namespace Acts