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 |
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< Pixel > | pixels () 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 |
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)
Definition at line 23 of file SiPixelCluster.h.
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.
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 ); }
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] |
Definition at line 117 of file SiPixelCluster.h.
References theMinPixelCol.
Referenced by PixelCPEGeneric::collect_edge_charges(), PixelCPEGeneric::localError(), PixelCPETemplateReco::localError(), FastPixelCPE::localParameters(), PixelCPEGeneric::localPosition(), PixelCPETemplateReco::localPosition(), operator<(), fireworks::pushPixelCluster(), and PixelCPEBase::setTheDet().
{ 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(), PixelCPEGeneric::localError(), PixelCPETemplateReco::localError(), FastPixelCPE::localParameters(), PixelCPEGeneric::localPosition(), PixelCPETemplateReco::localPosition(), operator<(), fireworks::pushPixelCluster(), and PixelCPEBase::setTheDet().
{ 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.
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] |
Definition at line 98 of file SiPixelCluster.h.
References maxPixelRow(), and theMinPixelRow.
Referenced by SiPixelTrackResidualModule::fill(), PixelCPEGeneric::localError(), PixelCPETemplateReco::localError(), and PixelCPEGeneric::localPosition().
{return maxPixelRow() - theMinPixelRow +1;}
int SiPixelCluster::sizeY | ( | ) | const [inline] |
Definition at line 101 of file SiPixelCluster.h.
References maxPixelCol(), and theMinPixelCol.
Referenced by SiPixelTrackResidualModule::fill(), PixelCPEGeneric::localError(), PixelCPETemplateReco::localError(), and PixelCPEGeneric::localPosition().
{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 SiPixelMuonHLT::analyze(), SiPixelErrorEstimation::computeAnglesFromDetPosition(), PixelCPEBase::computeAnglesFromDetPosition(), PixelCPEGeneric::localPosition(), PixelCPETemplateReco::localPosition(), and pixels().
{ float qm = 0.0; int isize = thePixelADC.size(); for (int i=0; i<isize; ++i) qm += float(thePixelADC[i]) * (thePixelOffset[i*2] + theMinPixelRow + 0.5); return qm/charge(); }
float SiPixelCluster::y | ( | ) | const [inline] |
Definition at line 86 of file SiPixelCluster.h.
References charge(), i, theMinPixelCol, thePixelADC, and thePixelOffset.
Referenced by SiPixelMuonHLT::analyze(), SiPixelErrorEstimation::computeAnglesFromDetPosition(), PixelCPEBase::computeAnglesFromDetPosition(), PixelCPEGeneric::localPosition(), PixelCPETemplateReco::localPosition(), and pixels().
{ float qm = 0.0; int isize = thePixelADC.size(); for (int i=0; i<isize; ++i) qm += float(thePixelADC[i]) * (thePixelOffset[i*2+1] + theMinPixelCol + 0.5); return qm/charge(); }
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] |
Definition at line 168 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 167 of file SiPixelCluster.h.
Referenced by add(), maxPixelCol(), maxPixelRow(), pixelOffset(), pixels(), SiPixelCluster(), x(), and y().