CMS 3D CMS Logo

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

#include <Phase2TrackerClusterizerArray.h>

Public Member Functions

unsigned int columns () const
 
unsigned int index (unsigned int, unsigned int) const
 
bool inside (unsigned int, unsigned int) const
 
int operator() (unsigned int, unsigned int) const
 
 Phase2TrackerClusterizerArray ()
 
 Phase2TrackerClusterizerArray (unsigned int, unsigned int)
 
unsigned int rows () const
 
void set (unsigned int, unsigned int, bool, bool)
 
unsigned int size () const
 

Private Attributes

std::vector< bool > hipmatrix_
 
std::vector< bool > matrix_
 
unsigned int ncols_
 
unsigned int nrows_
 

Detailed Description

Definition at line 6 of file Phase2TrackerClusterizerArray.h.

Constructor & Destructor Documentation

Phase2TrackerClusterizerArray::Phase2TrackerClusterizerArray ( )
inline
Phase2TrackerClusterizerArray::Phase2TrackerClusterizerArray ( unsigned int  nrows,
unsigned int  ncols 
)
inline

Member Function Documentation

unsigned int Phase2TrackerClusterizerArray::columns ( ) const
inline

Definition at line 54 of file Phase2TrackerClusterizerArray.h.

References ncols_.

unsigned int Phase2TrackerClusterizerArray::index ( unsigned int  row,
unsigned int  col 
) const
inline

Definition at line 83 of file Phase2TrackerClusterizerArray.h.

References nrows_.

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

83  {
84  return col * nrows_ + row;
85 }
col
Definition: cuy.py:1010
bool Phase2TrackerClusterizerArray::inside ( unsigned int  row,
unsigned int  col 
) const
inline

Definition at line 60 of file Phase2TrackerClusterizerArray.h.

References ncols_, and nrows_.

Referenced by operator()().

60  {
61  return ((row < nrows_) & (col < ncols_));
62 }
col
Definition: cuy.py:1010
int Phase2TrackerClusterizerArray::operator() ( unsigned int  row,
unsigned int  col 
) const
inline

Definition at line 38 of file Phase2TrackerClusterizerArray.h.

References hipmatrix_, index(), inside(), and matrix_.

38  {
39  if (!inside(row, col))
40  return 0; // FIXME this should go outside: avoid it
41  return matrix_[index(row, col)] ? (hipmatrix_[index(row, col)] ? 2 : 1) : 0;
42 }
unsigned int index(unsigned int, unsigned int) const
bool inside(unsigned int, unsigned int) const
col
Definition: cuy.py:1010
unsigned int Phase2TrackerClusterizerArray::rows ( ) const
inline

Definition at line 48 of file Phase2TrackerClusterizerArray.h.

References nrows_.

void Phase2TrackerClusterizerArray::set ( unsigned int  row,
unsigned int  col,
bool  state,
bool  hip 
)
inline

Definition at line 68 of file Phase2TrackerClusterizerArray.h.

References hipmatrix_, index(), and matrix_.

Referenced by Phase2TrackerClusterizerAlgorithm::clearMatrix(), and Phase2TrackerClusterizerAlgorithm::fillMatrix().

68  {
69  matrix_[index(row, col)] = state;
70  hipmatrix_[index(row, col)] = hip;
71 }
unsigned int index(unsigned int, unsigned int) const
col
Definition: cuy.py:1010
unsigned int Phase2TrackerClusterizerArray::size ( void  ) const
inline

Member Data Documentation

std::vector<bool> Phase2TrackerClusterizerArray::hipmatrix_
private

Definition at line 22 of file Phase2TrackerClusterizerArray.h.

Referenced by operator()(), and set().

std::vector<bool> Phase2TrackerClusterizerArray::matrix_
private

Definition at line 21 of file Phase2TrackerClusterizerArray.h.

Referenced by operator()(), set(), and size().

unsigned int Phase2TrackerClusterizerArray::ncols_
private

Definition at line 20 of file Phase2TrackerClusterizerArray.h.

Referenced by columns(), and inside().

unsigned int Phase2TrackerClusterizerArray::nrows_
private

Definition at line 20 of file Phase2TrackerClusterizerArray.h.

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