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

typedef unsigned int MTDArrayBuffer::uint

Definition at line 19 of file MTDArrayBuffer.h.

Constructor & Destructor Documentation

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

Definition at line 76 of file MTDArrayBuffer.h.

77  : hitEnergy_vec(rows*cols,0), hitTime_vec(rows*cols,0), hitTimeError_vec(rows*cols,0), nrows(rows), ncols(cols) {}
uint rows() const
std::vector< float > hitEnergy_vec
std::vector< float > hitTime_vec
std::vector< float > hitTimeError_vec
MTDArrayBuffer::MTDArrayBuffer ( )
inline

Definition at line 22 of file MTDArrayBuffer.h.

References cuy::col, energy(), rows(), setSize(), time(), and time_error().

22 {}

Member Function Documentation

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

Definition at line 120 of file MTDArrayBuffer.h.

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

Referenced by clear().

121 {
122  hitEnergy_vec[index(row,col)] += energy;
123 }
std::vector< float > hitEnergy_vec
float energy(uint row, uint col) const
uint index(uint row, uint col) const
Definition of indexing within the buffer.
col
Definition: cuy.py:1010
void MTDArrayBuffer::clear ( uint  row,
uint  col 
)
inline

Definition at line 38 of file MTDArrayBuffer.h.

References set_energy(), set_time(), and set_time_error().

Referenced by clear().

39  {
40  set_energy( row, col, 0.);
41  set_time( row, col, 0.);
42  set_time_error( row, col, 0.);
43  }
void set_energy(uint row, uint col, float energy)
void set_time(uint row, uint col, float time)
col
Definition: cuy.py:1010
void set_time_error(uint row, uint col, float time_error)
void MTDArrayBuffer::clear ( const FTLCluster::FTLHitPos pos)
inline

Definition at line 44 of file MTDArrayBuffer.h.

References add_energy(), clear(), FTLCluster::FTLHitPos::col(), cuy::col, energy(), FTLCluster::FTLHitPos::row(), set_energy(), set_time(), set_time_error(), time(), and time_error().

45  {
46  clear(pos.row(),pos.col());
47  }
constexpr int row() const
Definition: FTLCluster.h:61
constexpr int col() const
Definition: FTLCluster.h:62
void clear(uint row, uint col)
uint MTDArrayBuffer::columns ( ) const
inline

Definition at line 34 of file MTDArrayBuffer.h.

References inside(), and ncols.

34 { return ncols;}
float MTDArrayBuffer::energy ( uint  row,
uint  col 
) const
inline

Definition at line 92 of file MTDArrayBuffer.h.

References hitEnergy_vec, and index().

Referenced by add_energy(), clear(), MTDArrayBuffer(), Jet.Jet::rawEnergy(), set(), and set_energy().

92 { return hitEnergy_vec[index(row,col)];}
std::vector< float > hitEnergy_vec
uint index(uint row, uint col) const
Definition of indexing within the buffer.
col
Definition: cuy.py:1010
float MTDArrayBuffer::energy ( const FTLCluster::FTLHitPos pix) const
inline

Definition at line 93 of file MTDArrayBuffer.h.

References hitEnergy_vec, and index().

Referenced by Jet.Jet::rawEnergy().

93 {return hitEnergy_vec[index(pix)];}
std::vector< float > hitEnergy_vec
uint index(uint row, uint col) const
Definition of indexing within the buffer.
uint MTDArrayBuffer::index ( uint  row,
uint  col 
) const
inline

Definition of indexing within the buffer.

Definition at line 65 of file MTDArrayBuffer.h.

References nrows.

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

65 {return col*nrows+row;}
col
Definition: cuy.py:1010
uint MTDArrayBuffer::index ( const FTLCluster::FTLHitPos pix) const
inline

Definition at line 66 of file MTDArrayBuffer.h.

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

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

66 { return index(pix.row(), pix.col()); }
constexpr int row() const
Definition: FTLCluster.h:61
uint index(uint row, uint col) const
Definition of indexing within the buffer.
constexpr int col() const
Definition: FTLCluster.h:62
bool MTDArrayBuffer::inside ( uint  row,
uint  col 
) const
inline

Definition at line 87 of file MTDArrayBuffer.h.

References ncols, and nrows.

Referenced by columns().

88 {
89  return ( row < nrows && col < ncols);
90 }
col
Definition: cuy.py:1010
uint MTDArrayBuffer::rows ( ) const
inline

Definition at line 33 of file MTDArrayBuffer.h.

References nrows.

Referenced by MTDArrayBuffer(), and setSize().

33 { return nrows;}
void MTDArrayBuffer::set ( uint  row,
uint  col,
float  energy,
float  time,
float  time_error 
)
inline

Definition at line 101 of file MTDArrayBuffer.h.

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

102 {
103  hitEnergy_vec[index(row,col)] = energy;
104  hitTime_vec[index(row,col)] = time;
106 }
float time_error(uint row, uint col) const
std::vector< float > hitEnergy_vec
float time(uint row, uint col) const
float energy(uint row, uint col) const
std::vector< float > hitTime_vec
uint index(uint row, uint col) const
Definition of indexing within the buffer.
col
Definition: cuy.py:1010
std::vector< float > hitTimeError_vec
void MTDArrayBuffer::set ( const FTLCluster::FTLHitPos pix,
float  energy,
float  time,
float  time_error 
)
inline

Definition at line 107 of file MTDArrayBuffer.h.

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

