ATLAS Offline Software
Loading...
Searching...
No Matches
GbtsConnectionTableReader.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7#include <istream>
8#include <stdexcept>
9#include <string>
10
11namespace ActsTrk {
12
14 std::istream& inputStream) {
15 ReadResult result;
16
17 std::uint32_t nConnections{};
18 std::uint32_t iConnection{};
19
20 const auto fail = [&nConnections, &iConnection](const std::string& what) {
21 throw std::runtime_error("GBTS connection table: cannot read " + what +
22 " at connection " + std::to_string(iConnection) +
23 " of " + std::to_string(nConnections));
24 };
25
26 if (!(inputStream >> nConnections >> result.etaBinWidth)) {
27 throw std::runtime_error(
28 "GBTS connection table: cannot read the connection count and the eta "
29 "bin width");
30 }
31
32 for (; iConnection < nConnections; ++iConnection) {
33 std::uint32_t index{};
34 std::uint32_t height{};
35 std::uint32_t width{};
36 std::uint32_t nEntries{};
37 Connection connection;
38
39 if (!(inputStream >> index >> connection.stage >> connection.src >>
40 connection.dst >> height >> width >> nEntries)) {
41 fail("the header");
42 }
43
44 // GBTS recomputes the bin table from the layer geometry
45 const std::uint64_t nBins = std::uint64_t{height} * width;
46 for (std::uint64_t bin = 0; bin < nBins; ++bin) {
47 std::uint32_t unused{};
48 if (!(inputStream >> unused)) {
49 fail("the bin table");
50 }
51 }
52
53 result.connections.push_back(connection);
54 }
55
56 return result;
57}
58
59} // namespace ActsTrk
const double width
void unused(Args &&...)
ReadResult read(std::istream &inputStream)
Read the GBTS layer connection table.
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Definition index.py:1
One row of the table: the two layers it connects, and the stage it is in.