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