ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetDetDescr
PixelGeoModel
src
PixelGeoUtils.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
#include "
ReadoutGeometryBase/PixelDiodeMatrix.h
"
5
#include <
ReadoutGeometryBase/PixelDiodeTree.h
>
6
#include <
ReadoutGeometryBase/PixelDiodeTreeBuilder.h
>
7
#include "
PixelGeoUtils.h
"
8
#include "
PixelGeometryManager.h
"
9
10
namespace
InDetDD
{
11
namespace
detail
{
12
13
PixelDiodeTree
PixelDiodeTreeMakerBase::make
([[maybe_unused]]
InDetDD::PixelReadoutTechnology
readoutTechnology,
14
const
std::array<int,kNDirections> &circuits,
15
const
std::array<int,kNDirections> &dimPerCircuit,
16
const
std::array<std::array<double,kNDirections>,
kNPixelLocations
> &pitch,
17
InDetDD::detail::FENumbering
fe_numbering) {
18
19
// helper function to associate correct diode type and front-end number to sub-matrices and diodes
20
// in the diode tree as attributes.
21
auto
computeAttribute = [
22
&pitch=pitch[
InDetDD::detail::kCentral
],
23
&circuits,
24
&dimPerCircuit,
25
fe_numbering
26
](
const
std::array<PixelDiodeTree::IndexType,2> &split_idx,
27
const
PixelDiodeTree::Vector2D
&diode_width,
28
[[maybe_unused]]
const
std::array<bool,4> &ganged,
29
[[maybe_unused]]
unsigned
int
split_i,
30
PixelDiodeTree::AttributeType
current_matrix_attribute,
31
PixelDiodeTree::AttributeType
current_diode_attribute)
32
-> std::tuple<PixelDiodeTree::AttributeType,PixelDiodeTree::AttributeType>
33
{
34
// split_i defines which of the 4 areas the diode belongs to : 2 | 3 ^
35
// ----- | local-y (chip-columns)
36
// 0 | 1 |
37
// ---> local-x (chip-rows)
38
//
39
// split_idx the absolute index at which this sub-matrix is split into 4 sub-sub-matrices
40
// diode_width the diode pitch in both directions
41
// ganged ganged[0],ganged[1] whether the pixel diode is ganged in the corresponding direction
42
// ganged[2],ganged[3] whether the diode is inside (true) or outside the dead zone
43
// where ganged[2] denotes the flag in local-x and ganged[3] in local-y direction
44
// current_matrix_attribute the default attribute for the unsplit sub-matrix assigned by the builder
45
// current_diode_attribute the default attribute assigned to the current diode associated to the split
46
// area specified by split_i
47
// return new matrix attribute, new diode attribute
48
49
// if the pixel is significantly wider in one direction consider the pixel to be long
50
// or if wider in both directions large
51
assert(split_idx[0]>=0 && split_idx[1]>=0);
52
std::array<int,2> chip_idx{split_idx[0]/dimPerCircuit[
InDetDD::detail::kPhi
], split_idx[1]/dimPerCircuit[
InDetDD::detail::kEta
]};
53
54
unsigned
int
n_large_dimensions = ( (std::abs(diode_width[0]-pitch[
InDetDD::detail::kPhi
])>pitch[
InDetDD::detail::kPhi
]*.25)
55
+(std::abs(diode_width[1]-pitch[
InDetDD::detail::kEta
])>pitch[
InDetDD::detail::kEta
]*.25));
56
switch
(n_large_dimensions) {
57
case
1:
58
current_diode_attribute=
InDetDD::detail::makeAttributeType
(
InDetDD::PixelDiodeType::LONG
);
59
break
;
60
case
2:
61
current_diode_attribute=
InDetDD::detail::makeAttributeType
(
InDetDD::PixelDiodeType::LARGE
);
62
break
;
63
default
:
64
current_diode_attribute=
InDetDD::detail::makeAttributeType
(
InDetDD::PixelDiodeType::NORMAL
);
65
}
66
67
// FEI3 front-end numbering scheme
68
// if there is a single row just the chip-column (local-y, eta)
69
// if there are two rows: top row chip-column starting from the opposite end; bottom row: chip column + chips per top row
70
// ^ 0 |.. |n/2-1
71
// local-x | --------------- [swapped axis direction to fit into fewer lines]
72
// /phi/row | n-1 |... |n/2
73
// --> local-y (chip-column, eta)
74
current_matrix_attribute
75
=
InDetDD::detail::makeAttributeType
( chip_idx[0] > 0
76
? circuits[
InDetDD::detail::kEta
] - chip_idx[1] - 1
77
: (circuits[
InDetDD::detail::kPhi
]-1) * circuits[
InDetDD::detail::kEta
] + chip_idx[1]);
78
79
switch
(fe_numbering) {
80
case
InDetDD::detail::FENumbering::kMirror
: {
81
// for even phi Run <=3 endcap modules the numbering is mirrored
82
if
(circuits[
InDetDD::detail::kPhi
] == 2) {
83
current_matrix_attribute = circuits[
InDetDD::detail::kEta
]- (current_matrix_attribute % circuits[
InDetDD::detail::kEta
]) -1
84
+ ((current_matrix_attribute / circuits[
InDetDD::detail::kEta
]) ^ 1) * circuits[
InDetDD::detail::kEta
];
85
}
86
break
;
87
}
88
default
:
89
break
;
90
}
91
92
return
std::make_tuple(current_matrix_attribute, current_diode_attribute);
93
};
94
95
unsigned
int
nEtaLongEnd = pitch[
InDetDD::detail::kOuterEdge
][
InDetDD::detail::kEta
]>0. ? 1u : 0u;
96
unsigned
int
nEtaLong = pitch[
InDetDD::detail::kInnerEdge
][
InDetDD::detail::kEta
]>0. ? 1u : 0u;
97
PixelDiodeTree
diode_tree
98
=
createPixelDiodeTree
(std::array<unsigned int,2>{
static_cast<
unsigned
int
>
(circuits[
InDetDD::detail::kPhi
]),
99
static_cast<
unsigned
int
>
(circuits[
InDetDD::detail::kEta
])},
100
std::array<unsigned int,2>{
static_cast<
unsigned
int
>
(dimPerCircuit[
InDetDD::detail::kPhi
]),
101
static_cast<
unsigned
int
>
(dimPerCircuit[
InDetDD::detail::kEta
])},
102
PixelDiodeTree::Vector2D
{pitch[
InDetDD::detail::kCentral
][
InDetDD::detail::kPhi
],
103
pitch[
InDetDD::detail::kCentral
][
InDetDD::detail::kEta
]},
// regular ptich
104
std::array<std::array<unsigned int,2>, 2>{ std::array<unsigned int,2>{0u,nEtaLongEnd},
// outer edge in pixels (correct?)
105
std::array<unsigned int,2>{0u,nEtaLong}},
// inner edge in pixels (correct?)
106
std::array<PixelDiodeTree::Vector2D,2>{
PixelDiodeTree::Vector2D
{0.,
107
pitch[
InDetDD::detail::kOuterEdge
][
InDetDD::detail::kEta
]},
108
PixelDiodeTree::Vector2D
{0.,
109
pitch[
InDetDD::detail::kInnerEdge
][
InDetDD::detail::kEta
]}
110
},
111
std::array<std::array<unsigned int,2>, 2>{ std::array<unsigned int,2>{0u,0u},
// @TODO add dead zone for run1-3 pixels
112
std::array<unsigned int,2>{0u,0u}
// @TODO add dead zone for run1-3 pixels
113
},
114
computeAttribute,
115
nullptr
);
116
GEO_MSG_DEBUG
(
"module "
<<
" "
<< circuits[
InDetDD::detail::kPhi
] <<
"x"
<< circuits[
InDetDD::detail::kEta
] <<
" "
117
<< dimPerCircuit[
InDetDD::detail::kPhi
] <<
" "
<< dimPerCircuit[
InDetDD::detail::kEta
] <<
":\n"
118
<<
" pitch: regular "
<< pitch[
InDetDD::detail::kCentral
][
InDetDD::detail::kPhi
]
119
<<
" "
<< pitch[
InDetDD::detail::kCentral
][
InDetDD::detail::kEta
]
120
<<
" long: "
<< pitch[
InDetDD::detail::kInnerEdge
][
InDetDD::detail::kEta
] <<
" end "
<< pitch[
InDetDD::detail::kOuterEdge
][
InDetDD::detail::kEta
] <<
":\n"
121
<< diode_tree.
debugStringRepr
());
122
return
diode_tree;
123
}
124
}
125
}
PixelDiodeMatrix.h
PixelDiodeTreeBuilder.h
PixelDiodeTree.h
PixelGeoUtils.h
GEO_MSG_DEBUG
#define GEO_MSG_DEBUG(body)
Definition
PixelGeoUtils.h:14
PixelGeometryManager.h
InDetDD::PixelDiodeTree
Tree structure to find the position, index or pitch of a pixel on a semi-regular grid The grid is con...
Definition
PixelDiodeTree.h:33
InDetDD::PixelDiodeTree::AttributeType
unsigned int AttributeType
Definition
PixelDiodeTree.h:39
InDetDD::PixelDiodeTree::debugStringRepr
std::string debugStringRepr() const
Dump the diode tree structure into a string.
Definition
PixelDiodeTree.cxx:98
InDetDD::PixelDiodeTree::Vector2D
Amg::Vector2D Vector2D
Definition
PixelDiodeTree.h:35
InDetDD::detail
Definition
PixelDiodeTreeBuilder.h:66
InDetDD::detail::FENumbering
FENumbering
Definition
PixelGeoUtils.h:24
InDetDD::detail::FENumbering::kMirror
@ kMirror
Definition
PixelGeoUtils.h:26
InDetDD::detail::kNPixelLocations
@ kNPixelLocations
Definition
PixelGeoUtils.h:21
InDetDD::detail::kInnerEdge
@ kInnerEdge
Definition
PixelGeoUtils.h:21
InDetDD::detail::kOuterEdge
@ kOuterEdge
Definition
PixelGeoUtils.h:21
InDetDD::detail::kCentral
@ kCentral
Definition
PixelGeoUtils.h:21
InDetDD::detail::kPhi
@ kPhi
Definition
PixelGeoUtils.h:22
InDetDD::detail::kEta
@ kEta
Definition
PixelGeoUtils.h:22
InDetDD::detail::makeAttributeType
InDetDD::PixelDiodeTree::AttributeType makeAttributeType(T val)
convenience method to convert the given value into an attribute
Definition
PixelDiodeTreeBuilder.h:78
InDetDD
Message Stream Member.
Definition
FakeTrackBuilder.h:8
InDetDD::PixelDiodeType::NORMAL
@ NORMAL
Definition
PixelReadoutDefinitions.h:30
InDetDD::PixelDiodeType::LARGE
@ LARGE
Definition
PixelReadoutDefinitions.h:33
InDetDD::PixelDiodeType::LONG
@ LONG
Definition
PixelReadoutDefinitions.h:31
InDetDD::PixelReadoutTechnology
PixelReadoutTechnology
Definition
PixelReadoutDefinitions.h:37
InDetDD::createPixelDiodeTree
PixelDiodeTree createPixelDiodeTree(const std::array< unsigned int, 2 > &chip_dim, const std::array< unsigned int, 2 > &chip_matrix_dim, const PixelDiodeTree::Vector2D &pitch, const std::array< std::array< unsigned int, 2 >, 2 > &edge_dim, const std::array< PixelDiodeTree::Vector2D, 2 > &edge_pitch, const std::array< std::array< unsigned int, 2 >, 2 > &dead_zone, const AttributeRefiner &func_compute_attribute, std::ostream *debug_out=nullptr)
Create a pixel diode tree.
Definition
PixelDiodeTreeBuilder.cxx:224
InDetDD::detail::PixelDiodeTreeMakerBase::make
PixelDiodeTree make(InDetDD::PixelReadoutTechnology readoutTechnology, const std::array< int, kNDirections > &circuits, const std::array< int, kNDirections > &dimPerCircuit, const std::array< std::array< double, kNDirections >, kNPixelLocations > &pitch, FENumbering fe_numbering)
Definition
PixelGeoUtils.cxx:13
Generated on
for ATLAS Offline Software by
1.17.0