CMS 3D CMS Logo

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, PixelDigiIterPixelDigiRange
 

Public Member Functions

void add (const PixelPos &pix, int adc)
 
int charge () const
 
int colSpan () const
 
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 (const PixelPos &pix, int adc)
 
 SiPixelCluster (unsigned int isize, uint16_t const *adcs, uint16_t const *xpos, uint16_t const *ypos, uint16_t const xmin, uint16_t const ymin)
 
int size () const
 
int sizeX () const
 
int sizeY () const
 
float x () const
 
float y () const
 

Static Public Attributes

static constexpr unsigned int MAXPOS = 2047
 
static constexpr unsigned int MAXSPAN = 255
 

Static Private Member Functions

static int overflow_ (uint16_t span)
 

Private Attributes

float err_x = -99999.9f
 
float err_y = -99999.9f
 
uint16_t theMinPixelCol = MAXPOS
 
uint16_t theMinPixelRow = MAXPOS
 
std::vector< uint16_t > thePixelADC
 
uint8_t thePixelColSpan = 0
 
std::vector< uint8_t > thePixelOffset
 
uint8_t thePixelRowSpan = 0
 

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 July 2017 make it compatible with PhaseII, remove errs....

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

Member Typedef Documentation

◆ PixelDigiIter

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

Definition at line 65 of file SiPixelCluster.h.

◆ PixelDigiRange

Definition at line 66 of file SiPixelCluster.h.

Constructor & Destructor Documentation

◆ SiPixelCluster() [1/3]

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

75 {}

◆ SiPixelCluster() [2/3]

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

83  : thePixelOffset(2 * isize), thePixelADC(adcs, adcs + isize) {
84  uint16_t maxCol = 0;
85  uint16_t maxRow = 0;
86  for (unsigned int i = 0; i != isize; ++i) {
87  uint16_t xoffset = xpos[i] - xmin;
88  uint16_t yoffset = ypos[i] - ymin;
89  thePixelOffset[i * 2] = std::min(uint16_t(MAXSPAN), xoffset);
90  thePixelOffset[i * 2 + 1] = std::min(uint16_t(MAXSPAN), yoffset);
91  if (xoffset > maxRow)
92  maxRow = xoffset;
93  if (yoffset > maxCol)
94  maxCol = yoffset;
95  }
96  packRow(xmin, maxRow);
97  packCol(ymin, maxCol);
98  }

References mps_fire::i, MAXSPAN, min(), packCol(), packRow(), thePixelOffset, TrackerOfflineValidation_Dqm_cff::xmin, and L1TOccupancyClient_cfi::ymin.

◆ SiPixelCluster() [3/3]

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

Definition at line 17 of file SiPixelCluster.cc.

18  : theMinPixelRow(pix.row()), theMinPixelCol(pix.col()) {
19  // First pixel in this cluster.
20  thePixelADC.push_back(adc);
21  thePixelOffset.push_back(0);
22  thePixelOffset.push_back(0);
23 }

References ecalMGPA::adc(), thePixelADC, and thePixelOffset.

Member Function Documentation

◆ add()

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

Definition at line 25 of file SiPixelCluster.cc.

25  {
26  int ominRow = minPixelRow();
27  int ominCol = minPixelCol();
28  bool recalculate = false;
29 
30  int minRow = ominRow;
31  int minCol = ominCol;
32 
33  if (pix.row() < minRow) {
34  minRow = pix.row();
35  recalculate = true;
36  }
37  if (pix.col() < minCol) {
38  minCol = pix.col();
39  recalculate = true;
40  }
41 
42  if (recalculate) {
43  int maxCol = 0;
44  int maxRow = 0;
45  int isize = thePixelADC.size();
46  for (int i = 0; i < isize; ++i) {
47  int xoffset = thePixelOffset[i * 2] + ominRow - minRow;
48  int yoffset = thePixelOffset[i * 2 + 1] + ominCol - minCol;
49  thePixelOffset[i * 2] = std::min(int(MAXSPAN), xoffset);
50  thePixelOffset[i * 2 + 1] = std::min(int(MAXSPAN), yoffset);
51  if (xoffset > maxRow)
52  maxRow = xoffset;
53  if (yoffset > maxCol)
54  maxCol = yoffset;
55  }
56  packRow(minRow, maxRow);
57  packCol(minCol, maxCol);
58  }
59 
60  if ((!overflowRow()) && pix.row() > maxPixelRow())
61  packRow(minRow, pix.row() - minRow);
62 
63  if ((!overflowCol()) && pix.col() > maxPixelCol())
64  packCol(minCol, pix.col() - minCol);
65 
66  thePixelADC.push_back(adc);
67  thePixelOffset.push_back(std::min(int(MAXSPAN), pix.row() - minRow));
68  thePixelOffset.push_back(std::min(int(MAXSPAN), pix.col() - minCol));
69 }

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

Referenced by PixelThresholdClusterizer::make_cluster(), counter.Counter::register(), SequenceTypes.Task::remove(), and SequenceTypes.Task::replace().

◆ charge()

