#include <RecoLocalTracker/SiPixelClusterizer/interface/SiPixelArrayBuffer.h>
Public Member Functions | |
int | columns () const |
int | index (const SiPixelCluster::PixelPos &pix) const |
int | index (int row, int col) const |
Definition of indexing within the buffer. | |
bool | inside (int row, int col) const |
int | operator() (const SiPixelCluster::PixelPos &) const |
int | operator() (int row, int col) const |
int | rows () const |
void | set_adc (const SiPixelCluster::PixelPos &, int adc) |
void | set_adc (int row, int col, int adc) |
void | setSize (int rows, int cols) |
SiPixelArrayBuffer () | |
SiPixelArrayBuffer (int rows, int cols) | |
int | size () const |
Private Attributes | |
int | ncols |
int | nrows |
std::vector< int > | pixel_vec |
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.
Definition at line 56 of file SiPixelArrayBuffer.h.
00057 : nrows(rows), ncols(cols) 00058 { 00059 pixel_vec.resize(rows*cols); 00060 00061 // TO DO: check this now: 00062 // Some STL implementations have problems with default values 00063 // so a initialization loop is used instead 00064 std::vector<int>::iterator i=pixel_vec.begin(), iend=pixel_vec.end(); 00065 for ( ; i!=iend; ++i) { 00066 *i = 0; 00067 } 00068 }
SiPixelArrayBuffer::SiPixelArrayBuffer | ( | ) | [inline] |
int SiPixelArrayBuffer::columns | ( | ) | const [inline] |
int SiPixelArrayBuffer::index | ( | const SiPixelCluster::PixelPos & | pix | ) | const [inline] |
Definition at line 46 of file SiPixelArrayBuffer.h.
References SiPixelCluster::PixelPos::col(), index(), and SiPixelCluster::PixelPos::row().
Definition of indexing within the buffer.
Definition at line 45 of file SiPixelArrayBuffer.h.
References nrows.
Referenced by index(), operator()(), and set_adc().
int SiPixelArrayBuffer::operator() | ( | const SiPixelCluster::PixelPos & | pix | ) | const [inline] |
Definition at line 102 of file SiPixelArrayBuffer.h.
References SiPixelCluster::PixelPos::col(), index(), inside(), pixel_vec, and SiPixelCluster::PixelPos::row().
00103 { 00104 if (inside( pix.row(), pix.col())) return pixel_vec[index(pix)]; 00105 else return 0; 00106 }
void SiPixelArrayBuffer::set_adc | ( | const SiPixelCluster::PixelPos & | pix, | |
int | adc | |||
) | [inline] |
Definition at line 110 of file SiPixelArrayBuffer.h.
References index(), and pixel_vec.
Referenced by PixelThresholdClusterizer::clear_buffer(), PixelThresholdClusterizer::copy_to_buffer(), and PixelThresholdClusterizer::make_cluster().
Definition at line 71 of file SiPixelArrayBuffer.h.
References i, ncols, nrows, and pixel_vec.
Referenced by PixelThresholdClusterizer::setup().
00072 { 00073 nrows = rows; 00074 ncols = cols; 00075 pixel_vec.resize(rows*cols); 00076 //std::cout << " Resize the clusterize pixel buffer " << (rows*cols) 00077 // << std::endl; 00078 00079 // TO DO: check this now: 00080 // Some STL implementations have problems with default values 00081 // so a initialization loop is used instead 00082 std::vector<int>::iterator i=pixel_vec.begin(), iend=pixel_vec.end(); 00083 for ( ; i!=iend; ++i) { 00084 *i = 0; 00085 } 00086 }
Definition at line 42 of file SiPixelArrayBuffer.h.
References pixel_vec.
00042 { return pixel_vec.size();}
int SiPixelArrayBuffer::ncols [private] |
Definition at line 50 of file SiPixelArrayBuffer.h.
int SiPixelArrayBuffer::nrows [private] |
std::vector<int> SiPixelArrayBuffer::pixel_vec [private] |
Definition at line 51 of file SiPixelArrayBuffer.h.
Referenced by operator()(), set_adc(), setSize(), SiPixelArrayBuffer(), and size().