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 | Static Public Attributes | Static Private 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
 
int colSpan () const
 
void computeMax ()
 moslty to be compatible for <610 More...
 
float getSplitClusterErrorX () const
 
float getSplitClusterErrorY () const
 
int maxPixelCol () const
 
int maxPixelRow () const
 
int minPixelCol () const
 
int minPixelRow () const
 
bool overflow () const
 
bool overflowCol () const
 
bool overflowRow () const
 
void packCol (uint16_t ymin, uint16_t yspan)
 
void packRow (uint16_t xmin, uint16_t xspan)
 
Pixel pixel (int i) const
 
const std::vector< uint16_t > & pixelADC () const
 
const std::vector< uint8_t > & pixelOffset () const
 
const std::vector< Pixelpixels () const
 
int rowSpan () const
 
void setSplitClusterErrorX (float errx)
 
void setSplitClusterErrorY (float erry)
 
 SiPixelCluster ()
 
 SiPixelCluster (unsigned int isize, uint16_t const *adcs, uint16_t const *xpos, uint16_t const *ypos, uint16_t const xmin, uint16_t const ymin)
 
 SiPixelCluster (const PixelPos &pix, int adc)
 
int size () const
 
int sizeX () const
 
int sizeY () const
 
void verifyVersion () const
 mostly to be compatible for <610 More...
 
float x () const
 
float y () const
 

Static Public Attributes

static const unsigned int MAXPOS =1023
 
static const unsigned int MAXSPAN =63
 
static const unsigned int POSBITS =10
 
static const unsigned int SPANBITS =6
 

Static Private Member Functions

static int overflow_ (uint16_t packed)
 
static uint16_t pack_ (uint16_t zmin, unsigned short zspan)
 
static int span_ (uint16_t packed)
 

Private Attributes

float err_x
 
float err_y
 
std::vector< uint16_t > thePixelADC
 
uint16_t thePixelCol
 
std::vector< uint8_t > thePixelOffset
 
uint16_t thePixelRow
 

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) Sep 2012: added Max back, removed detId (V.I.) sizeX and sizeY now clipped at 127

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

Member Typedef Documentation

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

Definition at line 73 of file SiPixelCluster.h.

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

SiPixelCluster::SiPixelCluster ( unsigned int  isize,
uint16_t const *  adcs,
uint16_t const *  xpos,
uint16_t const *  ypos,
uint16_t const  xmin,
uint16_t const  ymin 
)
inline

Definition at line 95 of file SiPixelCluster.h.

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

Definition at line 18 of file SiPixelCluster.cc.

References thePixelADC, and thePixelOffset.

18  :
19  thePixelRow(pix.row()),
20  thePixelCol(pix.col()),
21  // ggiurgiu@fnal.gov, 01/05/12
22  // Initialize the split cluster errors to un-physical values.
23  // The CPE will check these errors and if they are not un-physical,
24  // it will recognize the clusters as split and assign these (increased)
25  // errors to the corresponding rechit.
26  err_x(-99999.9),
27  err_y(-99999.9)
28 {
29  // First pixel in this cluster.
30  thePixelADC.push_back( adc );
31  thePixelOffset.push_back(0 );
32  thePixelOffset.push_back(0 );
33 }
int adc(sample_type sample)
get the ADC sample (12 bits)
uint16_t thePixelCol
std::vector< uint16_t > thePixelADC
std::vector< uint8_t > thePixelOffset
uint16_t thePixelRow

Member Function Documentation

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

Definition at line 35 of file SiPixelCluster.cc.

References SiPixelCluster::PixelPos::col(), i, maxPixelCol(), maxPixelRow(), min(), minPixelCol(), minPixelRow(), overflowCol(), overflowRow(), packCol(), packRow(), SiPixelCluster::PixelPos::row(), thePixelADC, and thePixelOffset.

Referenced by counter.Counter::register().

35  {
36 
37  int ominRow = minPixelRow();
38  int ominCol = minPixelCol();
39  bool recalculate = false;
40 
41  int minRow = ominRow;
42  int minCol = ominCol;
43 
44  if (pix.row() < minRow) {
45  minRow = pix.row();
46  recalculate = true;
47  }
48  if (pix.col() < minCol) {
49  minCol = pix.col();
50  recalculate = true;
51  }
52 
53  if (recalculate) {
54  int maxCol = 0;
55  int maxRow = 0;
56  int isize = thePixelADC.size();
57  for (int i=0; i<isize; ++i) {
58  int xoffset = thePixelOffset[i*2] + ominRow - minRow;
59  int yoffset = thePixelOffset[i*2+1] + ominCol -minCol;
60  thePixelOffset[i*2] = std::min(63,xoffset);
61  thePixelOffset[i*2+1] = std::min(63,yoffset);
62  if (xoffset > maxRow) maxRow = xoffset;
63  if (yoffset > maxCol) maxCol = yoffset;
64  }
65  packRow(minRow,maxRow);
66  packCol(minCol,maxCol);
67  }
68 
69  if ( (!overflowRow()) && pix.row() > maxPixelRow())
70  packRow(minRow,pix.row()-minRow);
71 
72  if ( (!overflowCol()) && pix.col() > maxPixelCol())
73  packCol(minCol,pix.col()-minCol);
74 
75  thePixelADC.push_back( adc );
76  thePixelOffset.push_back( std::min(63,pix.row() - minRow) );
77  thePixelOffset.push_back( std::min(63,pix.col() - minCol) );
78 }
int adc(sample_type sample)
get the ADC sample (12 bits)
int i
Definition: DBlmapReader.cc:9
int minPixelCol() const
bool overflowCol() const
int maxPixelRow() const
void packRow(uint16_t xmin, uint16_t xspan)
void packCol(uint16_t ymin, uint16_t yspan)
std::vector< uint16_t > thePixelADC
int minPixelRow() const
T min(T a, T b)
Definition: MathUtil.h:58
bool overflowRow() const
std::vector< uint8_t > thePixelOffset
int maxPixelCol() const
float SiPixelCluster::charge ( ) const
inline

