CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Attributes | Private Attributes
CTPPSPixelCluster Class Reference

#include <CTPPSPixelCluster.h>

Public Member Functions

float avg_col () const
 
float avg_row () const
 
float charge () const
 
unsigned int colSpan () const
 
 CTPPSPixelCluster ()
 
 CTPPSPixelCluster (uint16_t isize, uint16_t *adcs, uint8_t const *rowpos, uint8_t const *colpos)
 
unsigned int minPixelCol () const
 
unsigned int minPixelRow () const
 
const std::vector< uint16_t > & pixelADC () const
 
unsigned int pixelADC (unsigned int i) const
 
unsigned int pixelCol (unsigned int i) const
 
const std::vector< uint8_t > & pixelOffset () const
 
unsigned int pixelRow (unsigned int i) const
 
unsigned int rowSpan () const
 
unsigned int size () const
 
unsigned int sizeCol () const
 
unsigned int sizeRow () const
 

Static Public Attributes

static constexpr uint8_t MAXCOL = 155
 
static constexpr uint8_t MAXROW = 159
 
static constexpr uint8_t MAXSPAN = 255
 

Private Attributes

uint8_t theMinPixelCol = MAXCOL
 
uint8_t theMinPixelRow = MAXROW
 
std::vector< uint16_t > thePixelADC
 
uint8_t thePixelColSpan = 0
 
std::vector< uint8_t > thePixelOffset
 
uint8_t thePixelRowSpan = 0
 

Detailed Description

Definition at line 14 of file CTPPSPixelCluster.h.

Constructor & Destructor Documentation

◆ CTPPSPixelCluster() [1/2]

CTPPSPixelCluster::CTPPSPixelCluster ( )
inline

Definition at line 16 of file CTPPSPixelCluster.h.

16 {}

◆ CTPPSPixelCluster() [2/2]

CTPPSPixelCluster::CTPPSPixelCluster ( uint16_t  isize,
uint16_t *  adcs,
uint8_t const *  rowpos,
uint8_t const *  colpos 
)
inline

Definition at line 21 of file CTPPSPixelCluster.h.

References mps_fire::i, dqmiolumiharvest::j, MAXCOL, MAXROW, MAXSPAN, SiStripPI::min, theMinPixelCol, theMinPixelRow, thePixelColSpan, thePixelOffset, and thePixelRowSpan.

23  2 *
24  isize), // the pixel offset is the pixel position inside the cluster wrt rowmin (even positions) and colmin (odd positions)
25  thePixelADC(adcs, adcs + isize) {
26  uint8_t maxCol = 0;
27  uint8_t maxRow = 0;
28  uint8_t rowmin = MAXROW;
29  uint8_t colmin = MAXCOL;
30  for (unsigned int j = 0; j != isize; ++j) {
31  rowmin = std::min(rowpos[j], rowmin);
32  colmin = std::min(colpos[j], colmin);
33  }
34  for (unsigned int i = 0; i != isize; ++i) {
35  uint8_t rowoffset = rowpos[i] - rowmin;
36  uint8_t coloffset = colpos[i] - colmin;
37  thePixelOffset[i * 2] = std::min(MAXSPAN, rowoffset);
38  thePixelOffset[i * 2 + 1] = std::min(MAXSPAN, coloffset);
39  if (rowoffset > maxRow)
40  maxRow = rowoffset;
41  if (coloffset > maxCol)
42  maxCol = coloffset;
43  }
44 
45  theMinPixelRow = rowmin;
46  thePixelRowSpan = std::min(maxRow, MAXSPAN);
47 
48  theMinPixelCol = colmin;
49  thePixelColSpan = std::min(maxCol, MAXSPAN);
50  }
std::vector< uint16_t > thePixelADC
std::vector< uint8_t > thePixelOffset
static constexpr uint8_t MAXROW
static constexpr uint8_t MAXCOL
static constexpr uint8_t MAXSPAN

Member Function Documentation

◆ avg_col()

float CTPPSPixelCluster::avg_col ( ) const
inline

Definition at line 62 of file CTPPSPixelCluster.h.

References charge(), mps_fire::i, theMinPixelCol, thePixelADC, and thePixelOffset.

62  {
63  float qm = 0.0;
64  unsigned int isize = thePixelADC.size();
65  for (unsigned int i = 0; i < isize; ++i)
66  qm += float(thePixelADC[i]) * (thePixelOffset[i * 2 + 1] + theMinPixelCol + 0.5f);
67  return qm / charge();
68  }
std::vector< uint16_t > thePixelADC
std::vector< uint8_t > thePixelOffset
float charge() const

◆ avg_row()

float CTPPSPixelCluster::avg_row ( ) const
inline

Definition at line 54 of file CTPPSPixelCluster.h.

References charge(), mps_fire::i, theMinPixelRow, thePixelADC, and thePixelOffset.

54  {
55  float qm = 0.0;
56  unsigned int isize = thePixelADC.size();
57  for (unsigned int i = 0; i < isize; ++i)
58  qm += float(thePixelADC[i]) * (thePixelOffset[i * 2] + theMinPixelRow + 0.5f);
59  return qm / charge();
60  }
std::vector< uint16_t > thePixelADC
std::vector< uint8_t > thePixelOffset
float charge() const

◆ charge()

float CTPPSPixelCluster::charge ( ) const
inline

Definition at line 72 of file CTPPSPixelCluster.h.

References mps_fire::i, and thePixelADC.

Referenced by avg_col(), and avg_row().

72  {
73  float qm = 0.0;
74  unsigned int isize = thePixelADC.size();
75  for (unsigned int i = 0; i < isize; ++i)
76  qm += float(thePixelADC[i]);
77  return qm;
78  }
std::vector< uint16_t > thePixelADC

