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

Definition at line 36 of file Phase2TrackerClusterizerArray.h.

Member Function Documentation

unsigned int Phase2TrackerClusterizerArray::columns ( ) const
inline

Definition at line 65 of file Phase2TrackerClusterizerArray.h.

References ncols_.

65  {
66  return ncols_;
67 }
unsigned int Phase2TrackerClusterizerArray::index ( unsigned int  row,
unsigned int  col 
) const
inline

Definition at line 98 of file Phase2TrackerClusterizerArray.h.

References nrows_.

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

98  {
99  return col * nrows_ + row;
100 }
col
Definition: cuy.py:1008
bool Phase2TrackerClusterizerArray::inside ( unsigned int  row,
unsigned int  col 
) const
inline

Definition at line 73 of file Phase2TrackerClusterizerArray.h.

References ncols_, and nrows_.

Referenced by operator()().

73  {
74  return ( (row < nrows_) & (col < ncols_) );
75 }
col
Definition: cuy.py:1008
int Phase2TrackerClusterizerArray::operator() ( unsigned int  row,
unsigned int  col 
) const
inline

Definition at line 47 of file Phase2TrackerClusterizerArray.h.

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

47  {
48  if (!inside(row, col)) return 0; // FIXME this should go outside: avoid it
49  return matrix_[index(row, col)] ?
50  ( hipmatrix_[index(row, col)] ? 2 : 1 ) : 0;
51 }
unsigned int index(unsigned int, unsigned int) const
bool inside(unsigned int, unsigned int) const
col
Definition: cuy.py:1008
unsigned int Phase2TrackerClusterizerArray::rows ( ) const
inline

Definition at line 57 of file Phase2TrackerClusterizerArray.h.

References nrows_.

57  {
58  return nrows_;
59 }
void Phase2TrackerClusterizerArray::set ( unsigned int  row,
unsigned int  col,
bool  state,
bool  hip 
)
inline

Definition at line 81 of file Phase2TrackerClusterizerArray.h.

References hipmatrix_, index(), and matrix_.

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

81  {
82  matrix_[index(row, col)] = state;
83  hipmatrix_[index(row, col)] = hip;
84 }
unsigned int index(unsigned int, unsigned int) const
col
Definition: cuy.py:1008
unsigned int Phase2TrackerClusterizerArray::size ( void  ) const
inline

Definition at line 90 of file Phase2TrackerClusterizerArray.h.

References matrix_.

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

90  {
91  return matrix_.size();
92 }

Member Data Documentation

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

Definition at line 25 of file Phase2TrackerClusterizerArray.h.

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

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

Definition at line 24 of file Phase2TrackerClusterizerArray.h.

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

unsigned int Phase2TrackerClusterizerArray::ncols_
private

Definition at line 23 of file Phase2TrackerClusterizerArray.h.

Referenced by columns(), and inside().

unsigned int Phase2TrackerClusterizerArray::nrows_
private

Definition at line 23 of file Phase2TrackerClusterizerArray.h.

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