Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GeometryIdGenerator.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file GeometryIdGenerator.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 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 <any>
16 
17 namespace Acts {
18 
19 class Surface;
20 
21 namespace Experimental {
22 
23 class Portal;
24 class DetectorVolume;
25 
42  public:
44  struct Config {
46  bool containerMode = false;
48  unsigned int containerId = 0u;
50  bool resetSubCounters = true;
52  bool overrideExistingIds = false;
53  };
54 
56  struct Cache {
58  unsigned int volumeCount = 0u;
60  unsigned int layerCount = 0u;
62  unsigned int portalCount = 0u;
64  unsigned int passiveCount = 0u;
66  unsigned int sensitiveCount = 0u;
67  };
68 
74  std::unique_ptr<const Logger> mlogger = getDefaultLogger(
75  "GeometryIdGenerator", Logging::INFO))
76  : m_cfg(cfg), m_logger(std::move(mlogger)) {}
77 
78  ~GeometryIdGenerator() override = default;
79 
83 
89  DetectorVolume& dVolume) const final;
90 
96  Portal& portal) const final;
97 
103  Surface& surface) const final;
104 
105  private:
112  GeometryIdentifier volumeId(Cache& cache, bool incrementLayer = true) const;
113 
116 
118  const Logger& logger() const { return *m_logger; }
119 
121  std::unique_ptr<const Logger> m_logger;
122 };
123 
124 } // namespace Experimental
125 } // namespace Acts