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< Pixel > | pixels () const |
void | setSplitClusterErrorX (float errx) |
void | setSplitClusterErrorY (float erry) |
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_ |
float | err_x |
float | err_y |
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.
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()), // ggiurgiu@fnal.gov, 01/05/12 // Initialize the split cluster errors to un-physical values. // The CPE will check these errors and if they are not un-physical, // it will recognize the clusters as split and assign these (increased) // errors to the corresponding rechit. err_x(-99999.9), err_y(-99999.9) { // 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 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().
{ // 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(), PixelCPEGeneric::localPosition(), PixelThresholdClusterizer::make_cluster(), TrackClusterSplitter::splitCluster(), 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_;}
float SiPixelCluster::getSplitClusterErrorX | ( | ) | const [inline] |
Definition at line 168 of file SiPixelCluster.h.
References err_x.
Referenced by PixelCPETemplateReco::localError().
{ return err_x; }
float SiPixelCluster::getSplitClusterErrorY | ( | ) | const [inline] |
Definition at line 169 of file SiPixelCluster.h.
References err_y.
Referenced by PixelCPETemplateReco::localError().
{ 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(), 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(), PixelCPEBase::setTheDet(), and TrackClusterSplitter::splitCluster().
{ 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(), PixelCPEBase::setTheDet(), and TrackClusterSplitter::splitCluster().
{ 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(), PixelThresholdClusterizer::make_cluster(), and TrackClusterSplitter::splitCluster().
{ 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; }
void SiPixelCluster::setSplitClusterErrorX | ( | float | errx | ) | [inline] |
Definition at line 166 of file SiPixelCluster.h.
References err_x.
Referenced by TrackClusterSplitter::splitCluster().
{ err_x = errx; }
void SiPixelCluster::setSplitClusterErrorY | ( | float | erry | ) | [inline] |
Definition at line 167 of file SiPixelCluster.h.
References err_y.
Referenced by TrackClusterSplitter::splitCluster().
{ err_y = erry; }
int SiPixelCluster::size | ( | void | ) | const [inline] |
Definition at line 95 of file SiPixelCluster.h.
References thePixelADC.
Referenced by SiPixelTrackResidualModule::fill(), and TrackClusterSplitter::splitCluster().
{ 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(), PixelCPEGeneric::localPosition(), and FastPrimaryVertexProducer::produce().
{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(), PixelCPEGeneric::localPosition(), and FastPrimaryVertexProducer::produce().
{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(), pixels(), and TrackClusterSplitter::splitCluster().
{ 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(), pixels(), and TrackClusterSplitter::splitCluster().
{ 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 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] |
Definition at line 176 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 175 of file SiPixelCluster.h.
Referenced by add(), maxPixelCol(), maxPixelRow(), pixelOffset(), pixels(), SiPixelCluster(), x(), and y().