ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
DetectorDescription
ReadoutGeometryBase
src
PixelReadoutScheme.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
// PixelReadoutScheme.cxx
7
// Implementation file for class PixelReadoutScheme
9
// (c) ATLAS Pixel Detector software
11
// Version 2.1 08/06/2001 David Calvet
12
// Modified: Grant Gorfine
14
15
#include "
ReadoutGeometryBase/PixelReadoutScheme.h
"
16
#include "
ReadoutGeometryBase/SiCellId.h
"
17
#include "
ReadoutGeometryBase/SiReadoutCellId.h
"
18
19
namespace
InDetDD
{
20
21
// Constructor with parameters:
22
PixelReadoutScheme::PixelReadoutScheme
(
const
int
circuitsPerColumn,
23
const
int
circuitsPerRow,
24
const
int
cellColumnsPerCircuit,
25
const
int
cellRowsPerCircuit,
26
const
int
diodeColumnsPerCircuit,
27
const
int
diodeRowsPerCircuit) :
28
m_numberOfCircuits
(circuitsPerColumn*circuitsPerRow),
29
m_numberOfCircuitsPerColumn
(circuitsPerColumn),
30
m_numberOfCircuitsPerRow
(circuitsPerRow),
31
m_columnsPerCircuit
(cellColumnsPerCircuit),
32
m_rowsPerCircuit
(cellRowsPerCircuit),
33
m_columns
(circuitsPerRow*diodeColumnsPerCircuit),
34
m_rows
(circuitsPerColumn*diodeRowsPerCircuit)
35
{
36
// protect against 0 columns or rows
37
if
(!
m_columns
)
throw
std::runtime_error(
"PixelReadoutScheme: Number of columns is 0"
);
38
if
(!
m_rows
)
throw
std::runtime_error(
"PixelReadoutScheme: Number of columns is 0"
);
39
}
40
41
42
43
// Number of cells connected to this readout. 2 means its ganged.
44
int
45
PixelReadoutScheme::numberOfConnectedCells
(
const
SiReadoutCellId
& readoutId)
const
46
{
47
if
(!readoutId.
isValid
())
return
0;
48
49
// Do quick check to see if it is outside ganged pixel range.
50
int
phiIndex = readoutId.
phiIndex
();
51
if
(
m_rowConnections
.outsideReadout(phiIndex))
return
1;
52
53
return
m_rowConnections
.numberOfConnectedCells(phiIndex);
54
55
}
56
57
// Id of diodes connected to this readout. 0 is the primary cell.
58
SiCellId
59
PixelReadoutScheme::connectedCell
(
const
SiReadoutCellId
& readoutId,
unsigned
int
number
)
const
60
{
61
if
(!readoutId.
isValid
())
return
{};
62
63
// Do quick check to see if it is outside ganged pixel range.
64
int
phiIndex = readoutId.
phiIndex
();
65
if
(
m_rowConnections
.outsideReadout(phiIndex))
return
readoutId;
66
67
int
numConnected =
m_rowConnections
.numberOfConnectedCells(phiIndex);
68
if
(!numConnected ||
static_cast<
int
>
(
number
) >= numConnected)
return
{};
69
70
int
newPhiIndex =
m_rowConnections
.connectedCell(phiIndex,
number
);
71
return
{newPhiIndex, readoutId.
etaIndex
()};
72
}
73
74
// Id of the readout cell for this diode.
75
SiReadoutCellId
76
PixelReadoutScheme::readoutIdOfCell
(
const
SiCellId
& cellId)
const
77
{
78
if
(!cellId.
isValid
())
return
{};
79
80
int
phiIndex = cellId.
phiIndex
();
81
int
newPhiIndex = phiIndex;
82
if
(!
m_rowConnections
.outsideDiode(phiIndex)) {
83
newPhiIndex =
m_rowConnections
.readoutOfDiode(phiIndex);
84
}
85
86
return
{newPhiIndex, cellId.
etaIndex
()};
87
88
}
89
90
SiCellId
91
PixelReadoutScheme::gangedCell
(
const
SiCellId
& cellId)
const
92
{
93
if
(!cellId.
isValid
())
return
cellId;
94
int
phiIndex = cellId.
phiIndex
();
95
if
(
m_rowConnections
.outsideReadout(phiIndex))
return
{};
// Invalid ID
96
int
newPhiIndex =
m_rowConnections
.gangedCell(phiIndex);
97
if
(newPhiIndex == phiIndex)
return
{};
// Invalid ID
98
return
{newPhiIndex, cellId.
etaIndex
()};
99
}
100
101
102
void
PixelReadoutScheme::addMultipleRowConnection
(
const
int
lowerIndex,
103
const
std::vector<int> &connections)
104
{
105
106
m_rowConnections
.set(lowerIndex, connections);
107
}
108
109
110
}
// namespace InDetDD
PixelReadoutScheme.h
SiCellId.h
SiReadoutCellId.h
InDetDD::PixelReadoutScheme::m_numberOfCircuitsPerColumn
int m_numberOfCircuitsPerColumn
number of circuits per column
Definition
PixelReadoutScheme.h:124
InDetDD::PixelReadoutScheme::m_numberOfCircuitsPerRow
int m_numberOfCircuitsPerRow
number of circuits per row
Definition
PixelReadoutScheme.h:125
InDetDD::PixelReadoutScheme::m_numberOfCircuits
int m_numberOfCircuits
total number of circuits
Definition
PixelReadoutScheme.h:123
InDetDD::PixelReadoutScheme::connectedCell
SiCellId connectedCell(const SiReadoutCellId &readoutId, unsigned int number) const
Cell ids of cell connected to this readout.
Definition
PixelReadoutScheme.cxx:59
InDetDD::PixelReadoutScheme::readoutIdOfCell
SiReadoutCellId readoutIdOfCell(const SiCellId &cellId) const
Readout id of this diode.
Definition
PixelReadoutScheme.cxx:76
InDetDD::PixelReadoutScheme::m_rowConnections
PixelMultipleConnection1D m_rowConnections
multiple connections for rows
Definition
PixelReadoutScheme.h:122
InDetDD::PixelReadoutScheme::m_rowsPerCircuit
int m_rowsPerCircuit
number of cell rows per circuit
Definition
PixelReadoutScheme.h:127
InDetDD::PixelReadoutScheme::m_columns
int m_columns
Number of columns.
Definition
PixelReadoutScheme.h:128
InDetDD::PixelReadoutScheme::m_rows
int m_rows
Number of rows.
Definition
PixelReadoutScheme.h:129
InDetDD::PixelReadoutScheme::gangedCell
SiCellId gangedCell(const SiCellId &cellId) const
If cell is ganged return the other cell, otherwise return an invalid id.
Definition
PixelReadoutScheme.cxx:91
InDetDD::PixelReadoutScheme::PixelReadoutScheme
PixelReadoutScheme()
InDetDD::PixelReadoutScheme::numberOfConnectedCells
int numberOfConnectedCells(const SiReadoutCellId &readoutId) const
number of cells connected to this readout.
Definition
PixelReadoutScheme.cxx:45
InDetDD::PixelReadoutScheme::addMultipleRowConnection
void addMultipleRowConnection(const int lowerRow, const std::vector< int > &connections)
Add a new multiple connection for rows: lower diode row for which the connection scheme is given vect...
Definition
PixelReadoutScheme.cxx:102
InDetDD::PixelReadoutScheme::m_columnsPerCircuit
int m_columnsPerCircuit
number of cell columns per circuit
Definition
PixelReadoutScheme.h:126
InDetDD::SiCellId
Identifier for the strip or pixel cell.
Definition
SiCellId.h:29
InDetDD::SiCellId::phiIndex
int phiIndex() const
Get phi index. Equivalent to strip().
Definition
SiCellId.h:122
InDetDD::SiCellId::isValid
bool isValid() const
Test if its in a valid state.
Definition
SiCellId.h:136
InDetDD::SiCellId::etaIndex
int etaIndex() const
Get eta index.
Definition
SiCellId.h:114
InDetDD::SiReadoutCellId
Identifier for the strip or pixel readout cell.
Definition
SiReadoutCellId.h:42
InDetDD
Message Stream Member.
Definition
FakeTrackBuilder.h:8
number
std::string number(const double &d, const std::string &s)
Definition
utils.cxx:186
Generated on
for ATLAS Offline Software by
1.17.0