File indexing completed on 2026-06-17 07:59:45
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/Seeding2/GbtsConnector.hpp"
0012
0013 #include <cstdint>
0014 #include <map>
0015 #include <memory>
0016 #include <unordered_map>
0017 #include <vector>
0018
0019 namespace Acts::Experimental {
0020
0021
0022 struct TrigInDetSiLayer final {
0023
0024
0025
0026
0027
0028
0029 TrigInDetSiLayer(std::int32_t subdet_, std::int16_t type_, float center_,
0030 float min_, float max_)
0031 : subdet(subdet_),
0032 type(type_),
0033 refCoord(center_),
0034 minBound(min_),
0035 maxBound(max_) {}
0036
0037
0038 std::int32_t subdet{};
0039
0040 std::int32_t type{};
0041
0042 float refCoord{};
0043
0044 float minBound{};
0045
0046 float maxBound{};
0047 };
0048
0049
0050 class GbtsLayer final {
0051 public:
0052
0053
0054
0055
0056 GbtsLayer(const TrigInDetSiLayer& ls, float ew, std::int32_t bin0);
0057
0058
0059
0060
0061
0062
0063 std::int32_t getEtaBin(float zh, float rh) const;
0064
0065
0066
0067
0068 float getMinBinRadius(std::int32_t idx) const;
0069
0070
0071
0072 float getMaxBinRadius(std::int32_t idx) const;
0073
0074
0075
0076 std::int32_t numOfBins() const { return m_bins.size(); }
0077
0078
0079
0080 const std::vector<std::int32_t>& getBins() const { return m_bins; }
0081
0082
0083
0084 const TrigInDetSiLayer& getLayer() const { return *m_layer; }
0085
0086
0087
0088
0089
0090
0091
0092
0093 bool verifyBin(const GbtsLayer& pL, std::uint32_t b1, std::uint32_t b2,
0094 float minZ0, float maxZ0) const;
0095
0096 private:
0097
0098 const TrigInDetSiLayer* m_layer{};
0099
0100 std::vector<std::int32_t> m_bins;
0101
0102 std::vector<float> m_minRadius;
0103
0104 std::vector<float> m_maxRadius;
0105
0106 std::vector<float> m_minBinCoord;
0107
0108 std::vector<float> m_maxBinCoord;
0109
0110
0111 float m_minEta{};
0112
0113 float m_maxEta{};
0114
0115 float m_etaBin{};
0116
0117 float m_etaBinWidth{};
0118
0119 float m_r1{};
0120
0121 float m_z1{};
0122
0123 float m_r2{};
0124
0125 float m_z2{};
0126
0127 std::uint32_t m_nBins{};
0128 };
0129
0130
0131 class GbtsGeometry final {
0132
0133
0134
0135 using BinConnections =
0136 std::unordered_map<std::uint32_t, std::pair<std::vector<std::uint32_t>,
0137 std::vector<std::uint32_t>>>;
0138
0139 public:
0140
0141
0142
0143 GbtsGeometry(const std::vector<TrigInDetSiLayer>& layerGeometry,
0144 const std::unique_ptr<GbtsConnector>& conn);
0145
0146
0147
0148
0149 const GbtsLayer* getGbtsLayerByKey(std::uint32_t key) const;
0150
0151
0152
0153 const GbtsLayer& getGbtsLayerByIndex(std::int32_t idx) const;
0154
0155
0156
0157
0158 inline std::uint32_t getGbtsLayerKeyByIndex(std::uint32_t idx) const {
0159 return m_layerKeys.at(idx);
0160 }
0161
0162
0163
0164 std::uint32_t numBins() const { return m_nEtaBins; }
0165
0166
0167 std::uint32_t numLayers() const { return m_layArray.size(); }
0168
0169
0170 const std::vector<std::pair<std::uint32_t, std::vector<std::uint32_t>>>&
0171 binGroups() const {
0172 return m_binGroups;
0173 }
0174
0175 private:
0176
0177
0178
0179
0180 const GbtsLayer& addNewLayer(const TrigInDetSiLayer& l, std::uint32_t bin0);
0181
0182
0183 float m_etaBinWidth{};
0184
0185
0186 std::map<std::uint32_t, GbtsLayer*> m_layMap;
0187
0188 std::vector<std::unique_ptr<GbtsLayer>> m_layArray;
0189
0190 std::vector<std::uint32_t> m_layerKeys;
0191
0192 std::uint32_t m_nEtaBins{};
0193
0194
0195 std::vector<std::pair<std::uint32_t, std::vector<std::uint32_t>>> m_binGroups;
0196 };
0197
0198 }