CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Types | Public Member Functions | Private Attributes
SiPixelCluster Class Reference

Pixel cluster – collection of neighboring pixels above threshold. More...

#include <SiPixelCluster.h>

Classes

class  Pixel
 
class  PixelPos
 
class  Shift
 

Public Types

typedef std::vector< PixelDigi >
::const_iterator 
PixelDigiIter
 
typedef std::pair
< PixelDigiIter, PixelDigiIter
PixelDigiRange
 

Public Member Functions

void add (const PixelPos &pix, int adc)
 
float charge () const
 
unsigned int geographicalId () const
 
float getSplitClusterErrorX () const
 
float getSplitClusterErrorY () const
 
int maxPixelCol () const
 
int maxPixelRow () const
 
int minPixelCol () const
 
int minPixelRow () const
 
const std::vector< uint16_t > & pixelADC () const
 
const std::vector< uint8_t > & pixelOffset () const
 
const std::vector< Pixelpixels () const
 
void setSplitClusterErrorX (float errx)
 
void setSplitClusterErrorY (float erry)
 
 SiPixelCluster ()
 
 SiPixelCluster (const PixelPos &pix, int adc)
 
int size () const
 
int sizeX () const
 
int sizeY () const
 
float x () const
 
float y () const
 

Private Attributes

unsigned int detId_
 
float err_x
 
float err_y
 
uint16_t theMinPixelCol
 
uint8_t theMinPixelRow
 
std::vector< uint16_t > thePixelADC
 
std::vector< uint8_t > thePixelOffset
 

Detailed Description

Pixel cluster – collection of neighboring pixels above threshold.

Pixel cluster – collection of pixels with ADC counts.

Class to contain and store all the topological information of pixel clusters: charge, global size, size and the barycenter in x and y local directions. It builds a vector of SiPixel (which is an inner class) and a container of channels.

March 2007: Edge methods moved to RectangularPixelTopology class (V.Chiochia) Feb 2008: Modify the Pixel class from float to shorts May 2008: Offset based packing (D.Fehling / A. Rizzi)

Class to contain and store all the topological information of pixel clusters: charge, global size, size and the barycenter in x and y local directions. It builds a vector of SiPixel (which is an inner class) and a container of channels.

March 2007: Edge pixel methods moved to RectangularPixelTopology (V.Chiochia) May 2008: Offset based packing (D.Fehling / A. Rizzi)

Author
Petar Maksimovic, JHU

Definition at line 23 of file SiPixelCluster.h.

Member Typedef Documentation

typedef std::vector<PixelDigi>::const_iterator SiPixelCluster::PixelDigiIter

Definition at line 63 of file SiPixelCluster.h.

Definition at line 64 of file SiPixelCluster.h.

Constructor & Destructor Documentation

SiPixelCluster::SiPixelCluster ( )
inline

Construct from a range of digis that form a cluster and from a DetID. The range is assumed to be non-empty.

Definition at line 71 of file SiPixelCluster.h.

71 : detId_(0), err_x(-99999.9), err_y(-99999.9) {} // needed by vector::push_back()!
unsigned int detId_
SiPixelCluster::SiPixelCluster ( const PixelPos pix,
int  adc 
)

Definition at line 18 of file SiPixelCluster.cc.

References SiPixelCluster::PixelPos::col(), SiPixelCluster::PixelPos::row(), theMinPixelCol, theMinPixelRow, thePixelADC, and thePixelOffset.

18  :
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 }
int adc(sample_type sample)
get the ADC sample (12 bits)
std::vector< uint16_t > thePixelADC
std::vector< uint8_t > thePixelOffset
uint8_t theMinPixelRow
uint16_t theMinPixelCol
unsigned int detId_

Member Function Documentation

void SiPixelCluster::add ( const PixelPos pix,
int  adc 
)

Definition at line 42 of file SiPixelCluster.cc.

References SiPixelCluster::PixelPos::col(), i, SiPixelCluster::PixelPos::row(), theMinPixelCol, theMinPixelRow, thePixelADC, and thePixelOffset.

