File indexing completed on 2025-08-06 08:09:57
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/Definitions/Algebra.hpp"
0012 #include "Acts/Definitions/Common.hpp"
0013 #include "Acts/Detector/ProtoBinning.hpp"
0014 #include "Acts/Geometry/VolumeBounds.hpp"
0015 #include "Acts/Utilities/BinningData.hpp"
0016 #include "Acts/Utilities/StringHelpers.hpp"
0017
0018 #include <map>
0019 #include <memory>
0020 #include <string>
0021 #include <vector>
0022
0023 namespace Acts::Experimental {
0024
0025 class IGeometryIdGenerator;
0026 class IInternalStructureBuilder;
0027 class IRootVolumeFinderBuilder;
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040 namespace Blueprint {
0041
0042 struct Node final {
0043
0044
0045
0046
0047
0048
0049
0050
0051 Node(const std::string& n, const Transform3& t, VolumeBounds::BoundsType bt,
0052 const std::vector<ActsScalar>& bv, const std::vector<BinningValue>& bss,
0053 std::vector<std::unique_ptr<Node>> cs = {})
0054 : name(n),
0055 transform(t),
0056 boundsType(bt),
0057 boundaryValues(bv),
0058 children(std::move(cs)),
0059 binning(bss) {
0060 for_each(children.begin(), children.end(),
0061 [this](std::unique_ptr<Node>& c) { c->parent = this; });
0062 }
0063
0064
0065
0066
0067
0068
0069
0070
0071 Node(const std::string& n, const Transform3& t, VolumeBounds::BoundsType bt,
0072 const std::vector<ActsScalar>& bv,
0073 std::shared_ptr<const IInternalStructureBuilder> isb = nullptr)
0074 : name(n),
0075 transform(t),
0076 boundsType(bt),
0077 boundaryValues(bv),
0078 internalsBuilder(std::move(isb)) {}
0079
0080
0081 std::string name = "";
0082
0083 Transform3 transform = Transform3::Identity();
0084
0085 VolumeBounds::BoundsType boundsType = VolumeBounds::eOther;
0086
0087 std::vector<ActsScalar> boundaryValues = {};
0088
0089 const Node* parent = nullptr;
0090
0091 std::vector<std::unique_ptr<Node>> children = {};
0092
0093 std::vector<BinningValue> binning = {};
0094
0095
0096 std::map<unsigned int, BinningDescription> portalMaterialBinning = {};
0097
0098
0099 std::vector<std::string> auxiliary = {};
0100
0101
0102 std::shared_ptr<const IRootVolumeFinderBuilder> rootVolumeFinderBuilder =
0103 nullptr;
0104
0105 std::shared_ptr<const IGeometryIdGenerator> geoIdGenerator = nullptr;
0106
0107 std::shared_ptr<const IInternalStructureBuilder> internalsBuilder = nullptr;
0108
0109
0110 bool isLeaf() const { return children.empty(); }
0111
0112
0113 bool isRoot() const { return parent == nullptr; }
0114
0115
0116
0117 void add(std::unique_ptr<Node> c) {
0118 c->parent = this;
0119 children.push_back(std::move(c));
0120 }
0121 };
0122
0123 }
0124 }