CMS 3D CMS Logo

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

Class to store ADC counts and times during clustering. More...

#include <MTDArrayBuffer.h>

Public Types

typedef unsigned int uint
 

Public Member Functions

void add_energy (uint row, uint col, float energy)
 
void clear (const FTLCluster::FTLHitPos &pos)
 
void clear (uint row, uint col)
 
uint columns () const
 
float energy (const FTLCluster::FTLHitPos &) const
 
float energy (uint row, uint col) const
 
uint index (const FTLCluster::FTLHitPos &pix) const
 
uint index (uint row, uint col) const
 Definition of indexing within the buffer. More...
 
bool inside (uint row, uint col) const
 
 MTDArrayBuffer ()
 
 MTDArrayBuffer (uint rows, uint cols)
 
uint rows () const
 
void set (const FTLCluster::FTLHitPos &, float energy, float time, float time_error)
 
void set (uint row, uint col, float energy, float time, float time_error)
 
void set_energy (const FTLCluster::FTLHitPos &, float energy)
 
void set_energy (uint row, uint col, float energy)
 
void set_time (const FTLCluster::FTLHitPos &, float time)
 
void set_time (uint row, uint col, float time)
 
void set_time_error (const FTLCluster::FTLHitPos &, float time_error)
 
void set_time_error (uint row, uint col, float time_error)
 
void setSize (uint rows, uint cols)
 
uint size () const
 
float time (const FTLCluster::FTLHitPos &) const
 
float time (uint row, uint col) const
 
float time_error (const FTLCluster::FTLHitPos &) const
 
float time_error (uint row, uint col) const
 

Private Attributes

std::vector< float > hitEnergy_vec
 
std::vector< float > hitTime_vec
 
std::vector< float > hitTimeError_vec
 
uint ncols
 
uint nrows
 

Detailed Description

Class to store ADC counts and times during clustering.

Definition at line 16 of file MTDArrayBuffer.h.

Member Typedef Documentation

◆ uint

typedef unsigned int MTDArrayBuffer::uint

Definition at line 18 of file MTDArrayBuffer.h.

Constructor & Destructor Documentation

◆ MTDArrayBuffer() [1/2]

MTDArrayBuffer::MTDArrayBuffer ( uint  rows,
uint  cols 
)
inline

Definition at line 71 of file MTDArrayBuffer.h.

72  : hitEnergy_vec(rows * cols, 0),
73  hitTime_vec(rows * cols, 0),
74  hitTimeError_vec(rows * cols, 0),
75  nrows(rows),
76  ncols(cols) {}

◆ MTDArrayBuffer() [2/2]

MTDArrayBuffer::MTDArrayBuffer ( )
inline

Definition at line 21 of file MTDArrayBuffer.h.

21 {}

Member Function Documentation

◆ add_energy()

void MTDArrayBuffer::add_energy ( uint  row,
uint  col,
float  energy 
)
inline

Definition at line 108 of file MTDArrayBuffer.h.

108 { hitEnergy_vec[index(row, col)] += energy; }

References cuy::col, energy(), hitEnergy_vec, and index().

◆ clear() [1/2]

void MTDArrayBuffer::clear ( const FTLCluster::FTLHitPos pos)
inline

Definition at line 42 of file MTDArrayBuffer.h.

42 { clear(pos.row(), pos.col()); }

References clear().

Referenced by clear().

◆ clear() [2/2]

void MTDArrayBuffer::clear ( uint  row,
uint  col 
)
inline

Definition at line 37 of file MTDArrayBuffer.h.

37  {
38  set_energy(row, col, 0.);
39  set_time(row, col, 0.);
40  set_time_error(row, col, 0.);
41  }

References cuy::col, set_energy(), set_time(), and set_time_error().

Referenced by MTDThresholdClusterizer::clear_buffer(), and MTDThresholdClusterizer::make_cluster().

◆ columns()

uint MTDArrayBuffer::columns ( ) const
inline

Definition at line 33 of file MTDArrayBuffer.h.

33 { return ncols; }

References ncols.

Referenced by MTDThresholdClusterizer::make_cluster(), and MTDThresholdClusterizer::setup().

◆ energy() [1/2]

float MTDArrayBuffer::energy ( const FTLCluster::FTLHitPos pix) const
inline

Definition at line 89 of file MTDArrayBuffer.h.

89 { return hitEnergy_vec[index(pix)]; }

References hitEnergy_vec, and index().

Referenced by Jet.Jet::rawEnergy().

◆ energy() [2/2]

float MTDArrayBuffer::energy ( uint  row,
uint  col 
) const
inline

◆ index() [1/2]

uint MTDArrayBuffer::index ( const FTLCluster::FTLHitPos pix) const
inline

