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.

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  }

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

Member Function Documentation

◆ avg_col()

float CTPPSPixelCluster::avg_col ( ) const
inline

Definition at line 62 of file CTPPSPixelCluster.h.

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  }

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

◆ avg_row()

float CTPPSPixelCluster::avg_row ( ) const
inline

Definition at line 54 of file CTPPSPixelCluster.h.

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  }

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

◆ charge()

float CTPPSPixelCluster::charge ( ) const
inline

Definition at line 72 of file CTPPSPixelCluster.h.

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  }

References mps_fire::i, and thePixelADC.

Referenced by avg_col(), and avg_row().

◆ colSpan()

unsigned int CTPPSPixelCluster::colSpan ( ) const
inline

Definition at line 92 of file CTPPSPixelCluster.h.

92 { return thePixelColSpan; }

References thePixelColSpan.

Referenced by RPixClusterToHit::make_hit().

◆ minPixelCol()

unsigned int CTPPSPixelCluster::minPixelCol ( ) const
inline

Definition at line 90 of file CTPPSPixelCluster.h.

90 { return theMinPixelCol; }

References theMinPixelCol.

Referenced by RPixClusterToHit::make_hit(), and operator<().

◆ minPixelRow()

unsigned int CTPPSPixelCluster::minPixelRow ( ) const
inline

Definition at line 89 of file CTPPSPixelCluster.h.

89 { return theMinPixelRow; }

References theMinPixelRow.

Referenced by RPixClusterToHit::make_hit(), and operator<().

◆ pixelADC() [1/2]

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

Definition at line 96 of file CTPPSPixelCluster.h.

96 { return thePixelADC; }

References thePixelADC.

Referenced by RPixClusterToHit::make_hit().

◆ pixelADC() [2/2]

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

Definition at line 100 of file CTPPSPixelCluster.h.

100 { return thePixelADC[i]; }

References mps_fire::i, and thePixelADC.

◆ pixelCol()

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

Definition at line 99 of file CTPPSPixelCluster.h.

99 { return theMinPixelCol + thePixelOffset[i * 2 + 1]; }

References mps_fire::i, theMinPixelCol, and thePixelOffset.

Referenced by RPixClusterToHit::make_hit().

◆ pixelOffset()

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

Definition at line 95 of file CTPPSPixelCluster.h.

95 { return thePixelOffset; }

References thePixelOffset.

◆ pixelRow()

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

Definition at line 98 of file CTPPSPixelCluster.h.

98 { return theMinPixelRow + thePixelOffset[i * 2]; }

References mps_fire::i, theMinPixelRow, and thePixelOffset.

Referenced by RPixClusterToHit::make_hit().

◆ rowSpan()

unsigned int CTPPSPixelCluster::rowSpan ( ) const
inline

Definition at line 93 of file CTPPSPixelCluster.h.

93 { return thePixelRowSpan; }

References thePixelRowSpan.

Referenced by RPixClusterToHit::make_hit().

◆ size()

unsigned int CTPPSPixelCluster::size ( void  ) const
inline

◆ sizeCol()

unsigned int CTPPSPixelCluster::sizeCol ( ) const
inline

Definition at line 87 of file CTPPSPixelCluster.h.

87 { return thePixelColSpan + 1; }

References thePixelColSpan.

Referenced by RPixClusterToHit::make_hit().

◆ sizeRow()

unsigned int CTPPSPixelCluster::sizeRow ( ) const
inline

Definition at line 84 of file CTPPSPixelCluster.h.

84 { return thePixelRowSpan + 1; }

References thePixelRowSpan.

Referenced by RPixClusterToHit::make_hit().

Member Data Documentation

◆ MAXCOL

constexpr uint8_t CTPPSPixelCluster::MAXCOL = 155
staticconstexpr

Definition at line 18 of file CTPPSPixelCluster.h.

Referenced by CTPPSPixelCluster().

◆ MAXROW

constexpr uint8_t CTPPSPixelCluster::MAXROW = 159
staticconstexpr

Definition at line 19 of file CTPPSPixelCluster.h.

Referenced by CTPPSPixelCluster().

◆ MAXSPAN

constexpr uint8_t CTPPSPixelCluster::MAXSPAN = 255
staticconstexpr

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().

CTPPSPixelCluster::thePixelRowSpan
uint8_t thePixelRowSpan
Definition: CTPPSPixelCluster.h:108
mps_fire.i
i
Definition: mps_fire.py:355
CTPPSPixelCluster::charge
float charge() const
Definition: CTPPSPixelCluster.h:72
min
T min(T a, T b)
Definition: MathUtil.h:58
CTPPSPixelCluster::MAXROW
static constexpr uint8_t MAXROW
Definition: CTPPSPixelCluster.h:19
CTPPSPixelCluster::thePixelADC
std::vector< uint16_t > thePixelADC
Definition: CTPPSPixelCluster.h:104
CTPPSPixelCluster::MAXCOL
static constexpr uint8_t MAXCOL
Definition: CTPPSPixelCluster.h:18
CTPPSPixelCluster::thePixelOffset
std::vector< uint8_t > thePixelOffset
Definition: CTPPSPixelCluster.h:103
CTPPSPixelCluster::thePixelColSpan
uint8_t thePixelColSpan
Definition: CTPPSPixelCluster.h:109
CTPPSPixelCluster::MAXSPAN
static constexpr uint8_t MAXSPAN
Definition: CTPPSPixelCluster.h:17
CTPPSPixelCluster::theMinPixelRow
uint8_t theMinPixelRow
Definition: CTPPSPixelCluster.h:106
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
CTPPSPixelCluster::theMinPixelCol
uint8_t theMinPixelCol
Definition: CTPPSPixelCluster.h:107