File indexing completed on 2026-06-17 07:59:44
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/Seeding2/GbtsConfig.hpp"
0012
0013 #include <array>
0014 #include <cstdint>
0015 #include <limits>
0016 #include <memory>
0017 #include <span>
0018 #include <vector>
0019
0020 namespace Acts::Experimental {
0021
0022
0023 constexpr std::uint32_t gbtsNumSegConns = 6;
0024
0025 class GbtsGeometry;
0026
0027
0028 using GbtsMlLookupTable = std::vector<std::array<float, 5>>;
0029
0030
0031 struct GbtsNode final {
0032 public:
0033
0034
0035 explicit GbtsNode(std::uint16_t layer_) : layer(layer_) {};
0036
0037
0038 float x{};
0039
0040 float y{};
0041
0042 float z{};
0043
0044 float r{};
0045
0046 float phi{};
0047
0048 std::uint16_t layer{};
0049
0050 std::uint32_t idx{std::numeric_limits<std::uint32_t>::max()};
0051
0052 float pcw{};
0053
0054 float locPosY{};
0055 };
0056
0057
0058 struct GbtsEtaBin final {
0059 GbtsEtaBin();
0060
0061
0062 void sortByPhi();
0063
0064 void initializeNodes();
0065
0066
0067 bool empty() const { return vn.empty(); }
0068
0069
0070
0071 void generatePhiIndexing(float dphi);
0072
0073
0074 std::vector<const GbtsNode*> vn;
0075
0076 std::vector<std::pair<float, std::uint32_t>> vPhiNodes;
0077
0078 std::vector<std::array<float, 5>> params;
0079
0080 std::vector<std::uint32_t> vFirstEdge;
0081
0082 std::vector<std::uint16_t> vNumEdges;
0083
0084
0085 std::vector<std::uint16_t> vIsConnected;
0086
0087
0088 float minRadius{};
0089
0090 float maxRadius{};
0091
0092
0093 std::uint32_t layerKey{0};
0094 };
0095
0096
0097 class GbtsDataStorage final {
0098 public:
0099
0100
0101
0102
0103 explicit GbtsDataStorage(const GbtsConfig& config,
0104 std::shared_ptr<const GbtsGeometry> geometry,
0105 GbtsMlLookupTable mlLut);
0106
0107
0108
0109
0110
0111
0112 std::uint32_t loadPixelGraphNodes(std::uint16_t layerIndex,
0113 const std::span<const GbtsNode> coll,
0114 bool useMl);
0115
0116
0117
0118
0119 std::uint32_t loadStripGraphNodes(std::uint16_t layerIndex,
0120 const std::span<const GbtsNode> coll);
0121
0122
0123
0124 std::uint32_t numberOfNodes() const;
0125
0126 void sortByPhi();
0127
0128
0129 void initializeNodes(bool useMl);
0130
0131
0132 void generatePhiIndexing(float dphi);
0133
0134
0135
0136
0137 GbtsEtaBin& getEtaBin(std::uint32_t idx) {
0138 if (idx >= m_etaBins.size()) {
0139 idx = idx - 1;
0140 }
0141 return m_etaBins.at(idx);
0142 }
0143
0144 private:
0145
0146 std::shared_ptr<const GbtsGeometry> m_geo;
0147
0148
0149 GbtsConfig m_cfg{};
0150
0151
0152 GbtsMlLookupTable m_mlLut;
0153
0154
0155 std::vector<GbtsEtaBin> m_etaBins;
0156 };
0157
0158
0159 struct GbtsEdge final {
0160 GbtsEdge() = default;
0161
0162
0163
0164
0165
0166
0167
0168 GbtsEdge(const GbtsNode* n1_, const GbtsNode* n2_, float p1_, float p2_,
0169 float p3_)
0170 : n1{n1_}, n2{n2_}, level{1}, next{1}, p{p1_, p2_, p3_} {}
0171
0172
0173 const GbtsNode* n1{nullptr};
0174
0175 const GbtsNode* n2{nullptr};
0176
0177
0178 std::int8_t level{-1};
0179
0180 std::int8_t next{-1};
0181
0182
0183 std::uint8_t nNei{0};
0184
0185 std::array<float, 3> p{};
0186
0187
0188 std::array<std::uint32_t, gbtsNumSegConns> vNei{};
0189 };
0190
0191 }