CMS 3D CMS Logo

SiPixelCluster Class Reference

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

#include <DataFormats/SiPixelCluster/interface/SiPixelCluster.h>

List of all members.

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
 The geographical ID of the corresponding DetUnit, to be used for transformations to local and to global reference frames etc.
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
 SiPixelCluster (const PixelPos &pix, int adc)
 SiPixelCluster ()
 Construct from a range of digis that form a cluster and from a DetID.
int size () const
int sizeX () const
int sizeY () const
float x () const
float y () const

Private Attributes

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

Classes

class  Pixel
class  PixelPos
class  Shift


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.

typedef std::pair<PixelDigiIter,PixelDigiIter> SiPixelCluster::PixelDigiRange

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.

00071 : detId_(0) {}  // needed by vector::push_back()!

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.

00018                                                                           :
00019   detId_(0),     // &&& To be fixed ?? 
00020   // The center of pixel with row # N is at N+0.5 in the meas. frame!
00021         //  theSumX( (pix.row()+0.5) * float(adc)), 
00022         // theSumY( (pix.col()+0.5) * float(adc)),
00023         //  theCharge( float(adc)),
00024   theMinPixelRow( pix.row()),
00025         //  theMaxPixelRow( pix.row()),
00026   theMinPixelCol( pix.col())
00027         //  theMaxPixelCol( pix.col())
00028 {
00029   // First pixel in this cluster.
00030   thePixelADC.push_back( adc );
00031   thePixelOffset.push_back( pix.row() - theMinPixelRow );
00032   thePixelOffset.push_back( pix.col() - theMinPixelCol );
00033 }


Member Function Documentation

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

Definition at line 35 of file SiPixelCluster.cc.

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

Referenced by PixelThresholdClusterizer::make_cluster().

00035                                                                     {
00036 
00037   // The center of pixel with row # N is at N+0.5 in the meas. frame!
00038   //theSumX += (pix.row()+0.5) * float(adc); 
00039   //theSumY += (pix.col()+0.5) * float(adc); 
00040   //theCharge += float(adc);
00041         //  thePixels.push_back( Pixel( pix.row(), pix.col(), adc ) );
00042         
00043         int minRow = theMinPixelRow;
00044         int minCol = theMinPixelCol;
00045         bool recalculate = false;
00046         
00047         if (pix.row() < theMinPixelRow) {
00048                 theMinPixelRow = pix.row();
00049                 recalculate = true;
00050         }
00051         if (pix.col() < theMinPixelCol) {
00052                 theMinPixelCol = pix.col();
00053                 recalculate = true;
00054         }
00055         if (recalculate) {
00056                 int isize = thePixelADC.size();
00057                 for (int i=0; i<isize; ++i) {
00058                         int xoffset = (thePixelOffset[i*2] ) + minRow - theMinPixelRow;
00059                         int yoffset = (thePixelOffset[i*2+1] ) + minCol - theMinPixelCol;
00060                         thePixelOffset[i*2] = xoffset;
00061                         thePixelOffset[i*2+1] = yoffset;
00062                 }
00063         }
00064         
00065         thePixelADC.push_back( adc );
00066         thePixelOffset.push_back( (pix.row() - theMinPixelRow) );
00067         thePixelOffset.push_back( (pix.col() - theMinPixelCol) );
00068 }

float SiPixelCluster::charge (  )  const [inline]

Definition at line 108 of file SiPixelCluster.h.

References i, and thePixelADC.

Referenced by PixelThresholdClusterizer::clusterizeDetUnit(), x(), and y().

00108                                     {
00109                 float qm = 0.0;
00110                 int isize = thePixelADC.size();
00111                 for (int i=0; i<isize; ++i) 
00112                         qm += float(thePixelADC[i]);
00113                 return qm;
00114         } // Return total cluster charge.

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 157 of file SiPixelCluster.h.

References detId_.

Referenced by operator<().

