File indexing completed on 2025-01-18 09:10:45
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/Extent.hpp"
0015 #include "Acts/Geometry/VolumeBounds.hpp"
0016 #include "Acts/Utilities/AxisDefinitions.hpp"
0017 #include "Acts/Utilities/StringHelpers.hpp"
0018
0019 #include <map>
0020 #include <memory>
0021 #include <string>
0022 #include <vector>
0023
0024 namespace Acts::Experimental {
0025
0026 class IGeometryIdGenerator;
0027 class IInternalStructureBuilder;
0028 class IRootVolumeFinderBuilder;
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041 namespace Blueprint {
0042
0043 struct Node final {
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053 Node(const std::string& n, const Transform3& t, VolumeBounds::BoundsType bt,
0054 const std::vector<double>& bv, const std::vector<AxisDirection>& bss,
0055 std::vector<std::unique_ptr<Node>> cs = {}, const Extent& e = Extent())
0056 : name(n),
0057 transform(t),
0058 boundsType(bt),
0059 boundaryValues(bv),
0060 children(std::move(cs)),
0061 binning(bss),
0062 extent(e) {
0063 for_each(children.begin(), children.end(),
0064 [this](std::unique_ptr<Node>& c) { c->parent = this; });
0065 }
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075 Node(const std::string& n, const Transform3& t, VolumeBounds::BoundsType bt,
0076 const std::vector<double>& bv,
0077 std::shared_ptr<const IInternalStructureBuilder> isb = nullptr,
0078 const Extent& e = Extent())
0079 : name(n),
0080 transform(t),
0081 boundsType(bt),
0082 boundaryValues(bv),
0083 internalsBuilder(std::move(isb)),
0084 extent(e) {}
0085
0086
0087 std::string name = "";
0088
0089 Transform3 transform = Transform3::Identity();
0090
0091 VolumeBounds::BoundsType boundsType = VolumeBounds::eOther;
0092
0093 std::vector<double> boundaryValues = {};
0094
0095 const Node* parent = nullptr;
0096
0097 std::vector<std::unique_ptr<Node>> children = {};
0098
0099 std::vector<AxisDirection> binning = {};
0100
0101
0102 std::map<unsigned int, BinningDescription> portalMaterialBinning = {};
0103
0104
0105 std::vector<std::string> auxiliary = {};
0106
0107
0108 std::shared_ptr<const IRootVolumeFinderBuilder> rootVolumeFinderBuilder =
0109 nullptr;
0110
0111 std::shared_ptr<const IGeometryIdGenerator> geoIdGenerator = nullptr;
0112
0113 std::shared_ptr<const IInternalStructureBuilder> internalsBuilder = nullptr;
0114
0115
0116 Extent extent = Extent();
0117
0118
0119 bool isLeaf() const { return children.empty(); }
0120
0121
0122 bool isRoot() const { return parent == nullptr; }
0123
0124
0125
0126 void add(std::unique_ptr<Node> c) {
0127 c->parent = this;
0128 children.push_back(std::move(c));
0129 }
0130 };
0131
0132 }
0133 }