DataFormats
SiPixelCluster
src
SiPixelCluster.cc
Go to the documentation of this file.
1
#include "
DataFormats/SiPixelCluster/interface/SiPixelCluster.h
"
2
3
//---------------------------------------------------------------------------
15
//---------------------------------------------------------------------------
16
17
SiPixelCluster::SiPixelCluster
(
const
SiPixelCluster::PixelPos
& pix,
int
adc
)
18
: theMinPixelRow(pix.row()), theMinPixelCol(pix.
col
()) {
19
// First pixel in this cluster.
20
thePixelADC
.push_back(
adc
);
21
thePixelOffset
.push_back(0);
22
thePixelOffset
.push_back(0);
23
}
24
25
void
SiPixelCluster::add
(
const
SiPixelCluster::PixelPos
& pix,
int
adc
) {
26
int
ominRow =
minPixelRow
();
27
int
ominCol =
minPixelCol
();
28
bool
recalculate =
false
;
29
30
int
minRow = ominRow;
31
int
minCol = ominCol;
32
33
if
(pix.
row
() < minRow) {
34
minRow = pix.
row
();
35
recalculate =
true
;
36
}
37
if
(pix.
col
() < minCol) {
38
minCol = pix.
col
();
39
recalculate =
true
;
40
}
41
42
if
(recalculate) {
43
int
maxCol = 0;
44
int
maxRow = 0;
45
int
isize =
thePixelADC
.size();
46
for
(
int
i
= 0;
i
< isize; ++
i
) {
47
int
xoffset =
thePixelOffset
[
i
* 2] + ominRow - minRow;
48
int
yoffset =
thePixelOffset
[
i
* 2 + 1] + ominCol - minCol;
49
thePixelOffset
[
i
* 2] =
std::min
(
int
(
MAXSPAN
), xoffset);
50
thePixelOffset
[
i
* 2 + 1] =
std::min
(
int
(
MAXSPAN
), yoffset);
51
if
(xoffset > maxRow)
52
maxRow = xoffset;
53
if
(yoffset > maxCol)
54
maxCol = yoffset;
55
}
56
packRow
(minRow, maxRow);
57
packCol
(minCol, maxCol);
58
}
59
60
if
((!
overflowRow
()) && pix.
row
() >
maxPixelRow
())
61
packRow
(minRow, pix.
row
() - minRow);
62
63
if
((!
overflowCol
()) && pix.
col
() >
maxPixelCol
())
64
packCol
(minCol, pix.
col
() - minCol);
65
66
thePixelADC
.push_back(
adc
);
67
thePixelOffset
.push_back(
std::min
(
int
(
MAXSPAN
), pix.
row
() - minRow));
68
thePixelOffset
.push_back(
std::min
(
int
(
MAXSPAN
), pix.
col
() - minCol));
69
}
ecalMGPA::adc
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
Definition:
EcalMGPASample.h:11
SiPixelCluster::minPixelCol
int minPixelCol() const
Definition:
SiPixelCluster.h:140
mps_fire.i
i
Definition:
mps_fire.py:355
SiPixelCluster::packCol
void packCol(uint16_t ymin, uint16_t yspan)
Definition:
SiPixelCluster.h:176
SiPixelCluster::overflowRow
bool overflowRow() const
Definition:
SiPixelCluster.h:172
min
T min(T a, T b)
Definition:
MathUtil.h:58
cuy.col
col
Definition:
cuy.py:1010
SiPixelCluster::maxPixelCol
int maxPixelCol() const
Definition:
SiPixelCluster.h:141
SiPixelCluster.h
SiPixelCluster::maxPixelRow
int maxPixelRow() const
Definition:
SiPixelCluster.h:139
SiPixelCluster::MAXSPAN
static constexpr unsigned int MAXSPAN
Definition:
SiPixelCluster.h:68
SiPixelCluster::overflowCol
bool overflowCol() const
Definition:
SiPixelCluster.h:170
SiPixelCluster::add
void add(const PixelPos &pix, int adc)
Definition:
SiPixelCluster.cc:25
SiPixelCluster::minPixelRow
int minPixelRow() const
Definition:
SiPixelCluster.h:138
SiPixelCluster::thePixelADC
std::vector< uint16_t > thePixelADC
Definition:
SiPixelCluster.h:194
SiPixelCluster::SiPixelCluster
SiPixelCluster()
Definition:
SiPixelCluster.h:75
SiPixelCluster::thePixelOffset
std::vector< uint8_t > thePixelOffset
Definition:
SiPixelCluster.h:193
SiPixelCluster::packRow
void packRow(uint16_t xmin, uint16_t xspan)
Definition:
SiPixelCluster.h:180
SiPixelCluster::PixelPos::row
constexpr int row() const
Definition:
SiPixelCluster.h:56
SiPixelCluster::PixelPos
Definition:
SiPixelCluster.h:52
SiPixelCluster::PixelPos::col
constexpr int col() const
Definition:
SiPixelCluster.h:57
Generated for CMSSW Reference Manual by
1.8.16