Referenced by PixelThresholdClusterizer::make_cluster(), and TrackClusterSplitter::splitCluster().

42  {
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 }
int adc(sample_type sample)
get the ADC sample (12 bits)
int i
Definition: DBlmapReader.cc:9
std::vector< uint16_t > thePixelADC
std::vector< uint8_t > thePixelOffset
uint8_t theMinPixelRow
uint16_t theMinPixelCol
float SiPixelCluster::charge ( ) const
inline

Definition at line 108 of file SiPixelCluster.h.

References i, and thePixelADC.

Referenced by SiPixelMuonHLT::analyze(), PixelThresholdClusterizer::clusterizeDetUnit(), SiPixelTrackResidualModule::fill(), PixelCPEGeneric::localPosition(), PixelThresholdClusterizer::make_cluster(), TrackClusterSplitter::splitCluster(), x(), and y().

108  {
109  float qm = 0.0;
110  int isize = thePixelADC.size();
111  for (int i=0; i<isize; ++i)
112  qm += float(thePixelADC[i]);
113  return qm;
114  } // Return total cluster charge.
int i
Definition: DBlmapReader.cc:9
std::vector< uint16_t > thePixelADC
unsigned int SiPixelCluster::geographicalId ( ) const
inline

The geographical ID of the corresponding DetUnit, to be used for transformations to local and to global reference frames etc.

Definition at line 158 of file SiPixelCluster.h.

References detId_.

Referenced by operator<().

158 {return detId_;}
unsigned int detId_
float SiPixelCluster::getSplitClusterErrorX ( ) const
inline

Definition at line 168 of file SiPixelCluster.h.

References err_x.

Referenced by PixelCPETemplateReco::localError().

168 { return err_x; }
float SiPixelCluster::getSplitClusterErrorY ( ) const
inline

Definition at line 169 of file SiPixelCluster.h.

References err_y.

Referenced by PixelCPETemplateReco::localError().

169 { return err_y; }
int SiPixelCluster::maxPixelCol ( ) const
inline

Definition at line 129 of file SiPixelCluster.h.

References i, theMinPixelCol, thePixelADC, and thePixelOffset.

Referenced by PixelCPEGeneric::collect_edge_charges(), PixelCPETemplateReco::localError(), PixelCPEGeneric::localError(), PixelCPEGeneric::localPosition(), PixelCPEBase::setTheDet(), and sizeY().

129  {
130  int maxCol = 0;
131  int isize = thePixelADC.size();
132  for (int i=0; i<isize; ++i) {
133  int ysize = thePixelOffset[i*2+1] ;
134  if (ysize > maxCol) maxCol = ysize;
135  }
136  return maxCol + theMinPixelCol; // The max y index.
137  }
int i
Definition: DBlmapReader.cc:9
std::vector< uint16_t > thePixelADC
std::vector< uint8_t > thePixelOffset
uint16_t theMinPixelCol
int SiPixelCluster::maxPixelRow ( ) const
inline

Definition at line 119 of file SiPixelCluster.h.

References i, theMinPixelRow, thePixelADC, and thePixelOffset.

Referenced by PixelCPEGeneric::collect_edge_charges(), PixelCPETemplateReco::localError(), PixelCPEGeneric::localError(), PixelCPEGeneric::localPosition(), PixelCPEBase::setTheDet(), and sizeX().

119  {
120  int maxRow = 0;
121  int isize = thePixelADC.size();
122  for (int i=0; i<isize; ++i) {
123  int xsize = thePixelOffset[i*2];
124  if (xsize > maxRow) maxRow = xsize;
125  }
126  return maxRow + theMinPixelRow; // The max x index.
127  }
int i
Definition: DBlmapReader.cc:9
std::vector< uint16_t > thePixelADC
std::vector< uint8_t > thePixelOffset
uint8_t theMinPixelRow
int SiPixelCluster::minPixelCol ( ) const
inline
int SiPixelCluster::minPixelRow ( ) const
inline
const std::vector<uint16_t>& SiPixelCluster::pixelADC ( ) const
inline

Definition at line 140 of file SiPixelCluster.h.

