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
 
auto originalId () 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 setOriginalId (uint16_t id)
 
void setSplitClusterErrorX (float errx)
 
void setSplitClusterErrorY (float erry)
 
 SiPixelCluster ()=default
 
 SiPixelCluster (const PixelPos &pix, int adc)
 
 SiPixelCluster (unsigned int isize, uint16_t const *adcs, uint16_t const *xpos, uint16_t const *ypos, uint16_t xmin, uint16_t ymin, uint16_t id=invalidClusterId)
 
int size () const
 
int sizeX () const
 
int sizeY () const
 
float x () const
 
float y () const
 

Static Public Attributes

static constexpr uint16_t invalidClusterId = std::numeric_limits<uint16_t>::max()
 
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
 
uint16_t theOriginalClusterId = invalidClusterId
 
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 28 of file SiPixelCluster.h.

Member Typedef Documentation

◆ PixelDigiIter

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

Definition at line 66 of file SiPixelCluster.h.

◆ PixelDigiRange

Definition at line 67 of file SiPixelCluster.h.

Constructor & Destructor Documentation

◆ SiPixelCluster() [1/3]

SiPixelCluster::SiPixelCluster ( )
default

Construct from a range of digis that form a cluster and from a DetID. The range is assumed to be non-empty.

◆ SiPixelCluster() [2/3]

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

Definition at line 80 of file SiPixelCluster.h.

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

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

◆ 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 gpuClustering::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 gpuClustering::adc, SiPixelCluster::PixelPos::col(), mps_fire::i, maxPixelCol(), maxPixelRow(), MAXSPAN, min(), minPixelCol(), minPixelRow(), overflowCol(), overflowRow(), packCol(), packRow(), SiPixelCluster::PixelPos::row(), thePixelADC, thePixelOffset, EcalSCDynamicDPhiParametersESProducer_cfi::xoffset, and EcalSCDynamicDPhiParametersESProducer_cfi::yoffset.

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

170 { return thePixelColSpan; }

References thePixelColSpan.

Referenced by maxPixelCol(), and sizeY().

◆ getSplitClusterErrorX()

float SiPixelCluster::getSplitClusterErrorX ( ) const
inline

Definition at line 193 of file SiPixelCluster.h.

193 { return err_x; }

References err_x.

Referenced by PixelCPEClusterRepair::localError().

◆ getSplitClusterErrorY()

float SiPixelCluster::getSplitClusterErrorY ( ) const
inline

Definition at line 194 of file SiPixelCluster.h.

194 { return err_y; }

References err_y.

Referenced by PixelCPEClusterRepair::localError().

◆ maxPixelCol()

int SiPixelCluster::maxPixelCol ( ) const
inline

◆ maxPixelRow()

int SiPixelCluster::maxPixelRow ( ) const
inline

◆ minPixelCol()

int SiPixelCluster::minPixelCol ( ) const
inline

◆ minPixelRow()

int SiPixelCluster::minPixelRow ( ) const
inline

◆ originalId()

auto SiPixelCluster::originalId ( ) const
inline

Definition at line 197 of file SiPixelCluster.h.

197 { return theOriginalClusterId; }

References theOriginalClusterId.

◆ overflow()

bool SiPixelCluster::overflow ( ) const
inline

Definition at line 178 of file SiPixelCluster.h.

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

References overflowCol(), and overflowRow().

◆ overflow_()

static int SiPixelCluster::overflow_ ( uint16_t  span)
inlinestaticprivate

Definition at line 167 of file SiPixelCluster.h.

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

References MAXSPAN.

Referenced by overflowCol(), and overflowRow().

◆ overflowCol()

bool SiPixelCluster::overflowCol ( ) const
inline

Definition at line 174 of file SiPixelCluster.h.

174 { return overflow_(thePixelColSpan); }

References overflow_(), and thePixelColSpan.

Referenced by add(), and overflow().

◆ overflowRow()

bool SiPixelCluster::overflowRow ( ) const
inline

Definition at line 176 of file SiPixelCluster.h.

