CMS 3D CMS Logo

Classes | Public Types | Public Member Functions | Private Attributes

SiPixelCluster Class Reference

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

#include <SiPixelCluster.h>

List of all members.

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
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 ()
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

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.

: 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.

                                                                          :
  detId_(0),     // &&& To be fixed ?? 
  // The center of pixel with row # N is at N+0.5 in the meas. frame!
        //  theSumX( (pix.row()+0.5) * float(adc)), 
        // theSumY( (pix.col()+0.5) * float(adc)),
        //  theCharge( float(adc)),
  theMinPixelRow( pix.row()),
        //  theMaxPixelRow( pix.row()),
  theMinPixelCol( pix.col())
        //  theMaxPixelCol( pix.col())
{
  // First pixel in this cluster.
  thePixelADC.push_back( adc );
  thePixelOffset.push_back( pix.row() - theMinPixelRow );
  thePixelOffset.push_back( pix.col() - theMinPixelCol );
}

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().

                                                                    {

  // The center of pixel with row # N is at N+0.5 in the meas. frame!
  //theSumX += (pix.row()+0.5) * float(adc); 
  //theSumY += (pix.col()+0.5) * float(adc); 
  //theCharge += float(adc);
        //  thePixels.push_back( Pixel( pix.row(), pix.col(), adc ) );
        
        int minRow = theMinPixelRow;
        int minCol = theMinPixelCol;
        bool recalculate = false;
        
        if (pix.row() < theMinPixelRow) {
                theMinPixelRow = pix.row();
                recalculate = true;
        }
        if (pix.col() < theMinPixelCol) {
                theMinPixelCol = pix.col();
                recalculate = true;
        }
        if (recalculate) {
                int isize = thePixelADC.size();
                for (int i=0; i<isize; ++i) {
                        int xoffset = (thePixelOffset[i*2] ) + minRow - theMinPixelRow;
                        int yoffset = (thePixelOffset[i*2+1] ) + minCol - theMinPixelCol;
                        thePixelOffset[i*2] = xoffset;
                        thePixelOffset[i*2+1] = yoffset;
                }
        }
        
        thePixelADC.push_back( adc );
        thePixelOffset.push_back( (pix.row() - theMinPixelRow) );
        thePixelOffset.push_back( (pix.col() - 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(), TrackHitFilter::keepThisHit(), PixelCPEGeneric::localPosition(), PixelThresholdClusterizer::make_cluster(), x(), and y().

                                    {
                float qm = 0.0;
                int isize = thePixelADC.size();
                for (int i=0; i<isize; ++i) 
                        qm += float(thePixelADC[i]);
                return qm;
        } // 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 158 of file SiPixelCluster.h.

References detId_.

Referenced by operator<().

{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(), PixelCPEGeneric::localError(), PixelCPETemplateReco::localError(), PixelCPEGeneric::localPosition(), PixelCPEBase::setTheDet(), and sizeY().

                                       {
                int maxCol = 0;
                int isize = thePixelADC.size();
                for (int i=0; i<isize; ++i) {
                        int ysize = thePixelOffset[i*2+1] ;
                        if (ysize > maxCol) maxCol = ysize;
                }
                return maxCol + theMinPixelCol; // The max y index.
        }
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(), PixelCPEGeneric::localError(), PixelCPETemplateReco::localError(), PixelCPEGeneric::localPosition(), PixelCPEBase::setTheDet(), and sizeX().

                                 {
                int maxRow = 0;
                int isize  = thePixelADC.size();
                for (int i=0; i<isize; ++i) {
                        int xsize  = thePixelOffset[i*2];
                        if (xsize > maxRow) maxRow = xsize;
                }
        return maxRow + theMinPixelRow; // The max x index.
        }
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().

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

Definition at line 139 of file SiPixelCluster.h.

References thePixelOffset.

{ 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(), and PixelThresholdClusterizer::make_cluster().

                                              {
                std::vector<Pixel> oldPixVector;
                int isize = thePixelADC.size();
                oldPixVector.reserve(isize); 
                for(int i=0; i<isize; ++i) {
                        int x = theMinPixelRow + (thePixelOffset[i*2]  );
                        int y = theMinPixelCol + (thePixelOffset[i*2+1] );
                        oldPixVector.push_back(Pixel(x,y,thePixelADC[i]));
                }
                return oldPixVector;
        }
int SiPixelCluster::size ( void  ) const [inline]

Definition at line 95 of file SiPixelCluster.h.

References thePixelADC.

Referenced by SiPixelTrackResidualModule::fill(), and TrackHitFilter::keepThisHit().

{ return thePixelADC.size();}
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 165 of file SiPixelCluster.h.

Referenced by geographicalId().

uint16_t SiPixelCluster::theMinPixelCol [private]

Definition at line 177 of file SiPixelCluster.h.

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

uint8_t SiPixelCluster::theMinPixelRow [private]

Definition at line 176 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 167 of file SiPixelCluster.h.

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