CMS 3D CMS Logo

SiPixelCluster.cc
Go to the documentation of this file.
2 
3 //---------------------------------------------------------------------------
15 //---------------------------------------------------------------------------
16 
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 
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 }
SiPixelCluster::minPixelCol
int minPixelCol() const
Definition: SiPixelCluster.h:152
EcalSCDynamicDPhiParametersESProducer_cfi.yoffset
yoffset
Definition: EcalSCDynamicDPhiParametersESProducer_cfi.py:10
mps_fire.i
i
Definition: mps_fire.py:428
SiPixelCluster::packCol
void packCol(uint16_t ymin, uint16_t yspan)
Definition: SiPixelCluster.h:188
SiPixelCluster::overflowRow
bool overflowRow() const
Definition: SiPixelCluster.h:184
min
T min(T a, T b)
Definition: MathUtil.h:58
EcalSCDynamicDPhiParametersESProducer_cfi.xoffset
xoffset
Definition: EcalSCDynamicDPhiParametersESProducer_cfi.py:12
gpuClustering::adc
uint16_t *__restrict__ uint16_t const *__restrict__ adc
Definition: gpuClusterChargeCut.h:20
cuy.col
col
Definition: cuy.py:1009
SiPixelCluster::maxPixelCol
int maxPixelCol() const
Definition: SiPixelCluster.h:153
SiPixelCluster.h
SiPixelCluster::maxPixelRow
int maxPixelRow() const
Definition: SiPixelCluster.h:151
SiPixelCluster::MAXSPAN
static constexpr unsigned int MAXSPAN
Definition: SiPixelCluster.h:72
SiPixelCluster::overflowCol
bool overflowCol() const
Definition: SiPixelCluster.h:182
SiPixelCluster::add
void add(const PixelPos &pix, int adc)
Definition: SiPixelCluster.cc:25
SiPixelCluster::minPixelRow
int minPixelRow() const
Definition: SiPixelCluster.h:150
SiPixelCluster::thePixelADC
std::vector< uint16_t > thePixelADC
Definition: SiPixelCluster.h:210
SiPixelCluster::thePixelOffset
std::vector< uint8_t > thePixelOffset
Definition: SiPixelCluster.h:209
SiPixelCluster::packRow
void packRow(uint16_t xmin, uint16_t xspan)
Definition: SiPixelCluster.h:192
SiPixelCluster::PixelPos::row
constexpr int row() const
Definition: SiPixelCluster.h:60
SiPixelCluster::SiPixelCluster
SiPixelCluster()=default
SiPixelCluster::PixelPos
Definition: SiPixelCluster.h:56
SiPixelCluster::PixelPos::col
constexpr int col() const
Definition: SiPixelCluster.h:61