ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetDetDescr
PixelReadoutGeometry
PixelReadoutGeometry
PixelFEUtils.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
#ifndef PIXELFEUTILS_H
5
#define PIXELFEUTILS_H
6
7
#include "
InDetReadoutGeometry/SiDetectorElementStatus.h
"
8
#include "
PixelReadoutGeometry/PixelModuleDesign.h
"
9
#include "
InDetIdentifier/PixelID.h
"
10
#include <algorithm>
11
#include <tuple>
12
#include <limits>
13
#include <cassert>
14
#include <array>
15
#include <cstdint>
16
17
namespace
Pixel
{
18
21
template
<
typename
T>
22
inline
std::tuple<T,T>
sorted_tuple
(T
a
, T b) {
23
return
(
a
<b ? std::make_tuple(
a
,b) : std::make_tuple(b,
a
) );
24
}
25
34
inline
double
getGoodFraction
(
const
InDet::SiDetectorElementStatus
&pixelDetElStatus,
35
const
InDetDD::PixelModuleDesign
&design,
36
const
PixelID
&pixelID,
37
const
IdentifierHash
&modulIdHash,
38
const
Identifier
&startId,
39
const
Identifier
&endId) {
40
auto
[phiStart,phiEnd] =
sorted_tuple
( pixelID.
phi_index
(startId), pixelID.
phi_index
(endId) );
41
auto
[etaStart,etaEnd] =
sorted_tuple
( pixelID.
eta_index
(startId), pixelID.
eta_index
(endId) );
42
43
double
nTotal = (phiEnd-phiStart+1.0)*(etaEnd-etaStart+1.0);
44
45
unsigned
int
nGood=0;
46
for
(
int
i=phiStart; i<=phiEnd; i++) {
47
for
(
int
j=etaStart; j<=etaEnd; j++) {
48
49
std::array<InDetDD::PixelDiodeTree::CellIndexType,2> diode_idx
50
=
InDetDD::PixelDiodeTree::makeCellIndex
(i,j);
51
InDetDD::PixelDiodeTree::DiodeProxy
si_param ( design.
diodeProxyFromIdx
(diode_idx));
52
std::uint32_t feValue = design.
getFE
(si_param);
53
54
if
(pixelDetElStatus.
isChipGood
(modulIdHash,feValue)) {++nGood;}
55
}
56
}
57
return
nGood/nTotal;
58
}
59
65
inline
unsigned
int
makeReadoutTechnologyBit
(
InDetDD::PixelReadoutTechnology
technology,
unsigned
int
bit_val=1 ) {
66
assert(
static_cast<
unsigned
int
>
(technology) < 31);
//technology can be -1
67
//shift amount ( = technology) is checked in dbg build
68
//coverity[BAD_SHIFT]
69
return
bit_val << static_cast<unsigned int>(technology);
70
}
71
77
inline
bool
matchingReadoutTechnology
(
const
InDet::SiDetectorElementStatus
&elementStatus,
78
const
IdentifierHash
&moduleIdHash,
79
unsigned
int
readOutTechnologyMask = (
Pixel::makeReadoutTechnologyBit
(
InDetDD::PixelReadoutTechnology::FEI4
)
80
| (
Pixel::makeReadoutTechnologyBit
(
InDetDD::PixelReadoutTechnology::FEI3
) ) ))
81
{
82
const
InDetDD::SiDetectorElement
*element = elementStatus.
getDetectorElement
(moduleIdHash);
83
const
InDetDD::PixelModuleDesign
&p_design =
dynamic_cast<
const
InDetDD::PixelModuleDesign
&
>
(element->
design
());
84
return
(
static_cast<
uint64_t
>
(p_design.
getReadoutTechnology
()) < 31ul && readOutTechnologyMask &
Pixel::makeReadoutTechnologyBit
(p_design.
getReadoutTechnology
()) );
85
}
86
87
}
88
#endif
a
static Double_t a
Definition
LArPhysWaveHECTool.cxx:38
PixelID.h
This is an Identifier helper class for the Pixel subdetector.
PixelModuleDesign.h
SiDetectorElementStatus.h
IdentifierHash
This is a "hash" representation of an Identifier.
Definition
IdentifierHash.h:25
InDetDD::PixelDiodeTree::makeCellIndex
static constexpr std::array< PixelDiodeTree::CellIndexType, 2 > makeCellIndex(T local_x_idx, T local_y_idx)
Create a 2D cell index from the indices in local-x (phi, row) and local-y (eta, column) direction.
Definition
PixelDiodeTree.h:320
InDetDD::PixelModuleDesign
Class used to describe the design of a module (diode segmentation and readout scheme).
Definition
PixelModuleDesign.h:45
InDetDD::PixelModuleDesign::getReadoutTechnology
PixelReadoutTechnology getReadoutTechnology() const
Definition
PixelModuleDesign.h:391
InDetDD::PixelModuleDesign::diodeProxyFromIdx
PixelDiodeTree::DiodeProxy diodeProxyFromIdx(const std::array< PixelDiodeTree::IndexType, 2 > &idx) const
Definition
PixelModuleDesign.h:248
InDetDD::PixelModuleDesign::getFE
static unsigned int getFE(const PixelDiodeTree::DiodeProxy &diode_proxy)
Definition
PixelModuleDesign.h:258
InDetDD::SiDetectorElement
Class to hold geometrical description of a silicon detector element.
Definition
SiDetectorElement.h:109
InDetDD::SiDetectorElement::design
virtual const SiDetectorDesign & design() const override final
access to the local description (inline):
InDet::SiDetectorElementStatus
Definition
SiDetectorElementStatus.h:62
InDet::SiDetectorElementStatus::isChipGood
bool isChipGood(IdentifierHash hash, unsigned int chip) const
Definition
SiDetectorElementStatus.h:100
InDet::SiDetectorElementStatus::getDetectorElement
const InDetDD::SiDetectorElement * getDetectorElement(const IdentifierHash &hash) const
Definition
SiDetectorElementStatus.h:91
PixelID
This is an Identifier helper class for the Pixel subdetector.
Definition
PixelID.h:69
PixelID::eta_index
int eta_index(const Identifier &id) const
Definition
PixelID.h:640
PixelID::phi_index
int phi_index(const Identifier &id) const
Definition
PixelID.h:634
Identifier
Definition
IdentifierFieldParser.cxx:14
InDetDD::PixelReadoutTechnology
PixelReadoutTechnology
Definition
PixelReadoutDefinitions.h:37
InDetDD::PixelReadoutTechnology::FEI4
@ FEI4
Definition
PixelReadoutDefinitions.h:40
InDetDD::PixelReadoutTechnology::FEI3
@ FEI3
Definition
PixelReadoutDefinitions.h:39
Pixel
Definition
PixelFEUtils.h:17
Pixel::matchingReadoutTechnology
bool matchingReadoutTechnology(const InDet::SiDetectorElementStatus &elementStatus, const IdentifierHash &moduleIdHash, unsigned int readOutTechnologyMask=(Pixel::makeReadoutTechnologyBit(InDetDD::PixelReadoutTechnology::FEI4)|(Pixel::makeReadoutTechnologyBit(InDetDD::PixelReadoutTechnology::FEI3))))
Check whether the readout technology of the specified module is contained in the given readout techno...
Definition
PixelFEUtils.h:77
Pixel::getGoodFraction
double getGoodFraction(const InDet::SiDetectorElementStatus &pixelDetElStatus, const InDetDD::PixelModuleDesign &design, const PixelID &pixelID, const IdentifierHash &modulIdHash, const Identifier &startId, const Identifier &endId)
Get The fraction of good chips the pixel of a pixel array is connected to.
Definition
PixelFEUtils.h:34
Pixel::makeReadoutTechnologyBit
unsigned int makeReadoutTechnologyBit(InDetDD::PixelReadoutTechnology technology, unsigned int bit_val=1)
Create a word with a bit representing the given readout technology to the given value.
Definition
PixelFEUtils.h:65
Pixel::sorted_tuple
std::tuple< T, T > sorted_tuple(T a, T b)
Create a tuple of the given values in increasing order.
Definition
PixelFEUtils.h:22
InDetDD::PixelDiodeTree::DiodeProxy
Helper class to access parameters of a diode.
Definition
PixelDiodeTree.h:183
Generated on
for ATLAS Offline Software by
1.17.0