EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TrackingGeometryBuilder.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file TrackingGeometryBuilder.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 
9 #pragma once
10 
17 
18 #include <functional>
19 #include <memory>
20 #include <vector>
21 
22 namespace Acts {
23 
24 class TrackingGeometry;
25 class IMaterialDecorator;
26 
38  public:
41  struct Config {
43  std::vector<std::function<std::shared_ptr<TrackingVolume>(
44  const GeometryContext& gctx, const TrackingVolumePtr&,
45  const VolumeBoundsPtr&)>>
47 
49  std::shared_ptr<const ITrackingVolumeHelper> trackingVolumeHelper = nullptr;
50 
52  std::shared_ptr<const IMaterialDecorator> materialDecorator = nullptr;
53  };
54 
59  TrackingGeometryBuilder(const Config& cgbConfig,
60  std::unique_ptr<const Logger> logger =
61  getDefaultLogger("TrackingGeometryBuilder",
62  Logging::INFO));
63 
65  ~TrackingGeometryBuilder() override = default;
66 
72  std::unique_ptr<const TrackingGeometry> trackingGeometry(
73  const GeometryContext& gctx) const final;
74 
78  void setConfiguration(const Config& cgbConfig);
79 
82  Config getConfiguration() const;
83 
86  void setLogger(std::unique_ptr<const Logger> newLogger);
87 
88  private:
91 
93  const Logger& logger() const { return *m_logger; }
94 
96  std::unique_ptr<const Logger> m_logger;
97 };
98 
101  return m_cfg;
102 }
103 
104 } // namespace Acts