Definition at line 145 of file SiPixelCluster.h.

int SiPixelCluster::colSpan ( ) const
inline

Definition at line 191 of file SiPixelCluster.h.

void SiPixelCluster::computeMax ( )
inline

moslty to be compatible for <610

Definition at line 218 of file SiPixelCluster.h.

float SiPixelCluster::getSplitClusterErrorX ( ) const
inline

Definition at line 239 of file SiPixelCluster.h.

float SiPixelCluster::getSplitClusterErrorY ( ) const
inline

Definition at line 240 of file SiPixelCluster.h.

int SiPixelCluster::maxPixelCol ( ) const
inline

Definition at line 156 of file SiPixelCluster.h.

Referenced by add(), and ClusterShape::determineShape().

int SiPixelCluster::maxPixelRow ( ) const
inline

Definition at line 154 of file SiPixelCluster.h.

Referenced by add(), and ClusterShape::determineShape().

int SiPixelCluster::minPixelCol ( ) const
inline

Definition at line 155 of file SiPixelCluster.h.

Referenced by add(), and ClusterShape::determineShape().

int SiPixelCluster::minPixelRow ( ) const
inline

Definition at line 153 of file SiPixelCluster.h.

Referenced by add(), and ClusterShape::determineShape().

bool SiPixelCluster::overflow ( ) const
inline

Definition at line 200 of file SiPixelCluster.h.

static int SiPixelCluster::overflow_ ( uint16_t  packed)
inlinestaticprivate

Definition at line 184 of file SiPixelCluster.h.

bool SiPixelCluster::overflowCol ( ) const
inline

Definition at line 196 of file SiPixelCluster.h.

Referenced by add().

bool SiPixelCluster::overflowRow ( ) const
inline

Definition at line 198 of file SiPixelCluster.h.

Referenced by add().

static uint16_t SiPixelCluster::pack_ ( uint16_t  zmin,
unsigned short  zspan 
)
inlinestaticprivate

Definition at line 185 of file SiPixelCluster.h.

void SiPixelCluster::packCol ( uint16_t  ymin,
uint16_t  yspan 
)
inline

Definition at line 202 of file SiPixelCluster.h.

Referenced by add().

void SiPixelCluster::packRow ( uint16_t  xmin,
uint16_t  xspan 
)
inline

Definition at line 205 of file SiPixelCluster.h.

Referenced by add().

Pixel SiPixelCluster::pixel ( int  i) const
inline

Definition at line 174 of file SiPixelCluster.h.

Referenced by ClusterShape::determineShape().

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

Definition at line 160 of file SiPixelCluster.h.

Referenced by ClusterShape::determineShape().

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

Definition at line 159 of file SiPixelCluster.h.

const std::vector<Pixel> SiPixelCluster::pixels ( ) const
inline

Definition at line 163 of file SiPixelCluster.h.

int SiPixelCluster::rowSpan ( ) const
inline

Definition at line 193 of file SiPixelCluster.h.

void SiPixelCluster::setSplitClusterErrorX ( float  errx)
inline

Definition at line 237 of file SiPixelCluster.h.

void SiPixelCluster::setSplitClusterErrorY ( float  erry)
inline

Definition at line 238 of file SiPixelCluster.h.

int SiPixelCluster::size ( void  ) const
inline

Definition at line 136 of file SiPixelCluster.h.

Referenced by TkPixelMeasurementDet::recHits().

int SiPixelCluster::sizeX ( ) const
inline

Definition at line 139 of file SiPixelCluster.h.

int SiPixelCluster::sizeY ( ) const
inline

Definition at line 142 of file SiPixelCluster.h.

static int SiPixelCluster::span_ ( uint16_t  packed)
inlinestaticprivate

Definition at line 183 of file SiPixelCluster.h.

void SiPixelCluster::verifyVersion ( ) const
inline

mostly to be compatible for <610

Definition at line 212 of file SiPixelCluster.h.

float SiPixelCluster::x ( ) const
inline

Definition at line 119 of file SiPixelCluster.h.

float SiPixelCluster::y ( ) const
inline

Definition at line 127 of file SiPixelCluster.h.

Member Data Documentation

float SiPixelCluster::err_x
private

Definition at line 261 of file SiPixelCluster.h.

float SiPixelCluster::err_y
private

Definition at line 262 of file SiPixelCluster.h.

const unsigned int SiPixelCluster::MAXPOS =1023
static

Definition at line 86 of file SiPixelCluster.h.

const unsigned int SiPixelCluster::MAXSPAN =63
static

Definition at line 85 of file SiPixelCluster.h.

const unsigned int SiPixelCluster::POSBITS =10
static

Definition at line 83 of file SiPixelCluster.h.

const unsigned int SiPixelCluster::SPANBITS =6
static

Definition at line 84 of file SiPixelCluster.h.

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

Definition at line 246 of file SiPixelCluster.h.

Referenced by add(), and SiPixelCluster().

uint16_t SiPixelCluster::thePixelCol
private

Definition at line 250 of file SiPixelCluster.h.

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

Definition at line 245 of file SiPixelCluster.h.

Referenced by add(), and SiPixelCluster().

uint16_t SiPixelCluster::thePixelRow
private

Definition at line 249 of file SiPixelCluster.h.