int SiPixelCluster::charge ( ) const
inline

◆ colSpan()

int SiPixelCluster::colSpan ( ) const
inline

Definition at line 166 of file SiPixelCluster.h.

166 { return thePixelColSpan; }

References thePixelColSpan.

Referenced by maxPixelCol(), and sizeY().

◆ getSplitClusterErrorX()

float SiPixelCluster::getSplitClusterErrorX ( ) const
inline

Definition at line 189 of file SiPixelCluster.h.

189 { return err_x; }

References err_x.

◆ getSplitClusterErrorY()

float SiPixelCluster::getSplitClusterErrorY ( ) const
inline

Definition at line 190 of file SiPixelCluster.h.

190 { return err_y; }

References err_y.

◆ maxPixelCol()

int SiPixelCluster::maxPixelCol ( ) const
inline

◆ maxPixelRow()

int SiPixelCluster::maxPixelRow ( ) const
inline

◆ minPixelCol()

int SiPixelCluster::minPixelCol ( ) const
inline

◆ minPixelRow()

int SiPixelCluster::minPixelRow ( ) const
inline

◆ overflow()

bool SiPixelCluster::overflow ( ) const
inline

Definition at line 174 of file SiPixelCluster.h.

174 { return overflowCol() || overflowRow(); }

References overflowCol(), and overflowRow().

◆ overflow_()

static int SiPixelCluster::overflow_ ( uint16_t  span)
inlinestaticprivate

Definition at line 163 of file SiPixelCluster.h.

163 { return span == uint16_t(MAXSPAN); }

References MAXSPAN.

Referenced by overflowCol(), and overflowRow().

◆ overflowCol()

bool SiPixelCluster::overflowCol ( ) const
inline

Definition at line 170 of file SiPixelCluster.h.

170 { return overflow_(thePixelColSpan); }

References overflow_(), and thePixelColSpan.

Referenced by add(), and overflow().

◆ overflowRow()

bool SiPixelCluster::overflowRow ( ) const
inline

Definition at line 172 of file SiPixelCluster.h.

172 { return overflow_(thePixelRowSpan); }

References overflow_(), and thePixelRowSpan.

Referenced by add(), and overflow().

◆ packCol()

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

Definition at line 176 of file SiPixelCluster.h.

176  {
178  thePixelColSpan = std::min(yspan, uint16_t(MAXSPAN));
179  }

References MAXSPAN, min(), theMinPixelCol, thePixelColSpan, and L1TOccupancyClient_cfi::ymin.

Referenced by add(), and SiPixelCluster().

◆ packRow()

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

Definition at line 180 of file SiPixelCluster.h.

180  {
182  thePixelRowSpan = std::min(xspan, uint16_t(MAXSPAN));
183  }

References MAXSPAN, min(), theMinPixelRow, thePixelRowSpan, and TrackerOfflineValidation_Dqm_cff::xmin.

Referenced by add(), and SiPixelCluster().

◆ pixel()

Pixel SiPixelCluster::pixel ( int  i) const
inline

◆ pixelADC()

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

Definition at line 144 of file SiPixelCluster.h.

144 { return thePixelADC; }

References thePixelADC.

Referenced by ClusterShape::determineShape(), and ShallowGainCalibration::produce().

◆ pixelOffset()

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

Definition at line 143 of file SiPixelCluster.h.

143 { return thePixelOffset; }

References thePixelOffset.

◆ pixels()

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

Definition at line 147 of file SiPixelCluster.h.

147  {
148  std::vector<Pixel> oldPixVector;
149  int isize = thePixelADC.size();
150  oldPixVector.reserve(isize);
151  for (int i = 0; i < isize; ++i) {
152  oldPixVector.push_back(pixel(i));
153  }
154  return oldPixVector;
155  }

References mps_fire::i, pixel(), and thePixelADC.

Referenced by analyzer::SiPixelLorentzAngle::fillPix(), JetCoreClusterSplitter::fittingSplit(), and PixelThresholdClusterizer::make_cluster().

◆ rowSpan()

int SiPixelCluster::rowSpan ( ) const
inline

Definition at line 168 of file SiPixelCluster.h.

168 { return thePixelRowSpan; }

References thePixelRowSpan.

Referenced by maxPixelRow(), and sizeX().

◆ setSplitClusterErrorX()

void SiPixelCluster::setSplitClusterErrorX ( float  errx)
inline

Definition at line 187 of file SiPixelCluster.h.

187 { err_x = errx; }

References err_x.

◆ setSplitClusterErrorY()

void SiPixelCluster::setSplitClusterErrorY ( float  erry)
inline

Definition at line 188 of file SiPixelCluster.h.

188 { err_y = erry; }

References err_y.

◆ size()

int SiPixelCluster::size ( void  ) const
inline

◆ sizeX()

int SiPixelCluster::sizeX ( ) const
inline

◆ sizeY()

int SiPixelCluster::sizeY ( ) const
inline

◆ x()

float SiPixelCluster::x ( ) const
inline

◆ y()

float SiPixelCluster::y ( ) const
inline