References thePixelADC.

Referenced by PixelCPEBase::setTheDet().

140 { return thePixelADC;}
std::vector< uint16_t > thePixelADC
const std::vector<uint8_t>& SiPixelCluster::pixelOffset ( ) const
inline

Definition at line 139 of file SiPixelCluster.h.

References thePixelOffset.

139 { return thePixelOffset;}
std::vector< uint8_t > thePixelOffset
const std::vector<Pixel> SiPixelCluster::pixels ( ) const
inline

Definition at line 142 of file SiPixelCluster.h.

References i, align::Pixel, theMinPixelCol, theMinPixelRow, thePixelADC, thePixelOffset, x(), and y().

Referenced by PixelCPEGeneric::collect_edge_charges(), SiPixelLorentzAngle::fillPix(), PixelCPETemplateReco::localPosition(), PixelThresholdClusterizer::make_cluster(), and TrackClusterSplitter::splitCluster().

142  {
143  std::vector<Pixel> oldPixVector;
144  int isize = thePixelADC.size();
145  oldPixVector.reserve(isize);
146  for(int i=0; i<isize; ++i) {
147  int x = theMinPixelRow + (thePixelOffset[i*2] );
148  int y = theMinPixelCol + (thePixelOffset[i*2+1] );
149  oldPixVector.push_back(Pixel(x,y,thePixelADC[i]));
150  }
151  return oldPixVector;
152  }
int i
Definition: DBlmapReader.cc:9
std::vector< uint16_t > thePixelADC
std::vector< uint8_t > thePixelOffset
uint8_t theMinPixelRow
uint16_t theMinPixelCol
float y() const
float x() const
void SiPixelCluster::setSplitClusterErrorX ( float  errx)
inline

Definition at line 166 of file SiPixelCluster.h.

References err_x.

Referenced by TrackClusterSplitter::splitCluster().

166 { err_x = errx; }
void SiPixelCluster::setSplitClusterErrorY ( float  erry)
inline

Definition at line 167 of file SiPixelCluster.h.

References err_y.

Referenced by TrackClusterSplitter::splitCluster().

167 { err_y = erry; }
int SiPixelCluster::size ( void  ) const
inline

Definition at line 95 of file SiPixelCluster.h.

References thePixelADC.

Referenced by SiStripMonitorCluster::analyze(), SiPixelTrackResidualModule::fill(), and TrackClusterSplitter::splitCluster().

95 { return thePixelADC.size();}
std::vector< uint16_t > thePixelADC
int SiPixelCluster::sizeX ( ) const
inline
int SiPixelCluster::sizeY ( ) const
inline
float SiPixelCluster::x ( ) const
inline
float SiPixelCluster::y ( ) const
inline

Member Data Documentation

unsigned int SiPixelCluster::detId_
private

Definition at line 173 of file SiPixelCluster.h.

Referenced by geographicalId().

float SiPixelCluster::err_x
private

Definition at line 197 of file SiPixelCluster.h.

Referenced by getSplitClusterErrorX(), and setSplitClusterErrorX().

float SiPixelCluster::err_y
private

Definition at line 198 of file SiPixelCluster.h.

Referenced by getSplitClusterErrorY(), and setSplitClusterErrorY().

uint16_t SiPixelCluster::theMinPixelCol
private

Definition at line 185 of file SiPixelCluster.h.

Referenced by add(), maxPixelCol(), minPixelCol(), pixels(), SiPixelCluster(), sizeY(), and y().

uint8_t SiPixelCluster::theMinPixelRow
private

Definition at line 184 of file SiPixelCluster.h.

Referenced by add(), maxPixelRow(), minPixelRow(), pixels(), SiPixelCluster(), sizeX(), and x().

std::vector<uint16_t> SiPixelCluster::thePixelADC
private
std::vector<uint8_t> SiPixelCluster::thePixelOffset
private

Definition at line 175 of file SiPixelCluster.h.

Referenced by add(), maxPixelCol(), maxPixelRow(), pixelOffset(), pixels(), SiPixelCluster(), x(), and y().