CMS 3D CMS Logo

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

Class to store ADC counts during clustering. More...

#include <SiPixelArrayBuffer.h>

Public Member Functions

void add_adc (int row, int col, int adc)
 
int columns () const
 
int index (int row, int col) const
 Definition of indexing within the buffer. More...
 
int index (const SiPixelCluster::PixelPos &pix) const
 
bool inside (int row, int col) const
 
int operator() (int row, int col) const
 
int operator() (const SiPixelCluster::PixelPos &) const
 
int rows () const
 
void set_adc (int row, int col, int adc)
 
void set_adc (const SiPixelCluster::PixelPos &, int adc)
 
void setSize (int rows, int cols)
 
 SiPixelArrayBuffer (int rows, int cols)
 
 SiPixelArrayBuffer ()
 
int size () const
 

Private Attributes

int ncols
 
int nrows
 
std::vector< int > pixel_vec
 

Detailed Description

Class to store ADC counts during clustering.

This class defines the buffer where the pixel ADC are stored. The size is the number of rows and cols into a ROC and it is set in the PixelThresholdClusterizer

TO DO: the chip size should be obtained in some better way.

History: Modify the indexing to col*nrows + row. 9/01 d.k. Add setSize method to adjust array size. 3/02 d.k.

Definition at line 27 of file SiPixelArrayBuffer.h.

Constructor & Destructor Documentation

SiPixelArrayBuffer::SiPixelArrayBuffer ( int  rows,
int  cols 
)
inline

Definition at line 57 of file SiPixelArrayBuffer.h.

SiPixelArrayBuffer::SiPixelArrayBuffer ( )
inline

Definition at line 31 of file SiPixelArrayBuffer.h.

References cuy::col, operator()(), and setSize().

31 {}

Member Function Documentation

void SiPixelArrayBuffer::add_adc ( int  row,
int  col,
int  adc 
)
inline

Definition at line 91 of file SiPixelArrayBuffer.h.

References ecalMGPA::adc(), index(), and pixel_vec.

Referenced by columns().

92 {
93  pixel_vec[index(row,col)] += adc;
94 }
int adc(sample_type sample)
get the ADC sample (12 bits)
std::vector< int > pixel_vec
int index(int row, int col) const
Definition of indexing within the buffer.
col
Definition: cuy.py:1010
int SiPixelArrayBuffer::columns ( ) const
inline

Definition at line 37 of file SiPixelArrayBuffer.h.

References ecalMGPA::adc(), add_adc(), inside(), ncols, and set_adc().

37 { return ncols;}
int SiPixelArrayBuffer::index ( int  row,
int  col 
) const
inline

Definition of indexing within the buffer.

Definition at line 46 of file SiPixelArrayBuffer.h.

References nrows.

Referenced by add_adc(), BeautifulSoup.PageElement::insert(), operator()(), and set_adc().

46 {return col*nrows+row;}
col
Definition: cuy.py:1010
int SiPixelArrayBuffer::index ( const SiPixelCluster::PixelPos pix) const
inline

Definition at line 47 of file SiPixelArrayBuffer.h.

References SiPixelCluster::PixelPos::col(), index(), and SiPixelCluster::PixelPos::row().

Referenced by index(), and BeautifulSoup.PageElement::insert().

47 { return index(pix.row(), pix.col()); }
int index(int row, int col) const
Definition of indexing within the buffer.
constexpr int col() const
constexpr int row() const
bool SiPixelArrayBuffer::inside ( int  row,
int  col 
) const
inline

Definition at line 68 of file SiPixelArrayBuffer.h.

References ncols.

Referenced by columns().

69 {
70  return ( row >= 0 && row < nrows && col >= 0 && col < ncols);
71 }
col
Definition: cuy.py:1010
int SiPixelArrayBuffer::operator() ( int  row,
int  col 
) const
inline

Definition at line 74 of file SiPixelArrayBuffer.h.

References index(), and pixel_vec.

Referenced by SiPixelArrayBuffer().

74 { return pixel_vec[index(row,col)];}
std::vector< int > pixel_vec
int index(int row, int col) const
Definition of indexing within the buffer.
col
Definition: cuy.py:1010
int SiPixelArrayBuffer::operator() ( const SiPixelCluster::PixelPos pix) const
inline

Definition at line 77 of file SiPixelArrayBuffer.h.

References index(), and pixel_vec.

77 {return pixel_vec[index(pix)];}
std::vector< int > pixel_vec
int index(int row, int col) const
Definition of indexing within the buffer.
int SiPixelArrayBuffer::rows ( ) const
inline

Definition at line 36 of file SiPixelArrayBuffer.h.

References nrows.

Referenced by setSize().

36 { return nrows;}
void SiPixelArrayBuffer::set_adc ( int  row,
int  col,
int  adc 
)
inline

Definition at line 80 of file SiPixelArrayBuffer.h.

References ecalMGPA::adc(), index(), and pixel_vec.

Referenced by columns().

81 {
82  pixel_vec[index(row,col)] = adc;
83 }
int adc(sample_type sample)
get the ADC sample (12 bits)
std::vector< int > pixel_vec
int index(int row, int col) const
Definition of indexing within the buffer.
col
Definition: cuy.py:1010
void SiPixelArrayBuffer::set_adc ( const SiPixelCluster::PixelPos pix,
int  adc 
)
inline

Definition at line 86 of file SiPixelArrayBuffer.h.

References ecalMGPA::adc(), index(), and pixel_vec.

87 {
88  pixel_vec[index(pix)] = adc;
89 }
int adc(sample_type sample)
get the ADC sample (12 bits)
std::vector< int > pixel_vec
int index(int row, int col) const
Definition of indexing within the buffer.
void SiPixelArrayBuffer::setSize ( int  rows,
int  cols 
)
inline

Definition at line 61 of file SiPixelArrayBuffer.h.

References ncols, nrows, pixel_vec, and rows().

Referenced by SiPixelArrayBuffer().

61  {
62  pixel_vec.resize(rows*cols,0);
63  nrows = rows;
64  ncols = cols;
65 }
std::vector< int > pixel_vec
int SiPixelArrayBuffer::size ( void  ) const
inline

Definition at line 43 of file SiPixelArrayBuffer.h.

References pixel_vec.

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

43 { return pixel_vec.size();}
std::vector< int > pixel_vec

Member Data Documentation

int SiPixelArrayBuffer::ncols
private

Definition at line 52 of file SiPixelArrayBuffer.h.

Referenced by columns(), inside(), and setSize().

int SiPixelArrayBuffer::nrows
private

Definition at line 51 of file SiPixelArrayBuffer.h.

Referenced by index(), rows(), and setSize().

std::vector<int> SiPixelArrayBuffer::pixel_vec
private

Definition at line 50 of file SiPixelArrayBuffer.h.

Referenced by add_adc(), operator()(), set_adc(), setSize(), and size().