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 16 of file CTPPSPixelCluster.h.

Constructor & Destructor Documentation

CTPPSPixelCluster::CTPPSPixelCluster ( )
inline

Definition at line 20 of file CTPPSPixelCluster.h.

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

Definition at line 26 of file CTPPSPixelCluster.h.

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

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

Member Function Documentation

float CTPPSPixelCluster::avg_col ( ) const
inline

Definition at line 67 of file CTPPSPixelCluster.h.

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

67  {
68  float qm = 0.0;
69  unsigned int isize = thePixelADC.size();
70  for (unsigned int i=0; i<isize; ++i)
71  qm += float(thePixelADC[i]) * (thePixelOffset[i*2+1] + theMinPixelCol + 0.5f);
72  return qm/charge();
73  }
float charge() const
std::vector< uint16_t > thePixelADC
std::vector< uint8_t > thePixelOffset
float CTPPSPixelCluster::avg_row ( ) const
inline

Definition at line 59 of file CTPPSPixelCluster.h.

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

59  {
60  float qm = 0.0;
61  unsigned int isize = thePixelADC.size();
62  for (unsigned int i=0; i<isize; ++i)
63  qm += float(thePixelADC[i]) * (thePixelOffset[i*2] + theMinPixelRow + 0.5f);
64  return qm/charge();
65  }
float charge() const
std::vector< uint16_t > thePixelADC
std::vector< uint8_t > thePixelOffset
float CTPPSPixelCluster::charge ( ) const
inline

Definition at line 77 of file CTPPSPixelCluster.h.

References mps_fire::i, and thePixelADC.

Referenced by avg_col(), and avg_row().

77  {
78  float qm = 0.0;
79  unsigned int isize = thePixelADC.size();
80  for (unsigned int i=0; i<isize; ++i)
81  qm += float(thePixelADC[i]);
82  return qm;
83  }
std::vector< uint16_t > thePixelADC
unsigned int CTPPSPixelCluster::colSpan ( ) const
inline

Definition at line 98 of file CTPPSPixelCluster.h.

References thePixelColSpan.

Referenced by RPixClusterToHit::make_hit().

98 {return thePixelColSpan; }
unsigned int CTPPSPixelCluster::minPixelCol ( ) const
inline

Definition at line 95 of file CTPPSPixelCluster.h.

References theMinPixelCol.

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

95 { return theMinPixelCol;}
unsigned int CTPPSPixelCluster::minPixelRow ( ) const
inline

Definition at line 94 of file CTPPSPixelCluster.h.

References theMinPixelRow.

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

94 { return theMinPixelRow;}
const std::vector<uint16_t>& CTPPSPixelCluster::pixelADC ( ) const
inline

Definition at line 102 of file CTPPSPixelCluster.h.

References thePixelADC.

Referenced by RPixClusterToHit::make_hit().

102 { return thePixelADC;}
std::vector< uint16_t > thePixelADC
unsigned int CTPPSPixelCluster::pixelADC ( unsigned int  i) const
inline

Definition at line 110 of file CTPPSPixelCluster.h.

References mps_fire::i, and thePixelADC.

110  {
111  return thePixelADC[i];
112  }
std::vector< uint16_t > thePixelADC
unsigned int CTPPSPixelCluster::pixelCol ( unsigned int  i) const
inline

Definition at line 107 of file CTPPSPixelCluster.h.

References theMinPixelCol, and thePixelOffset.

Referenced by RPixClusterToHit::make_hit().

107  {
108  return theMinPixelCol + thePixelOffset[i*2+1];
109  }
std::vector< uint8_t > thePixelOffset
const std::vector<uint8_t>& CTPPSPixelCluster::pixelOffset ( ) const
inline

Definition at line 101 of file CTPPSPixelCluster.h.

References thePixelOffset.

101 { return thePixelOffset;}
std::vector< uint8_t > thePixelOffset
unsigned int CTPPSPixelCluster::pixelRow ( unsigned int  i) const
inline

Definition at line 104 of file CTPPSPixelCluster.h.

References theMinPixelRow, and thePixelOffset.

Referenced by RPixClusterToHit::make_hit().

104  {
105  return theMinPixelRow + thePixelOffset[i*2];
106  }
std::vector< uint8_t > thePixelOffset
unsigned int CTPPSPixelCluster::rowSpan ( ) const
inline

Definition at line 99 of file CTPPSPixelCluster.h.

References thePixelRowSpan.

Referenced by RPixClusterToHit::make_hit().

99 { return thePixelRowSpan; }
unsigned int CTPPSPixelCluster::size ( void  ) const
inline

Definition at line 86 of file CTPPSPixelCluster.h.

References thePixelADC.

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

86 { return thePixelADC.size();}
std::vector< uint16_t > thePixelADC
unsigned int CTPPSPixelCluster::sizeCol ( ) const
inline

Definition at line 92 of file CTPPSPixelCluster.h.

References thePixelColSpan.

Referenced by RPixClusterToHit::make_hit().

92 { return thePixelColSpan +1;}
unsigned int CTPPSPixelCluster::sizeRow ( ) const
inline

Definition at line 89 of file CTPPSPixelCluster.h.

References thePixelRowSpan.

Referenced by RPixClusterToHit::make_hit().

89 { return thePixelRowSpan +1;}

Member Data Documentation

constexpr uint8_t CTPPSPixelCluster::MAXCOL =155
static

Definition at line 22 of file CTPPSPixelCluster.h.

Referenced by CTPPSPixelCluster().

constexpr uint8_t CTPPSPixelCluster::MAXROW =159
static

Definition at line 23 of file CTPPSPixelCluster.h.

Referenced by CTPPSPixelCluster().

constexpr uint8_t CTPPSPixelCluster::MAXSPAN =255
static

Definition at line 21 of file CTPPSPixelCluster.h.

uint8_t CTPPSPixelCluster::theMinPixelCol =MAXCOL
private

Definition at line 121 of file CTPPSPixelCluster.h.

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

uint8_t CTPPSPixelCluster::theMinPixelRow =MAXROW
private

Definition at line 120 of file CTPPSPixelCluster.h.

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

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

Definition at line 117 of file CTPPSPixelCluster.h.

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

uint8_t CTPPSPixelCluster::thePixelColSpan =0
private

Definition at line 123 of file CTPPSPixelCluster.h.

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

std::vector<uint8_t> CTPPSPixelCluster::thePixelOffset
private
uint8_t CTPPSPixelCluster::thePixelRowSpan =0
private

Definition at line 122 of file CTPPSPixelCluster.h.

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