Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DetectorBuilder.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file DetectorBuilder.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2022-2023 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 
14 
15 #include <memory>
16 #include <string>
17 
18 namespace Acts {
19 namespace Experimental {
20 
21 class IGeometryIdGenerator;
22 
30 class DetectorBuilder final : public IDetectorBuilder {
31  public:
33  struct Config {
35  std::string name = "unnamed";
37  std::shared_ptr<const IDetectorComponentBuilder> builder = nullptr;
39  std::shared_ptr<const IGeometryIdGenerator> geoIdGenerator = nullptr;
42  };
43 
48  DetectorBuilder(const Config& cfg,
49  std::unique_ptr<const Logger> mlogger =
50  getDefaultLogger("DetectorBuilder", Logging::INFO));
51 
58  std::shared_ptr<const Detector> construct(
59  const GeometryContext& gctx) const final;
60 
61  private:
64 
66  const Logger& logger() const { return *m_logger; }
67 
69  std::unique_ptr<const Logger> m_logger;
70 };
71 
72 } // namespace Experimental
73 } // namespace Acts