00157 {return detId_;}

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(), PixelCPEParmError::localError(), PixelCPEGeneric::localError(), PixelCPEInitial::localError(), PixelCPETemplateReco::localError(), CPEFromDetPosition::localError(), PixelCPEGeneric::localPosition(), sizeY(), PixelCPEParmError::ypos(), and PixelCPEInitial::ypos().

00129                                        {
00130                 int maxCol = 0;
00131                 int isize = thePixelADC.size();
00132                 for (int i=0; i<isize; ++i) {
00133                         int ysize = thePixelOffset[i*2+1] ;
00134                         if (ysize > maxCol) maxCol = ysize;
00135                 }
00136                 return maxCol + theMinPixelCol; // The max y index.
00137         }

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(), PixelCPEParmError::localError(), PixelCPEGeneric::localError(), PixelCPEInitial::localError(), PixelCPETemplateReco::localError(), CPEFromDetPosition::localError(), PixelCPEGeneric::localPosition(), sizeX(), PixelCPEInitial::xpos(), CPEFromDetPosition::xpos(), and PixelCPEParmError::xpos().

00119                                  {
00120                 int maxRow = 0;
00121                 int isize  = thePixelADC.size();
00122                 for (int i=0; i<isize; ++i) {
00123                         int xsize  = thePixelOffset[i*2];
00124                         if (xsize > maxRow) maxRow = xsize;
00125                 }
00126         return maxRow + theMinPixelRow; // The max x index.
00127         }

int SiPixelCluster::minPixelCol (  )  const [inline]

Definition at line 117 of file SiPixelCluster.h.

References theMinPixelCol.

Referenced by PixelCPEGeneric::collect_edge_charges(), PixelCPEParmError::localError(), PixelCPEGeneric::localError(), PixelCPEInitial::localError(), CPEFromDetPosition::localError(), PixelCPETemplateReco::localError(), PixelCPEGeneric::localPosition(), PixelCPETemplateReco::localPosition(), operator<(), VisCuTrackerCluster::update(), PixelCPEParmError::ypos(), and PixelCPEInitial::ypos().

00117 { return theMinPixelCol & 511;} // The min y index.

int SiPixelCluster::minPixelRow (  )  const [inline]

Definition at line 116 of file SiPixelCluster.h.

References theMinPixelRow.

Referenced by PixelCPEGeneric::collect_edge_charges(), PixelCPEParmError::localError(), PixelCPEGeneric::localError(), PixelCPEInitial::localError(), CPEFromDetPosition::localError(), PixelCPETemplateReco::localError(), PixelCPEGeneric::localPosition(), PixelCPETemplateReco::localPosition(), operator<(), VisCuTrackerCluster::update(), CPEFromDetPosition::xpos(), PixelCPEInitial::xpos(), and PixelCPEParmError::xpos().

00116 { return theMinPixelRow;} // The min x index.

const std::vector<uint16_t>& SiPixelCluster::pixelADC (  )  const [inline]

Definition at line 140 of file SiPixelCluster.h.

References thePixelADC.

00140 { return thePixelADC;}

const std::vector<uint8_t>& SiPixelCluster::pixelOffset (  )  const [inline]

Definition at line 139 of file SiPixelCluster.h.

References thePixelOffset.

