CMS 3D CMS Logo

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

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

#include <Phase2ITPixelArrayBuffer.h>

Public Member Functions

int columns () const
 
int index (int row, int col) const
 Definition of indexing within the buffer. More...
 
int index (const Phase2ITPixelCluster::PixelPos &pix) const
 
bool inside (int row, int col) const
 
int operator() (int row, int col) const
 
int operator() (const Phase2ITPixelCluster::PixelPos &) const
 
 Phase2ITPixelArrayBuffer (int rows, int cols)
 
 Phase2ITPixelArrayBuffer ()
 
int rows () const
 
void set_adc (int row, int col, int adc)
 
void set_adc (const Phase2ITPixelCluster::PixelPos &, int adc)
 
void setSize (int rows, int cols)
 
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 PhasePixelThresholdClusterizer

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 Phase2ITPixelArrayBuffer.h.

Constructor & Destructor Documentation

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

Definition at line 31 of file Phase2ITPixelArrayBuffer.h.

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

31 {}

Member Function Documentation

int Phase2ITPixelArrayBuffer::columns ( ) const
inline

Definition at line 37 of file Phase2ITPixelArrayBuffer.h.

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

int Phase2ITPixelArrayBuffer::index ( int  row,
int  col 
) const
inline

Definition of indexing within the buffer.

Definition at line 45 of file Phase2ITPixelArrayBuffer.h.

References nrows.

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

45 {return col*nrows+row;}
col
Definition: cuy.py:1010
int Phase2ITPixelArrayBuffer::index ( const Phase2ITPixelCluster::PixelPos pix) const
inline

Definition at line 46 of file Phase2ITPixelArrayBuffer.h.

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

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

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

Definition at line 67 of file Phase2ITPixelArrayBuffer.h.

References ncols.

Referenced by columns().

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

Definition at line 73 of file Phase2ITPixelArrayBuffer.h.

References index(), and pixel_vec.

Referenced by Phase2ITPixelArrayBuffer().

73 { return pixel_vec[index(row,col)];}
int index(int row, int col) const
Definition of indexing within the buffer.
col
Definition: cuy.py:1010
int Phase2ITPixelArrayBuffer::operator() ( const Phase2ITPixelCluster::PixelPos pix) const
inline

Definition at line 76 of file Phase2ITPixelArrayBuffer.h.

References index(), and pixel_vec.

76 {return pixel_vec[index(pix)];}
int index(int row, int col) const
Definition of indexing within the buffer.
int Phase2ITPixelArrayBuffer::rows ( ) const
inline

Definition at line 36 of file Phase2ITPixelArrayBuffer.h.

References nrows.

Referenced by setSize().

void Phase2ITPixelArrayBuffer::set_adc ( int  row,
int  col,
int  adc 
)
inline

Definition at line 79 of file Phase2ITPixelArrayBuffer.h.

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

Referenced by columns().

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

Definition at line 85 of file Phase2ITPixelArrayBuffer.h.

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

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

Definition at line 60 of file Phase2ITPixelArrayBuffer.h.

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

Referenced by Phase2ITPixelArrayBuffer().

int Phase2ITPixelArrayBuffer::size ( void  ) const
inline

Definition at line 42 of file Phase2ITPixelArrayBuffer.h.

References pixel_vec.

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

42 { return pixel_vec.size();}

Member Data Documentation

int Phase2ITPixelArrayBuffer::ncols
private

Definition at line 51 of file Phase2ITPixelArrayBuffer.h.

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

int Phase2ITPixelArrayBuffer::nrows
private

Definition at line 50 of file Phase2ITPixelArrayBuffer.h.

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

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

Definition at line 49 of file Phase2ITPixelArrayBuffer.h.

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