CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
 
bool operator() (unsigned int, unsigned int) const
 
 Phase2TrackerClusterizerArray ()
 
 Phase2TrackerClusterizerArray (unsigned int, unsigned int)
 
unsigned int rows () const
 
void set (unsigned int, unsigned int, bool)
 
void setSize (unsigned int, unsigned int)
 
unsigned int size () const
 

Private Attributes

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 ( )
Phase2TrackerClusterizerArray::Phase2TrackerClusterizerArray ( unsigned int  nrows,
unsigned int  ncols 
)

Definition at line 9 of file Phase2TrackerClusterizerArray.cc.

References setSize().

9  {
10  setSize(nrows, ncols);
11 }
void setSize(unsigned int, unsigned int)

Member Function Documentation

unsigned int Phase2TrackerClusterizerArray::columns ( ) const

Definition at line 45 of file Phase2TrackerClusterizerArray.cc.

References ncols_.

45  {
46  return ncols_;
47 }
unsigned int Phase2TrackerClusterizerArray::index ( unsigned int  row,
unsigned int  col 
) const

Definition at line 77 of file Phase2TrackerClusterizerArray.cc.

References nrows_.

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

77  {
78  return col * nrows_ + row;
79 }
int col
Definition: cuy.py:1008
bool Phase2TrackerClusterizerArray::inside ( unsigned int  row,
unsigned int  col 
) const

Definition at line 53 of file Phase2TrackerClusterizerArray.cc.

References ncols_, and nrows_.

Referenced by operator()().

53  {
54  return (row < nrows_ && col < ncols_);
55 }
int col
Definition: cuy.py:1008
bool Phase2TrackerClusterizerArray::operator() ( unsigned int  row,
unsigned int  col 
) const

Definition at line 28 of file Phase2TrackerClusterizerArray.cc.

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

28  {
29  if (inside(row, col)) return matrix_[index(row, col)];
30  else return false;
31 }
unsigned int index(unsigned int, unsigned int) const
bool inside(unsigned int, unsigned int) const
int col
Definition: cuy.py:1008
unsigned int Phase2TrackerClusterizerArray::rows ( ) const

Definition at line 37 of file Phase2TrackerClusterizerArray.cc.

References nrows_.

37  {
38  return nrows_;
39 }
void Phase2TrackerClusterizerArray::set ( unsigned int  row,
unsigned int  col,
bool  state 
)
void Phase2TrackerClusterizerArray::setSize ( unsigned int  nrows,
unsigned int  ncols 
)

Definition at line 17 of file Phase2TrackerClusterizerArray.cc.

References matrix_, ncols_, and nrows_.

Referenced by Phase2TrackerClusterizerArray(), and Phase2TrackerClusterizerAlgorithm::setup().

17  {
18  nrows_ = nrows;
19  ncols_ = ncols;
20  matrix_.resize(nrows * ncols);
21  for (std::vector< bool >::iterator it(matrix_.begin()); it != matrix_.end(); ++it) *it = false;
22 }
unsigned int Phase2TrackerClusterizerArray::size ( void  ) const

Definition at line 69 of file Phase2TrackerClusterizerArray.cc.

References matrix_.

69  {
70  return matrix_.size();
71 }

Member Data Documentation

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

Definition at line 24 of file Phase2TrackerClusterizerArray.h.

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

unsigned int Phase2TrackerClusterizerArray::ncols_
private

Definition at line 23 of file Phase2TrackerClusterizerArray.h.

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

unsigned int Phase2TrackerClusterizerArray::nrows_
private

Definition at line 23 of file Phase2TrackerClusterizerArray.h.

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