176 { 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 180 of file SiPixelCluster.h.

180  {
182  thePixelColSpan = std::min(yspan, uint16_t(MAXSPAN));
183  }

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

184  {
186  thePixelRowSpan = std::min(xspan, uint16_t(MAXSPAN));
187  }

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

◆ pixelOffset()

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

Definition at line 147 of file SiPixelCluster.h.

147 { return thePixelOffset; }

References thePixelOffset.

◆ pixels()

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

Definition at line 151 of file SiPixelCluster.h.

151  {
152  std::vector<Pixel> oldPixVector;
153  int isize = thePixelADC.size();
154  oldPixVector.reserve(isize);
155  for (int i = 0; i < isize; ++i) {
156  oldPixVector.push_back(pixel(i));
157  }
158  return oldPixVector;
159  }

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

172 { return thePixelRowSpan; }

References thePixelRowSpan.

Referenced by maxPixelRow(), and sizeX().

◆ setOriginalId()

void SiPixelCluster::setOriginalId ( uint16_t  id)
inline

Definition at line 198 of file SiPixelCluster.h.

References triggerObjects_cff::id, and theOriginalClusterId.

◆ setSplitClusterErrorX()

void SiPixelCluster::setSplitClusterErrorX ( float  errx)
inline

Definition at line 191 of file SiPixelCluster.h.

191 { err_x = errx; }

References err_x.

◆ setSplitClusterErrorY()

void SiPixelCluster::setSplitClusterErrorY ( float  erry)
inline

Definition at line 192 of file SiPixelCluster.h.

192 { 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 211 of file SiPixelCluster.h.

Referenced by getSplitClusterErrorX(), and setSplitClusterErrorX().

◆ err_y

float SiPixelCluster::err_y = -99999.9f
private

Definition at line 212 of file SiPixelCluster.h.

Referenced by getSplitClusterErrorY(), and setSplitClusterErrorY().

◆ invalidClusterId

constexpr uint16_t SiPixelCluster::invalidClusterId = std::numeric_limits<uint16_t>::max()
staticconstexpr

Definition at line 72 of file SiPixelCluster.h.

◆ MAXPOS

constexpr unsigned int SiPixelCluster::MAXPOS = 2047
staticconstexpr

Definition at line 70 of file SiPixelCluster.h.

◆ MAXSPAN

constexpr unsigned int SiPixelCluster::MAXSPAN = 255
staticconstexpr

Definition at line 69 of file SiPixelCluster.h.

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

◆ theMinPixelCol

uint16_t SiPixelCluster::theMinPixelCol = MAXPOS
private

Definition at line 205 of file SiPixelCluster.h.

Referenced by minPixelCol(), and packCol().

◆ theMinPixelRow

uint16_t SiPixelCluster::theMinPixelRow = MAXPOS
private

Definition at line 204 of file SiPixelCluster.h.

Referenced by minPixelRow(), and packRow().

◆ theOriginalClusterId

uint16_t SiPixelCluster::theOriginalClusterId = invalidClusterId
private

Definition at line 209 of file SiPixelCluster.h.

Referenced by originalId(), and setOriginalId().

◆ thePixelADC

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

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

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

◆ thePixelOffset

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

Definition at line 201 of file SiPixelCluster.h.

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

◆ thePixelRowSpan

uint8_t SiPixelCluster::thePixelRowSpan = 0
private

Definition at line 206 of file SiPixelCluster.h.

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

SiPixelCluster::theMinPixelRow
uint16_t theMinPixelRow
Definition: SiPixelCluster.h:204
SiPixelCluster::minPixelCol
int minPixelCol() const
Definition: SiPixelCluster.h:144
EcalSCDynamicDPhiParametersESProducer_cfi.yoffset
yoffset
Definition: EcalSCDynamicDPhiParametersESProducer_cfi.py:10
mps_fire.i
i
Definition: mps_fire.py:428
SiPixelCluster::packCol
void packCol(uint16_t ymin, uint16_t yspan)
Definition: SiPixelCluster.h:180
SiPixelCluster::overflowRow
bool overflowRow() const
Definition: SiPixelCluster.h:176
min
T min(T a, T b)
Definition: MathUtil.h:58
EcalSCDynamicDPhiParametersESProducer_cfi.xoffset
xoffset
Definition: EcalSCDynamicDPhiParametersESProducer_cfi.py:12
gpuClustering::adc
uint16_t *__restrict__ uint16_t const *__restrict__ adc
Definition: gpuClusterChargeCut.h:20
SiPixelCluster::maxPixelCol
int maxPixelCol() const
Definition: SiPixelCluster.h:145
SiPixelCluster::maxPixelRow
int maxPixelRow() const
Definition: SiPixelCluster.h:143
SiPixelCluster::rowSpan
int rowSpan() const
Definition: SiPixelCluster.h:172
SiPixelCluster::MAXSPAN
static constexpr unsigned int MAXSPAN
Definition: SiPixelCluster.h:69
SiPixelCluster::theOriginalClusterId
uint16_t theOriginalClusterId
Definition: SiPixelCluster.h:209
SiPixelCluster::theMinPixelCol
uint16_t theMinPixelCol
Definition: SiPixelCluster.h:205
SiPixelCluster::overflowCol
bool overflowCol() const
Definition: SiPixelCluster.h:174
SiPixelCluster::colSpan
int colSpan() const
Definition: SiPixelCluster.h:170
SiPixelCluster::thePixelColSpan
uint8_t thePixelColSpan
Definition: SiPixelCluster.h:207
SiPixelCluster::overflow_
static int overflow_(uint16_t span)
Definition: SiPixelCluster.h:167
SiPixelCluster::minPixelRow
int minPixelRow() const
Definition: SiPixelCluster.h:142
SiPixelCluster::thePixelRowSpan
uint8_t thePixelRowSpan
Definition: SiPixelCluster.h:206
SiPixelCluster::err_y
float err_y
Definition: SiPixelCluster.h:212
SiPixelCluster::err_x
float err_x
Definition: SiPixelCluster.h:211
SiPixelCluster::thePixelADC
std::vector< uint16_t > thePixelADC
Definition: SiPixelCluster.h:202
SiPixelCluster::thePixelOffset
std::vector< uint8_t > thePixelOffset
Definition: SiPixelCluster.h:201
SiPixelCluster::pixel
Pixel pixel(int i) const
Definition: SiPixelCluster.h:162
SiPixelCluster::packRow
void packRow(uint16_t xmin, uint16_t xspan)
Definition: SiPixelCluster.h:184
L1TOccupancyClient_cfi.ymin
ymin
Definition: L1TOccupancyClient_cfi.py:43
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
SiPixelCluster::charge
int charge() const
Definition: SiPixelCluster.h:134
align::Pixel
Definition: StructureType.h:68
TrackerOfflineValidation_Dqm_cff.xmin
xmin
Definition: TrackerOfflineValidation_Dqm_cff.py:10