CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SiPixelCluster.cc
Go to the documentation of this file.
2 
3 //---------------------------------------------------------------------------
15 //---------------------------------------------------------------------------
16 
17 
19  detId_(0), // &&& To be fixed ??
20  // The center of pixel with row # N is at N+0.5 in the meas. frame!
21  // theSumX( (pix.row()+0.5) * float(adc)),
22  // theSumY( (pix.col()+0.5) * float(adc)),
23  // theCharge( float(adc)),
24  theMinPixelRow( pix.row()),
25  // theMaxPixelRow( pix.row()),
26  theMinPixelCol( pix.col()),
27  // theMaxPixelCol( pix.col()),
28  // ggiurgiu@fnal.gov, 01/05/12
29  // Initialize the split cluster errors to un-physical values.
30  // The CPE will check these errors and if they are not un-physical,
31  // it will recognize the clusters as split and assign these (increased)
32  // errors to the corresponding rechit.
33  err_x(-99999.9),
34  err_y(-99999.9)
35 {
36  // First pixel in this cluster.
37  thePixelADC.push_back( adc );
38  thePixelOffset.push_back( pix.row() - theMinPixelRow );
39  thePixelOffset.push_back( pix.col() - theMinPixelCol );
40 }
41 
43 
44  // The center of pixel with row # N is at N+0.5 in the meas. frame!
45  //theSumX += (pix.row()+0.5) * float(adc);
46  //theSumY += (pix.col()+0.5) * float(adc);
47  //theCharge += float(adc);
48  // thePixels.push_back( Pixel( pix.row(), pix.col(), adc ) );
49 
50  int minRow = theMinPixelRow;
51  int minCol = theMinPixelCol;
52  bool recalculate = false;
53 
54  if (pix.row() < theMinPixelRow) {
55  theMinPixelRow = pix.row();
56  recalculate = true;
57  }
58  if (pix.col() < theMinPixelCol) {
59  theMinPixelCol = pix.col();
60  recalculate = true;
61  }
62  if (recalculate) {
63  int isize = thePixelADC.size();
64  for (int i=0; i<isize; ++i) {
65  int xoffset = (thePixelOffset[i*2] ) + minRow - theMinPixelRow;
66  int yoffset = (thePixelOffset[i*2+1] ) + minCol - theMinPixelCol;
67  thePixelOffset[i*2] = xoffset;
68  thePixelOffset[i*2+1] = yoffset;
69  }
70  }
71 
72  thePixelADC.push_back( adc );
73  thePixelOffset.push_back( (pix.row() - theMinPixelRow) );
74  thePixelOffset.push_back( (pix.col() - theMinPixelCol) );
75 }
76 
int adc(sample_type sample)
get the ADC sample (12 bits)
int i
Definition: DBlmapReader.cc:9
std::vector< uint16_t > thePixelADC
void add(const PixelPos &pix, int adc)
std::vector< uint8_t > thePixelOffset
uint8_t theMinPixelRow
uint16_t theMinPixelCol