CMS 3D CMS Logo

Phase2ITPixelCluster.cc
Go to the documentation of this file.
2 
3 //---------------------------------------------------------------------------
15 //---------------------------------------------------------------------------
16 
18 
20  thePixelRow(pix.row()),
21  thePixelCol(pix.col()),
22  // ggiurgiu@fnal.gov, 01/05/12
23  // Initialize the split cluster errors to un-physical values.
24  // The CPE will check these errors and if they are not un-physical,
25  // it will recognize the clusters as split and assign these (increased)
26  // errors to the corresponding rechit.
27  err_x(-99999.9),
28  err_y(-99999.9)
29 {
30  // First pixel in this cluster.
31  thePixelADC.push_back( adc );
32  thePixelOffset.push_back(0 );
33  thePixelOffset.push_back(0 );
34 }
35 
37 
38  uint32_t ominRow = minPixelRow();
39  uint32_t ominCol = minPixelCol();
40  bool recalculate = false;
41 
42  uint32_t minRow = ominRow;
43  uint32_t minCol = ominCol;
44 
45  if (pix.row() < minRow) {
46  minRow = pix.row();
47  recalculate = true;
48  }
49  if (pix.col() < minCol) {
50  minCol = pix.col();
51  recalculate = true;
52  }
53 
54  if (recalculate) {
55  int maxCol = 0;
56  int maxRow = 0;
57  int isize = thePixelADC.size();
58  for (int i=0; i<isize; ++i) {
59  int xoffset = thePixelOffset[i*2] + ominRow - minRow;
60  int yoffset = thePixelOffset[i*2+1] + ominCol -minCol;
61  thePixelOffset[i*2] = std::min(int(MAXSPAN),xoffset);
62  thePixelOffset[i*2+1] = std::min(int(MAXSPAN),yoffset);
63  if (xoffset > maxRow) maxRow = xoffset;
64  if (yoffset > maxCol) maxCol = yoffset;
65  }
66  packRow(minRow,maxRow);
67  packCol(minCol,maxCol);
68  }
69 
70  if ( (!overflowRow()) && pix.row() > maxPixelRow())
71  packRow(minRow,pix.row()-minRow);
72 
73  if ( (!overflowCol()) && pix.col() > maxPixelCol())
74  packCol(minCol,pix.col()-minCol);
75 
76  thePixelADC.push_back( adc );
77  thePixelOffset.push_back( std::min(MAXSPAN,pix.row() - minRow) );
78  thePixelOffset.push_back( std::min(MAXSPAN,pix.col() - minCol) );
79 }
int adc(sample_type sample)
get the ADC sample (12 bits)
std::vector< uint32_t > thePixelADC
uint32_t minPixelRow() const
uint32_t maxPixelCol() const
void packRow(uint32_t xmin, uint32_t xspan)
#define constexpr
void add(const PixelPos &pix, uint32_t adc)
uint32_t maxPixelRow() const
T min(T a, T b)
Definition: MathUtil.h:58
uint32_t minPixelCol() const
void packCol(uint32_t ymin, uint32_t yspan)
std::vector< uint16_t > thePixelOffset
static unsigned int MAXSPAN
col
Definition: cuy.py:1009