◆ colSpan()

unsigned int CTPPSPixelCluster::colSpan ( ) const
inline

Definition at line 92 of file CTPPSPixelCluster.h.

References thePixelColSpan.

Referenced by RPixClusterToHit::make_hit().

92 { return thePixelColSpan; }

◆ minPixelCol()

unsigned int CTPPSPixelCluster::minPixelCol ( ) const
inline

Definition at line 90 of file CTPPSPixelCluster.h.

References theMinPixelCol.

Referenced by RPixClusterToHit::make_hit().

90 { return theMinPixelCol; }

◆ minPixelRow()

unsigned int CTPPSPixelCluster::minPixelRow ( ) const
inline

Definition at line 89 of file CTPPSPixelCluster.h.

References theMinPixelRow.

Referenced by RPixClusterToHit::make_hit().

89 { return theMinPixelRow; }

◆ pixelADC() [1/2]

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

Definition at line 96 of file CTPPSPixelCluster.h.

References thePixelADC.

Referenced by RPixClusterToHit::make_hit().

96 { return thePixelADC; }
std::vector< uint16_t > thePixelADC

◆ pixelADC() [2/2]

unsigned int CTPPSPixelCluster::pixelADC ( unsigned int  i) const
inline

Definition at line 100 of file CTPPSPixelCluster.h.

References mps_fire::i, and thePixelADC.

100 { return thePixelADC[i]; }
std::vector< uint16_t > thePixelADC

◆ pixelCol()

unsigned int CTPPSPixelCluster::pixelCol ( unsigned int  i) const
inline

Definition at line 99 of file CTPPSPixelCluster.h.

References mps_fire::i, theMinPixelCol, and thePixelOffset.

Referenced by RPixClusterToHit::make_hit().

99 { return theMinPixelCol + thePixelOffset[i * 2 + 1]; }
std::vector< uint8_t > thePixelOffset

◆ pixelOffset()

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

Definition at line 95 of file CTPPSPixelCluster.h.

References thePixelOffset.

95 { return thePixelOffset; }
std::vector< uint8_t > thePixelOffset

◆ pixelRow()

unsigned int CTPPSPixelCluster::pixelRow ( unsigned int  i) const
inline

Definition at line 98 of file CTPPSPixelCluster.h.

References mps_fire::i, theMinPixelRow, and thePixelOffset.

Referenced by RPixClusterToHit::make_hit().

98 { return theMinPixelRow + thePixelOffset[i * 2]; }
std::vector< uint8_t > thePixelOffset

◆ rowSpan()

unsigned int CTPPSPixelCluster::rowSpan ( ) const
inline

Definition at line 93 of file CTPPSPixelCluster.h.

References thePixelRowSpan.

Referenced by RPixClusterToHit::make_hit().

93 { return thePixelRowSpan; }

◆ size()

unsigned int CTPPSPixelCluster::size ( void  ) const
inline

Definition at line 81 of file CTPPSPixelCluster.h.

References thePixelADC.

Referenced by ntupleDataFormat._Collection::__iter__(), ntupleDataFormat._Collection::__len__(), and RPixClusterToHit::make_hit().

81 { return thePixelADC.size(); }
std::vector< uint16_t > thePixelADC

◆ sizeCol()

unsigned int CTPPSPixelCluster::sizeCol ( ) const
inline

Definition at line 87 of file CTPPSPixelCluster.h.

References thePixelColSpan.

Referenced by RPixClusterToHit::make_hit().

87 { return thePixelColSpan + 1; }

◆ sizeRow()

unsigned int CTPPSPixelCluster::sizeRow ( ) const
inline

Definition at line 84 of file CTPPSPixelCluster.h.

References thePixelRowSpan.

Referenced by RPixClusterToHit::make_hit().

84 { return thePixelRowSpan + 1; }

Member Data Documentation

◆ MAXCOL

constexpr uint8_t CTPPSPixelCluster::MAXCOL = 155
static

Definition at line 18 of file CTPPSPixelCluster.h.

Referenced by CTPPSPixelCluster().

◆ MAXROW

constexpr uint8_t CTPPSPixelCluster::MAXROW = 159
static

Definition at line 19 of file CTPPSPixelCluster.h.

Referenced by CTPPSPixelCluster().

◆ MAXSPAN

constexpr uint8_t CTPPSPixelCluster::MAXSPAN = 255
static

Definition at line 17 of file CTPPSPixelCluster.h.

Referenced by CTPPSPixelCluster().

◆ theMinPixelCol

uint8_t CTPPSPixelCluster::theMinPixelCol = MAXCOL
private

Definition at line 107 of file CTPPSPixelCluster.h.

Referenced by avg_col(), CTPPSPixelCluster(), minPixelCol(), and pixelCol().

◆ theMinPixelRow

uint8_t CTPPSPixelCluster::theMinPixelRow = MAXROW
private

Definition at line 106 of file CTPPSPixelCluster.h.

Referenced by avg_row(), CTPPSPixelCluster(), minPixelRow(), and pixelRow().

◆ thePixelADC

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

Definition at line 104 of file CTPPSPixelCluster.h.

Referenced by avg_col(), avg_row(), charge(), pixelADC(), and size().

◆ thePixelColSpan

uint8_t CTPPSPixelCluster::thePixelColSpan = 0
private

Definition at line 109 of file CTPPSPixelCluster.h.

Referenced by colSpan(), CTPPSPixelCluster(), and sizeCol().

◆ thePixelOffset

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

◆ thePixelRowSpan

uint8_t CTPPSPixelCluster::thePixelRowSpan = 0
private

Definition at line 108 of file CTPPSPixelCluster.h.

Referenced by CTPPSPixelCluster(), rowSpan(), and sizeRow().