Definition at line 61 of file MTDArrayBuffer.h.

61 { return index(pix.row(), pix.col()); }

References FTLCluster::FTLHitPos::col(), index(), and FTLCluster::FTLHitPos::row().

Referenced by index(), and BeautifulSoup.PageElement::insert().

◆ index() [2/2]

uint MTDArrayBuffer::index ( uint  row,
uint  col 
) const
inline

Definition of indexing within the buffer.

Definition at line 60 of file MTDArrayBuffer.h.

60 { return col * nrows + row; }

References cuy::col, and nrows.

Referenced by add_energy(), energy(), BeautifulSoup.PageElement::insert(), set(), set_energy(), set_time(), set_time_error(), time(), and time_error().

◆ inside()

bool MTDArrayBuffer::inside ( uint  row,
uint  col 
) const
inline

Definition at line 86 of file MTDArrayBuffer.h.

86 { return (row < nrows && col < ncols); }

References cuy::col, ncols, and nrows.

◆ rows()

uint MTDArrayBuffer::rows ( ) const
inline

Definition at line 32 of file MTDArrayBuffer.h.

32 { return nrows; }

References nrows.

Referenced by MTDThresholdClusterizer::make_cluster(), setSize(), and MTDThresholdClusterizer::setup().

◆ set() [1/2]

void MTDArrayBuffer::set ( const FTLCluster::FTLHitPos pix,
float  energy,
float  time,
float  time_error 
)
inline

Definition at line 102 of file MTDArrayBuffer.h.

102  {
103  set(pix.row(), pix.col(), energy, time, time_error);
104 }

References FTLCluster::FTLHitPos::col(), energy(), FTLCluster::FTLHitPos::row(), set(), time(), and time_error().

◆ set() [2/2]

void MTDArrayBuffer::set ( uint  row,
uint  col,
float  energy,
float  time,
float  time_error 
)
inline

Definition at line 97 of file MTDArrayBuffer.h.

97  {
98  hitEnergy_vec[index(row, col)] = energy;
99  hitTime_vec[index(row, col)] = time;
101 }

References cuy::col, energy(), hitEnergy_vec, hitTime_vec, hitTimeError_vec, index(), time(), and time_error().

Referenced by MTDThresholdClusterizer::copy_to_buffer(), and set().

◆ set_energy() [1/2]

void MTDArrayBuffer::set_energy ( const FTLCluster::FTLHitPos pix,
float  energy 
)
inline

Definition at line 107 of file MTDArrayBuffer.h.

107 { hitEnergy_vec[index(pix)] = energy; }

References energy(), hitEnergy_vec, and index().

◆ set_energy() [2/2]

void MTDArrayBuffer::set_energy ( uint  row,
uint  col,
float  energy 
)
inline

Definition at line 106 of file MTDArrayBuffer.h.

106 { hitEnergy_vec[index(row, col)] = energy; }

References cuy::col, energy(), hitEnergy_vec, and index().

Referenced by clear().

◆ set_time() [1/2]

void MTDArrayBuffer::set_time ( const FTLCluster::FTLHitPos pix,
float  time 
)
inline

Definition at line 111 of file MTDArrayBuffer.h.

111 { hitTime_vec[index(pix)] = time; }

References hitTime_vec, index(), and time().

◆ set_time() [2/2]

void MTDArrayBuffer::set_time ( uint  row,
uint  col,
float  time 
)
inline

Definition at line 110 of file MTDArrayBuffer.h.

110 { hitTime_vec[index(row, col)] = time; }

References cuy::col, hitTime_vec, index(), and time().

Referenced by clear().

◆ set_time_error() [1/2]

void MTDArrayBuffer::set_time_error ( const FTLCluster::FTLHitPos pix,
float  time_error 
)
inline

Definition at line 116 of file MTDArrayBuffer.h.

116  {
118 }

References hitTimeError_vec, index(), and time_error().

◆ set_time_error() [2/2]

void MTDArrayBuffer::set_time_error ( uint  row,
uint  col,
float  time_error 
)
inline

Definition at line 113 of file MTDArrayBuffer.h.

113  {
115 }

References cuy::col, hitTimeError_vec, index(), and time_error().

Referenced by clear().

◆ setSize()

void MTDArrayBuffer::setSize ( uint  rows,
uint  cols 
)
inline

Definition at line 78 of file MTDArrayBuffer.h.

78  {
79  hitEnergy_vec.resize(rows * cols, 0);
80  hitTime_vec.resize(rows * cols, 0);
81  hitTimeError_vec.resize(rows * cols, 0);
82  nrows = rows;
83  ncols = cols;
84 }

References hitEnergy_vec, hitTime_vec, hitTimeError_vec, ncols, nrows, and rows().

