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() [1/2]

Phase2TrackerClusterizerArray::Phase2TrackerClusterizerArray ( )
inline

Definition at line 29 of file Phase2TrackerClusterizerArray.h.

29 : nrows_(0), ncols_(0) {}

◆ Phase2TrackerClusterizerArray() [2/2]

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

Definition at line 31 of file Phase2TrackerClusterizerArray.h.

32  : nrows_(nrows), ncols_(ncols), matrix_(nrows * ncols, false), hipmatrix_(nrows * ncols, false) {}

Member Function Documentation

◆ columns()

unsigned int Phase2TrackerClusterizerArray::columns ( ) const
inline

Definition at line 54 of file Phase2TrackerClusterizerArray.h.

54 { return ncols_; }

References ncols_.

◆ index()

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

Definition at line 83 of file Phase2TrackerClusterizerArray.h.

83  {
84  return col * nrows_ + row;
85 }

References cuy::col, and nrows_.

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

◆ inside()

bool Phase2TrackerClusterizerArray::inside ( unsigned int  row,
unsigned int  col 
) const
inline

Definition at line 60 of file Phase2TrackerClusterizerArray.h.

60  {
61  return ((row < nrows_) & (col < ncols_));
62 }

References cuy::col, ncols_, and nrows_.

Referenced by operator()().

◆ operator()()

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

Definition at line 38 of file Phase2TrackerClusterizerArray.h.

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 }

References cuy::col, hipmatrix_, index(), inside(), and matrix_.

◆ rows()

unsigned int Phase2TrackerClusterizerArray::rows ( ) const
inline

Definition at line 48 of file Phase2TrackerClusterizerArray.h.

48 { return nrows_; }

References nrows_.

◆ set()

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

Definition at line 68 of file Phase2TrackerClusterizerArray.h.

68  {
69  matrix_[index(row, col)] = state;
70  hipmatrix_[index(row, col)] = hip;
71 }

References cuy::col, hipmatrix_, index(), and matrix_.

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

◆ size()

unsigned int Phase2TrackerClusterizerArray::size ( void  ) const
inline

Definition at line 77 of file Phase2TrackerClusterizerArray.h.

77 { return matrix_.size(); }

References matrix_.

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

Member Data Documentation

◆ hipmatrix_

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

Definition at line 22 of file Phase2TrackerClusterizerArray.h.

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

◆ matrix_

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

Definition at line 21 of file Phase2TrackerClusterizerArray.h.

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

◆ ncols_

unsigned int Phase2TrackerClusterizerArray::ncols_
private

Definition at line 20 of file Phase2TrackerClusterizerArray.h.

Referenced by columns(), and inside().

◆ nrows_

unsigned int Phase2TrackerClusterizerArray::nrows_
private

Definition at line 20 of file Phase2TrackerClusterizerArray.h.

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

hgcalPlots.ncols
ncols
Definition: hgcalPlots.py:105
Phase2TrackerClusterizerArray::ncols_
unsigned int ncols_
Definition: Phase2TrackerClusterizerArray.h:20
Phase2TrackerClusterizerArray::index
unsigned int index(unsigned int, unsigned int) const
Definition: Phase2TrackerClusterizerArray.h:83
Phase2TrackerClusterizerArray::inside
bool inside(unsigned int, unsigned int) const
Definition: Phase2TrackerClusterizerArray.h:60
cuy.col
col
Definition: cuy.py:1010
Phase2TrackerClusterizerArray::hipmatrix_
std::vector< bool > hipmatrix_
Definition: Phase2TrackerClusterizerArray.h:22
Phase2TrackerClusterizerArray::matrix_
std::vector< bool > matrix_
Definition: Phase2TrackerClusterizerArray.h:21
Phase2TrackerClusterizerArray::nrows_
unsigned int nrows_
Definition: Phase2TrackerClusterizerArray.h:20