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 25 of file SiPixelArrayBuffer.h.

Constructor & Destructor Documentation

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

Definition at line 52 of file SiPixelArrayBuffer.h.

52 : pixel_vec(rows * cols, 0), nrows(rows), ncols(cols) {}
std::vector< int > pixel_vec
SiPixelArrayBuffer::SiPixelArrayBuffer ( )
inline

Definition at line 28 of file SiPixelArrayBuffer.h.

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

28 {}

Member Function Documentation

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

Definition at line 71 of file SiPixelArrayBuffer.h.

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

Referenced by columns(), and PixelThresholdClusterizer::copy_to_buffer().

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

Definition of indexing within the buffer.

Definition at line 43 of file SiPixelArrayBuffer.h.

References nrows.

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

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

Definition at line 44 of file SiPixelArrayBuffer.h.

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

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

44 { 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 60 of file SiPixelArrayBuffer.h.

References ncols.

Referenced by columns().

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

Definition at line 62 of file SiPixelArrayBuffer.h.

References index(), and pixel_vec.

Referenced by SiPixelArrayBuffer().

62 { 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 64 of file SiPixelArrayBuffer.h.

References index(), and pixel_vec.

64 { 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
void SiPixelArrayBuffer::set_adc ( int  row,
int  col,
int  adc 
)
inline

Definition at line 67 of file SiPixelArrayBuffer.h.

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

Referenced by PixelThresholdClusterizer::clear_buffer(), columns(), PixelThresholdClusterizer::copy_to_buffer(), and PixelThresholdClusterizer::make_cluster().

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

Definition at line 69 of file SiPixelArrayBuffer.h.

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

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

Definition at line 54 of file SiPixelArrayBuffer.h.

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

Referenced by PixelThresholdClusterizer::PixelThresholdClusterizer(), PixelThresholdClusterizer::setup(), and SiPixelArrayBuffer().

54  {
55  pixel_vec.resize(rows * cols, 0);
56  nrows = rows;
57  ncols = cols;
58 }
std::vector< int > pixel_vec
int SiPixelArrayBuffer::size ( void  ) const
inline

Definition at line 40 of file SiPixelArrayBuffer.h.

References pixel_vec.

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

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

Member Data Documentation

int SiPixelArrayBuffer::ncols
private

Definition at line 49 of file SiPixelArrayBuffer.h.

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

int SiPixelArrayBuffer::nrows
private

Definition at line 48 of file SiPixelArrayBuffer.h.

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

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

Definition at line 47 of file SiPixelArrayBuffer.h.

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