Referenced by MTDThresholdClusterizer::setup().

◆ size()

uint MTDArrayBuffer::size ( void  ) const
inline

Definition at line 57 of file MTDArrayBuffer.h.

57 { return hitEnergy_vec.size(); }

References hitEnergy_vec.

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

◆ time() [1/2]

float MTDArrayBuffer::time ( const FTLCluster::FTLHitPos pix) const
inline

Definition at line 92 of file MTDArrayBuffer.h.

92 { return hitTime_vec[index(pix)]; }

References hitTime_vec, and index().

◆ time() [2/2]

float MTDArrayBuffer::time ( uint  row,
uint  col 
) const
inline

Definition at line 91 of file MTDArrayBuffer.h.

91 { return hitTime_vec[index(row, col)]; }

References cuy::col, hitTime_vec, and index().

Referenced by MTDThresholdClusterizer::make_cluster(), set(), and set_time().

◆ time_error() [1/2]

float MTDArrayBuffer::time_error ( const FTLCluster::FTLHitPos pix) const
inline

Definition at line 95 of file MTDArrayBuffer.h.

95 { return hitTimeError_vec[index(pix)]; }

References hitTimeError_vec, and index().

◆ time_error() [2/2]

float MTDArrayBuffer::time_error ( uint  row,
uint  col 
) const
inline

Definition at line 94 of file MTDArrayBuffer.h.

94 { return hitTimeError_vec[index(row, col)]; }

References cuy::col, hitTimeError_vec, and index().

Referenced by MTDThresholdClusterizer::make_cluster(), set(), and set_time_error().

Member Data Documentation

◆ hitEnergy_vec

std::vector<float> MTDArrayBuffer::hitEnergy_vec
private

Definition at line 64 of file MTDArrayBuffer.h.

Referenced by add_energy(), energy(), set(), set_energy(), setSize(), and size().

◆ hitTime_vec

std::vector<float> MTDArrayBuffer::hitTime_vec
private

Definition at line 65 of file MTDArrayBuffer.h.

Referenced by set(), set_time(), setSize(), and time().

◆ hitTimeError_vec

std::vector<float> MTDArrayBuffer::hitTimeError_vec
private

Definition at line 66 of file MTDArrayBuffer.h.

Referenced by set(), set_time_error(), setSize(), and time_error().

◆ ncols

uint MTDArrayBuffer::ncols
private

Definition at line 68 of file MTDArrayBuffer.h.

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

◆ nrows

uint MTDArrayBuffer::nrows
private

Definition at line 67 of file MTDArrayBuffer.h.

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

MTDArrayBuffer::set_time
void set_time(uint row, uint col, float time)
Definition: MTDArrayBuffer.h:110
MTDArrayBuffer::set
void set(uint row, uint col, float energy, float time, float time_error)
Definition: MTDArrayBuffer.h:97
cuy.col
col
Definition: cuy.py:1010
pos
Definition: PixelAliasList.h:18
MTDArrayBuffer::rows
uint rows() const
Definition: MTDArrayBuffer.h:32
MTDArrayBuffer::ncols
uint ncols
Definition: MTDArrayBuffer.h:68
MTDArrayBuffer::hitEnergy_vec
std::vector< float > hitEnergy_vec
Definition: MTDArrayBuffer.h:64
MTDArrayBuffer::hitTimeError_vec
std::vector< float > hitTimeError_vec
Definition: MTDArrayBuffer.h:66
FTLCluster::FTLHitPos::row
constexpr int row() const
Definition: FTLCluster.h:62
MTDArrayBuffer::time
float time(uint row, uint col) const
Definition: MTDArrayBuffer.h:91
MTDArrayBuffer::clear
void clear(uint row, uint col)
Definition: MTDArrayBuffer.h:37
MTDArrayBuffer::energy
float energy(uint row, uint col) const
Definition: MTDArrayBuffer.h:88
MTDArrayBuffer::index
uint index(uint row, uint col) const
Definition of indexing within the buffer.
Definition: MTDArrayBuffer.h:60
MTDArrayBuffer::set_energy
void set_energy(uint row, uint col, float energy)
Definition: MTDArrayBuffer.h:106
MTDArrayBuffer::set_time_error
void set_time_error(uint row, uint col, float time_error)
Definition: MTDArrayBuffer.h:113
MTDArrayBuffer::nrows
uint nrows
Definition: MTDArrayBuffer.h:67
MTDArrayBuffer::time_error
float time_error(uint row, uint col) const
Definition: MTDArrayBuffer.h:94
FTLCluster::FTLHitPos::col
constexpr int col() const
Definition: FTLCluster.h:63
MTDArrayBuffer::hitTime_vec
std::vector< float > hitTime_vec
Definition: MTDArrayBuffer.h:65