108 {
109  set( pix.row(), pix.col(), energy, time, time_error);
110 }
float time_error(uint row, uint col) const
float time(uint row, uint col) const
constexpr int row() const
Definition: FTLCluster.h:61
float energy(uint row, uint col) const
constexpr int col() const
Definition: FTLCluster.h:62
void MTDArrayBuffer::set_energy ( uint  row,
uint  col,
float  energy 
)
inline

Definition at line 112 of file MTDArrayBuffer.h.

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

Referenced by clear().

113 {
114  hitEnergy_vec[index(row,col)] = energy;
115 }
std::vector< float > hitEnergy_vec
float energy(uint row, uint col) const
uint index(uint row, uint col) const
Definition of indexing within the buffer.
col
Definition: cuy.py:1010
void MTDArrayBuffer::set_energy ( const FTLCluster::FTLHitPos pix,
float  energy 
)
inline

Definition at line 116 of file MTDArrayBuffer.h.

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

117 {
118  hitEnergy_vec[index(pix)] = energy;
119 }
std::vector< float > hitEnergy_vec
float energy(uint row, uint col) const
uint index(uint row, uint col) const
Definition of indexing within the buffer.
void MTDArrayBuffer::set_time ( uint  row,
uint  col,
float  time 
)
inline

Definition at line 125 of file MTDArrayBuffer.h.

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

Referenced by clear().

126 {
127  hitTime_vec[index(row,col)] = time;
128 }
float time(uint row, uint col) const
std::vector< float > hitTime_vec
uint index(uint row, uint col) const
Definition of indexing within the buffer.
col
Definition: cuy.py:1010
void MTDArrayBuffer::set_time ( const FTLCluster::FTLHitPos pix,
float  time 
)
inline

Definition at line 129 of file MTDArrayBuffer.h.

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

130 {
131  hitTime_vec[index(pix)] = time;
132 }
float time(uint row, uint col) const
std::vector< float > hitTime_vec
uint index(uint row, uint col) const
Definition of indexing within the buffer.
void MTDArrayBuffer::set_time_error ( uint  row,
uint  col,
float  time_error 
)
inline

Definition at line 134 of file MTDArrayBuffer.h.

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

Referenced by clear().

135 {
137 }
float time_error(uint row, uint col) const
uint index(uint row, uint col) const
Definition of indexing within the buffer.
col
Definition: cuy.py:1010
std::vector< float > hitTimeError_vec
void MTDArrayBuffer::set_time_error ( const FTLCluster::FTLHitPos pix,
float  time_error 
)
inline

Definition at line 138 of file MTDArrayBuffer.h.

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

139 {
141 }
float time_error(uint row, uint col) const
uint index(uint row, uint col) const
Definition of indexing within the buffer.
std::vector< float > hitTimeError_vec
void MTDArrayBuffer::setSize ( uint  rows,
uint  cols 
)
inline

Definition at line 79 of file MTDArrayBuffer.h.

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

Referenced by MTDArrayBuffer().

79  {
80  hitEnergy_vec.resize(rows*cols,0);
81  hitTime_vec.resize(rows*cols,0);
82  hitTimeError_vec.resize(rows*cols,0);
83  nrows = rows;
84  ncols = cols;
85 }
uint rows() const
std::vector< float > hitEnergy_vec
std::vector< float > hitTime_vec
std::vector< float > hitTimeError_vec
uint MTDArrayBuffer::size ( void  ) const
inline

Definition at line 62 of file MTDArrayBuffer.h.

References hitEnergy_vec.

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

62 { return hitEnergy_vec.size();}
std::vector< float > hitEnergy_vec
float MTDArrayBuffer::time ( uint  row,
uint  col 
) const
inline

Definition at line 95 of file MTDArrayBuffer.h.

References hitTime_vec, and index().

Referenced by clear(), MTDArrayBuffer(), set(), and set_time().

95 { return hitTime_vec[index(row,col)];}
std::vector< float > hitTime_vec
uint index(uint row, uint col) const
Definition of indexing within the buffer.
col
Definition: cuy.py:1010
float MTDArrayBuffer::time ( const FTLCluster::FTLHitPos pix) const
inline

Definition at line 96 of file MTDArrayBuffer.h.

References hitTime_vec, and index().

96 {return hitTime_vec[index(pix)];}
std::vector< float > hitTime_vec
uint index(uint row, uint col) const
Definition of indexing within the buffer.
float MTDArrayBuffer::time_error ( uint  row,
uint  col 
) const
inline

Definition at line 98 of file MTDArrayBuffer.h.

References hitTimeError_vec, and index().

Referenced by clear(), MTDArrayBuffer(), set(), and set_time_error().

98 { return hitTimeError_vec[index(row,col)];}
uint index(uint row, uint col) const
Definition of indexing within the buffer.
col
Definition: cuy.py:1010
std::vector< float > hitTimeError_vec
float MTDArrayBuffer::time_error ( const FTLCluster::FTLHitPos pix) const
inline

Definition at line 99 of file MTDArrayBuffer.h.

References hitTimeError_vec, and index().

99 {return hitTimeError_vec[index(pix)];}
uint index(uint row, uint col) const
Definition of indexing within the buffer.
std::vector< float > hitTimeError_vec

Member Data Documentation

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

Definition at line 69 of file MTDArrayBuffer.h.

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

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

Definition at line 70 of file MTDArrayBuffer.h.

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

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

Definition at line 71 of file MTDArrayBuffer.h.

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

uint MTDArrayBuffer::ncols
private

Definition at line 73 of file MTDArrayBuffer.h.

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

uint MTDArrayBuffer::nrows
private

Definition at line 72 of file MTDArrayBuffer.h.

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