00139 { return 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(), CPEFromDetPosition::xpos(), PixelCPEInitial::xpos(), PixelCPEParmError::xpos(), PixelCPEParmError::ypos(), and PixelCPEInitial::ypos().

00142                                               {
00143                 std::vector<Pixel> oldPixVector;
00144                 int isize = thePixelADC.size();
00145                 for(int i=0; i<isize; ++i) {
00146                         int x = theMinPixelRow + (thePixelOffset[i*2]  );
00147                         int y = theMinPixelCol + (thePixelOffset[i*2+1] );
00148                         oldPixVector.push_back(Pixel(x,y,thePixelADC[i]));
00149                 }
00150                 return oldPixVector;
00151         }

int SiPixelCluster::size ( void   )  const [inline]

Definition at line 95 of file SiPixelCluster.h.

References thePixelADC.

00095 { return thePixelADC.size();}

int SiPixelCluster::sizeX (  )  const [inline]

Definition at line 98 of file SiPixelCluster.h.

References maxPixelRow(), and theMinPixelRow.

Referenced by PixelCPEParmError::localError(), PixelCPEGeneric::localError(), PixelCPEInitial::localError(), PixelCPETemplateReco::localError(), CPEFromDetPosition::localError(), PixelCPEGeneric::localPosition(), PixelCPEInitial::xpos(), CPEFromDetPosition::xpos(), and PixelCPEParmError::xpos().

00098 {return maxPixelRow() - theMinPixelRow +1;}

int SiPixelCluster::sizeY (  )  const [inline]

Definition at line 101 of file SiPixelCluster.h.

References maxPixelCol(), and theMinPixelCol.

Referenced by PixelCPEParmError::localError(), PixelCPEGeneric::localError(), PixelCPEInitial::localError(), PixelCPETemplateReco::localError(), CPEFromDetPosition::localError(), PixelCPEGeneric::localPosition(), PixelCPEParmError::ypos(), and PixelCPEInitial::ypos().

00101 {return maxPixelCol() - theMinPixelCol +1;}

float SiPixelCluster::x (  )  const [inline]

Definition at line 79 of file SiPixelCluster.h.

References charge(), i, theMinPixelRow, thePixelADC, and thePixelOffset.

Referenced by SiPixelErrorEstimation::computeAnglesFromDetPosition(), PixelCPEBase::computeAnglesFromDetPosition(), PixelCPEGeneric::localPosition(), PixelCPETemplateReco::localPosition(), pixels(), PixelCPEInitial::xpos(), CPEFromDetPosition::xpos(), and PixelCPEParmError::xpos().

00079                   {
00080                 float qm = 0.0;
00081                 int isize = thePixelADC.size();
00082                 for (int i=0; i<isize; ++i)
00083                         qm += float(thePixelADC[i]) * (thePixelOffset[i*2] + theMinPixelRow + 0.5);
00084                 return qm/charge();
00085                         }

float SiPixelCluster::y (  )  const [inline]

Definition at line 86 of file SiPixelCluster.h.

References charge(), i, theMinPixelCol, thePixelADC, and thePixelOffset.

Referenced by SiPixelErrorEstimation::computeAnglesFromDetPosition(), PixelCPEBase::computeAnglesFromDetPosition(), PixelCPEGeneric::localPosition(), PixelCPETemplateReco::localPosition(), pixels(), PixelCPEParmError::ypos(), and PixelCPEInitial::ypos().

00086                   {
00087                 float qm = 0.0;
00088                 int isize = thePixelADC.size();
00089                 for (int i=0; i<isize; ++i)
00090                         qm += float(thePixelADC[i]) * (thePixelOffset[i*2+1]  + theMinPixelCol + 0.5);
00091                 return qm/charge();
00092         }


Member Data Documentation

unsigned int SiPixelCluster::detId_ [private]

Definition at line 164 of file SiPixelCluster.h.

Referenced by geographicalId().

uint16_t SiPixelCluster::theMinPixelCol [private]

Definition at line 176 of file SiPixelCluster.h.

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

uint8_t SiPixelCluster::theMinPixelRow [private]

Definition at line 175 of file SiPixelCluster.h.

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

std::vector<uint16_t> SiPixelCluster::thePixelADC [private]

Definition at line 167 of file SiPixelCluster.h.

Referenced by add(), charge(), maxPixelCol(), maxPixelRow(), pixelADC(), pixels(), SiPixelCluster(), size(), x(), and y().

std::vector<uint8_t> SiPixelCluster::thePixelOffset [private]

Definition at line 166 of file SiPixelCluster.h.

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


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:31:50 2009 for CMSSW by  doxygen 1.5.4