Member Data Documentation

◆ err_x

float SiPixelCluster::err_x = -99999.9f
private

Definition at line 201 of file SiPixelCluster.h.

Referenced by getSplitClusterErrorX(), and setSplitClusterErrorX().

◆ err_y

float SiPixelCluster::err_y = -99999.9f
private

Definition at line 202 of file SiPixelCluster.h.

Referenced by getSplitClusterErrorY(), and setSplitClusterErrorY().

◆ MAXPOS

constexpr unsigned int SiPixelCluster::MAXPOS = 2047
staticconstexpr

Definition at line 69 of file SiPixelCluster.h.

◆ MAXSPAN

constexpr unsigned int SiPixelCluster::MAXSPAN = 255
staticconstexpr

Definition at line 68 of file SiPixelCluster.h.

Referenced by add(), overflow_(), packCol(), packRow(), and SiPixelCluster().

◆ theMinPixelCol

uint16_t SiPixelCluster::theMinPixelCol = MAXPOS
private

Definition at line 197 of file SiPixelCluster.h.

Referenced by minPixelCol(), and packCol().

◆ theMinPixelRow

uint16_t SiPixelCluster::theMinPixelRow = MAXPOS
private

Definition at line 196 of file SiPixelCluster.h.

Referenced by minPixelRow(), and packRow().

◆ thePixelADC

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

Definition at line 194 of file SiPixelCluster.h.

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

◆ thePixelColSpan

uint8_t SiPixelCluster::thePixelColSpan = 0
private

Definition at line 199 of file SiPixelCluster.h.

Referenced by colSpan(), overflowCol(), and packCol().

◆ thePixelOffset

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

Definition at line 193 of file SiPixelCluster.h.

Referenced by add(), pixel(), pixelOffset(), SiPixelCluster(), x(), and y().

◆ thePixelRowSpan

uint8_t SiPixelCluster::thePixelRowSpan = 0
private

Definition at line 198 of file SiPixelCluster.h.

Referenced by overflowRow(), packRow(), and rowSpan().

SiPixelCluster::theMinPixelRow
uint16_t theMinPixelRow
Definition: SiPixelCluster.h:196
ecalMGPA::adc
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
Definition: EcalMGPASample.h:11
SiPixelCluster::minPixelCol
int minPixelCol() const
Definition: SiPixelCluster.h:140
mps_fire.i
i
Definition: mps_fire.py:355
SiPixelCluster::packCol
void packCol(uint16_t ymin, uint16_t yspan)
Definition: SiPixelCluster.h:176
SiPixelCluster::overflowRow
bool overflowRow() const
Definition: SiPixelCluster.h:172
min
T min(T a, T b)
Definition: MathUtil.h:58
SiPixelCluster::maxPixelCol
int maxPixelCol() const
Definition: SiPixelCluster.h:141
SiPixelCluster::maxPixelRow
int maxPixelRow() const
Definition: SiPixelCluster.h:139
SiPixelCluster::rowSpan
int rowSpan() const
Definition: SiPixelCluster.h:168
SiPixelCluster::MAXSPAN
static constexpr unsigned int MAXSPAN
Definition: SiPixelCluster.h:68
SiPixelCluster::theMinPixelCol
uint16_t theMinPixelCol
Definition: SiPixelCluster.h:197
SiPixelCluster::overflowCol
bool overflowCol() const
Definition: SiPixelCluster.h:170
SiPixelCluster::colSpan
int colSpan() const
Definition: SiPixelCluster.h:166
SiPixelCluster::thePixelColSpan
uint8_t thePixelColSpan
Definition: SiPixelCluster.h:199
SiPixelCluster::overflow_
static int overflow_(uint16_t span)
Definition: SiPixelCluster.h:163
SiPixelCluster::minPixelRow
int minPixelRow() const
Definition: SiPixelCluster.h:138
SiPixelCluster::thePixelRowSpan
uint8_t thePixelRowSpan
Definition: SiPixelCluster.h:198
SiPixelCluster::err_y
float err_y
Definition: SiPixelCluster.h:202
SiPixelCluster::err_x
float err_x
Definition: SiPixelCluster.h:201
SiPixelCluster::thePixelADC
std::vector< uint16_t > thePixelADC
Definition: SiPixelCluster.h:194
SiPixelCluster::thePixelOffset
std::vector< uint8_t > thePixelOffset
Definition: SiPixelCluster.h:193
SiPixelCluster::pixel
Pixel pixel(int i) const
Definition: SiPixelCluster.h:158
SiPixelCluster::packRow
void packRow(uint16_t xmin, uint16_t xspan)
Definition: SiPixelCluster.h:180
L1TOccupancyClient_cfi.ymin
ymin
Definition: L1TOccupancyClient_cfi.py:43
SiPixelCluster::charge
int charge() const
Definition: SiPixelCluster.h:130
align::Pixel
Definition: StructureType.h:68
TrackerOfflineValidation_Dqm_cff.xmin
xmin
Definition: TrackerOfflineValidation_Dqm_cff.py:10