Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ProtoDetector.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file ProtoDetector.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2022 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 
11 #include "Acts/Geometry/Extent.hpp"
17 
18 #include <functional>
19 #include <map>
20 #include <memory>
21 #include <optional>
22 #include <string>
23 #include <tuple>
24 #include <vector>
25 
26 namespace Acts {
27 
28 struct ProtoVolume;
29 
30 namespace Experimental {
31 
32 class DetectorVolume;
33 class Portal;
34 
36 using DetectorVolumes = std::vector<std::shared_ptr<DetectorVolume>>;
38 using ProtoContainer = std::map<unsigned int, std::shared_ptr<Portal>>;
40 using DetectorBlock = std::tuple<DetectorVolumes, ProtoContainer>;
41 
43 using DetectorBlockBuilder = std::function<void(
45 } // namespace Experimental
46 
49 struct ProtoVolume {
50  // Internal structure information
53  Surface::SurfaceType layerType = Surface::SurfaceType::Other;
55  std::vector<BinningData> surfaceBinning = {};
56  };
57 
58  // Container structure information
61  std::vector<ProtoVolume> constituentVolumes = {};
63  std::vector<BinningData> constituentBinning = {};
65  bool layerContainer = false;
66  };
67 
72 
74  std::optional<InternalStructure> internal = std::nullopt;
75 
77  std::optional<ContainerStructure> container = std::nullopt;
78 
81 
85  bool operator==(const ProtoVolume& ptVolume) const;
86 
92  void harmonize(bool legacy = true);
93 
98  void extendUp(ProtoVolume& ptVolume);
99 
102  void propagateMinDown(BinningValue bValue);
103 
106  void propagateMaxDown(BinningValue bValue);
107 
112  void constrainDown(const ProtoVolume& ptVolume);
113 
116  std::string toString(const std::string& indent = "") const;
117 };
118 
124 
131  void harmonize(bool legacy = true) {
134  worldVolume.harmonize(legacy);
135  }
136 
139  std::string toString(const std::string& indent = "") const;
140 };
141 
142 } // namespace Acts