ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tracking
Acts
ActsPatternRecognition
src
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
5
#include "
src/GbtsConnectionTableReader.h
"
6
7
#include <istream>
8
#include <stdexcept>
9
#include <string>
10
11
namespace
ActsTrk
{
12
13
GbtsConnectionTable::ReadResult
GbtsConnectionTable::read
(
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
GbtsConnectionTableReader.h
width
const double width
Definition
TTileTripReader.cxx:24
unused
void unused(Args &&...)
Definition
VP1ExpertSettings.cxx:39
bin
Definition
BinsDiffFromStripMedian.h:43
ActsTrk::GbtsConnectionTable::read
ReadResult read(std::istream &inputStream)
Read the GBTS layer connection table.
Definition
GbtsConnectionTableReader.cxx:13
ActsTrk
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Definition
MdtCalibInput.h:31
index
Definition
index.py:1
ActsTrk::GbtsConnectionTable::Connection
One row of the table: the two layers it connects, and the stage it is in.
Definition
GbtsConnectionTableReader.h:15
ActsTrk::GbtsConnectionTable::Connection::src
std::uint32_t src
Definition
GbtsConnectionTableReader.h:17
ActsTrk::GbtsConnectionTable::Connection::dst
std::uint32_t dst
Definition
GbtsConnectionTableReader.h:18
ActsTrk::GbtsConnectionTable::Connection::stage
std::uint32_t stage
Definition
GbtsConnectionTableReader.h:16
ActsTrk::GbtsConnectionTable::ReadResult
The table as it is on file.
Definition
GbtsConnectionTableReader.h:22
Generated on
for ATLAS Offline Software by
1.17.0