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
 
GlobalPoint global_point (const FTLCluster::FTLHitPos &) const
 
GlobalPoint global_point (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
 
LocalError local_error (const FTLCluster::FTLHitPos &) const
 
LocalError local_error (uint row, uint col) const
 
 MTDArrayBuffer ()
 
 MTDArrayBuffer (uint rows, uint cols)
 
uint rows () const
 
void set (const FTLCluster::FTLHitPos &, GeomDetEnumerators::Location subDet, float energy, float time, float time_error, const LocalError &local_error, const GlobalPoint &global_point)
 
void set (uint row, uint col, GeomDetEnumerators::Location subDet, float energy, float time, float time_error, const LocalError &local_error, const GlobalPoint &global_point)
 
void set_energy (const FTLCluster::FTLHitPos &, float energy)
 
void set_energy (uint row, uint col, float energy)
 
void set_global_point (const FTLCluster::FTLHitPos &, const GlobalPoint &gp)
 
void set_global_point (uint row, uint col, const GlobalPoint &gp)
 
void set_local_error (const FTLCluster::FTLHitPos &, const LocalError &le)
 
void set_local_error (uint row, uint col, const LocalError &le)
 
void set_subDet (const FTLCluster::FTLHitPos &, GeomDetEnumerators::Location subDet)
 
void set_subDet (uint row, uint col, GeomDetEnumerators::Location subDet)
 
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
 
GeomDetEnumerators::Location subDet (const FTLCluster::FTLHitPos &) const
 
GeomDetEnumerators::Location subDet (uint row, uint col) const
 Use subDet to identify whether the Hit is in BTL or ETL. More...
 
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< GlobalPointhitGP_vec
 
std::vector< LocalErrorhitLE_vec
 
std::vector< GeomDetEnumerators::LocationhitSubDet_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 20 of file MTDArrayBuffer.h.

Member Typedef Documentation

◆ uint

typedef unsigned int MTDArrayBuffer::uint

Definition at line 22 of file MTDArrayBuffer.h.

Constructor & Destructor Documentation

◆ MTDArrayBuffer() [1/2]

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

Definition at line 113 of file MTDArrayBuffer.h.

115  hitEnergy_vec(rows * cols, 0),
116  hitTime_vec(rows * cols, 0),
117  hitTimeError_vec(rows * cols, 0),
118  hitGP_vec(rows * cols),
119  hitLE_vec(rows * cols),
120  nrows(rows),
121  ncols(cols) {}

◆ MTDArrayBuffer() [2/2]

MTDArrayBuffer::MTDArrayBuffer ( )
inline

Definition at line 25 of file MTDArrayBuffer.h.

25 {}

Member Function Documentation

◆ add_energy()

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

Definition at line 190 of file MTDArrayBuffer.h.

190 { 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 59 of file MTDArrayBuffer.h.

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

References clear().

Referenced by clear().

◆ clear() [2/2]

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

Definition at line 49 of file MTDArrayBuffer.h.

49  {
50  LocalError le_n(0, 0, 0);
51  GlobalPoint gp_n(0, 0, 0);
53  set_energy(row, col, 0.);
54  set_time(row, col, 0.);
55  set_time_error(row, col, 0.);
56  set_local_error(row, col, le_n);
57  set_global_point(row, col, gp_n);
58  }

References cuy::col, GeomDetEnumerators::invalidLoc, set_energy(), set_global_point(), set_local_error(), set_subDet(), set_time(), and set_time_error().

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

◆ columns()

uint MTDArrayBuffer::columns ( ) const
inline

Definition at line 45 of file MTDArrayBuffer.h.

45 { 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 142 of file MTDArrayBuffer.h.

142 { 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

◆ global_point() [1/2]

GlobalPoint MTDArrayBuffer::global_point ( const FTLCluster::FTLHitPos pix) const
inline

Definition at line 154 of file MTDArrayBuffer.h.

154 { return hitGP_vec[index(pix)]; }

References hitGP_vec, and index().

◆ global_point() [2/2]

GlobalPoint MTDArrayBuffer::global_point ( uint  row,
uint  col 
) const
inline

Definition at line 153 of file MTDArrayBuffer.h.

153 { return hitGP_vec[index(row, col)]; }

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

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

◆ index() [1/2]

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

Definition at line 100 of file MTDArrayBuffer.h.

100 { 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 99 of file MTDArrayBuffer.h.

99 { return col * nrows + row; }

References cuy::col, and nrows.

Referenced by add_energy(), energy(), global_point(), BeautifulSoup.PageElement::insert(), local_error(), set(), set_energy(), set_global_point(), set_local_error(), set_subDet(), set_time(), set_time_error(), subDet(), time(), and time_error().

◆ inside()

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

Definition at line 134 of file MTDArrayBuffer.h.

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

References cuy::col, ncols, and nrows.

◆ local_error() [1/2]

LocalError MTDArrayBuffer::local_error ( const FTLCluster::FTLHitPos pix) const
inline

Definition at line 151 of file MTDArrayBuffer.h.

151 { return hitLE_vec[index(pix)]; }

References hitLE_vec, and index().

◆ local_error() [2/2]

LocalError MTDArrayBuffer::local_error ( uint  row,
uint  col 
) const
inline

Definition at line 150 of file MTDArrayBuffer.h.

150 { return hitLE_vec[index(row, col)]; }

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

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

◆ rows()

uint MTDArrayBuffer::rows ( ) const
inline

Definition at line 44 of file MTDArrayBuffer.h.

44 { return nrows; }

References nrows.

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

◆ set() [1/2]

void MTDArrayBuffer::set ( const FTLCluster::FTLHitPos pix,
GeomDetEnumerators::Location  subDet,
float  energy,
float  time,
float  time_error,
const LocalError local_error,
const GlobalPoint global_point 
)
inline

◆ set() [2/2]

void MTDArrayBuffer::set ( uint  row,
uint  col,
GeomDetEnumerators::Location  subDet,
float  energy,
float  time,
float  time_error,
const LocalError local_error,
const GlobalPoint global_point 
)
inline

◆ set_energy() [1/2]

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

Definition at line 189 of file MTDArrayBuffer.h.

189 { 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 188 of file MTDArrayBuffer.h.

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

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

Referenced by clear().

◆ set_global_point() [1/2]

void MTDArrayBuffer::set_global_point ( const FTLCluster::FTLHitPos pix,
const GlobalPoint gp 
)
inline

Definition at line 203 of file MTDArrayBuffer.h.

203  {
204  hitGP_vec[index(pix)] = gp;
205 }

References runTauDisplay::gp, hitGP_vec, and index().

◆ set_global_point() [2/2]

void MTDArrayBuffer::set_global_point ( uint  row,
uint  col,
const GlobalPoint gp 
)
inline

Definition at line 202 of file MTDArrayBuffer.h.

202 { hitGP_vec[index(row, col)] = gp; }

References cuy::col, runTauDisplay::gp, hitGP_vec, and index().

Referenced by clear().

◆ set_local_error() [1/2]

void MTDArrayBuffer::set_local_error ( const FTLCluster::FTLHitPos pix,
const LocalError le 
)
inline

Definition at line 208 of file MTDArrayBuffer.h.

208  {
209  hitLE_vec[index(pix)] = le;
210 }

References hitLE_vec, and index().

◆ set_local_error() [2/2]

void MTDArrayBuffer::set_local_error ( uint  row,
uint  col,
const LocalError le 
)
inline

Definition at line 207 of file MTDArrayBuffer.h.

207 { hitLE_vec[index(row, col)] = le; }

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

Referenced by clear().

◆ set_subDet() [1/2]

void MTDArrayBuffer::set_subDet ( const FTLCluster::FTLHitPos pix,
GeomDetEnumerators::Location  subDet 
)
inline

Definition at line 184 of file MTDArrayBuffer.h.

184  {
185  hitSubDet_vec[index(pix)] = subDet;
186 }

References hitSubDet_vec, index(), and subDet().

◆ set_subDet() [2/2]

void MTDArrayBuffer::set_subDet ( uint  row,
uint  col,
GeomDetEnumerators::Location  subDet 
)
inline

Definition at line 181 of file MTDArrayBuffer.h.

181  {
182  hitSubDet_vec[index(row, col)] = subDet;
183 }

References cuy::col, hitSubDet_vec, index(), and subDet().

Referenced by clear().

◆ set_time() [1/2]

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

Definition at line 193 of file MTDArrayBuffer.h.

193 { 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 192 of file MTDArrayBuffer.h.

192 { 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 198 of file MTDArrayBuffer.h.

198  {
200 }

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 195 of file MTDArrayBuffer.h.

195  {
197 }

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

Referenced by clear().

◆ setSize()

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

Definition at line 123 of file MTDArrayBuffer.h.

123  {
125  hitEnergy_vec.resize(rows * cols, 0);
126  hitTime_vec.resize(rows * cols, 0);
127  hitTimeError_vec.resize(rows * cols, 0);
128  hitGP_vec.resize(rows * cols);
129  hitLE_vec.resize(rows * cols);
130  nrows = rows;
131  ncols = cols;
132 }

References hitEnergy_vec, hitGP_vec, hitLE_vec, hitSubDet_vec, hitTime_vec, hitTimeError_vec, GeomDetEnumerators::invalidLoc, ncols, nrows, and rows().

Referenced by MTDThresholdClusterizer::setup().

◆ size()

uint MTDArrayBuffer::size ( void  ) const
inline

Definition at line 96 of file MTDArrayBuffer.h.

96 { return hitEnergy_vec.size(); }

References hitEnergy_vec.

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

◆ subDet() [1/2]

GeomDetEnumerators::Location MTDArrayBuffer::subDet ( const FTLCluster::FTLHitPos pix) const
inline

Definition at line 137 of file MTDArrayBuffer.h.

137  {
138  return hitSubDet_vec[index(pix)];
139 }

References hitSubDet_vec, and index().

◆ subDet() [2/2]

GeomDetEnumerators::Location MTDArrayBuffer::subDet ( uint  row,
uint  col 
) const
inline

Use subDet to identify whether the Hit is in BTL or ETL.

Definition at line 136 of file MTDArrayBuffer.h.

136 { return hitSubDet_vec[index(row, col)]; }

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

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

◆ time() [1/2]

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

Definition at line 145 of file MTDArrayBuffer.h.

145 { 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 144 of file MTDArrayBuffer.h.

144 { 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 148 of file MTDArrayBuffer.h.

148 { 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 147 of file MTDArrayBuffer.h.

147 { 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 104 of file MTDArrayBuffer.h.

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

◆ hitGP_vec

std::vector<GlobalPoint> MTDArrayBuffer::hitGP_vec
private

Definition at line 107 of file MTDArrayBuffer.h.

Referenced by global_point(), set(), set_global_point(), and setSize().

◆ hitLE_vec

std::vector<LocalError> MTDArrayBuffer::hitLE_vec
private

Definition at line 108 of file MTDArrayBuffer.h.

Referenced by local_error(), set(), set_local_error(), and setSize().

◆ hitSubDet_vec

std::vector<GeomDetEnumerators::Location> MTDArrayBuffer::hitSubDet_vec
private

Definition at line 103 of file MTDArrayBuffer.h.

Referenced by set(), set_subDet(), setSize(), and subDet().

◆ hitTime_vec

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

Definition at line 105 of file MTDArrayBuffer.h.

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

◆ hitTimeError_vec

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

Definition at line 106 of file MTDArrayBuffer.h.

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

◆ ncols

uint MTDArrayBuffer::ncols
private

Definition at line 110 of file MTDArrayBuffer.h.

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

◆ nrows

uint MTDArrayBuffer::nrows
private

Definition at line 109 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:192
MTDArrayBuffer::set_subDet
void set_subDet(uint row, uint col, GeomDetEnumerators::Location subDet)
Definition: MTDArrayBuffer.h:181
MTDArrayBuffer::hitLE_vec
std::vector< LocalError > hitLE_vec
Definition: MTDArrayBuffer.h:108
cuy.col
col
Definition: cuy.py:1010
pos
Definition: PixelAliasList.h:18
MTDArrayBuffer::rows
uint rows() const
Definition: MTDArrayBuffer.h:44
MTDArrayBuffer::ncols
uint ncols
Definition: MTDArrayBuffer.h:110
MTDArrayBuffer::hitGP_vec
std::vector< GlobalPoint > hitGP_vec
Definition: MTDArrayBuffer.h:107
MTDArrayBuffer::global_point
GlobalPoint global_point(uint row, uint col) const
Definition: MTDArrayBuffer.h:153
MTDArrayBuffer::hitEnergy_vec
std::vector< float > hitEnergy_vec
Definition: MTDArrayBuffer.h:104
MTDArrayBuffer::hitTimeError_vec
std::vector< float > hitTimeError_vec
Definition: MTDArrayBuffer.h:106
FTLCluster::FTLHitPos::row
constexpr int row() const
Definition: FTLCluster.h:62
Point3DBase< float, GlobalTag >
MTDArrayBuffer::time
float time(uint row, uint col) const
Definition: MTDArrayBuffer.h:144
GeomDetEnumerators::invalidLoc
Definition: GeomDetEnumerators.h:9
runTauDisplay.gp
gp
Definition: runTauDisplay.py:431
MTDArrayBuffer::clear
void clear(uint row, uint col)
Definition: MTDArrayBuffer.h:49
LocalError
Definition: LocalError.h:12
MTDArrayBuffer::local_error
LocalError local_error(uint row, uint col) const
Definition: MTDArrayBuffer.h:150
MTDArrayBuffer::energy
float energy(uint row, uint col) const
Definition: MTDArrayBuffer.h:141
MTDArrayBuffer::index
uint index(uint row, uint col) const
Definition of indexing within the buffer.
Definition: MTDArrayBuffer.h:99
MTDArrayBuffer::set_energy
void set_energy(uint row, uint col, float energy)
Definition: MTDArrayBuffer.h:188
MTDArrayBuffer::set
void set(uint row, uint col, GeomDetEnumerators::Location subDet, float energy, float time, float time_error, const LocalError &local_error, const GlobalPoint &global_point)
Definition: MTDArrayBuffer.h:156
MTDArrayBuffer::set_time_error
void set_time_error(uint row, uint col, float time_error)
Definition: MTDArrayBuffer.h:195
MTDArrayBuffer::nrows
uint nrows
Definition: MTDArrayBuffer.h:109
MTDArrayBuffer::hitSubDet_vec
std::vector< GeomDetEnumerators::Location > hitSubDet_vec
Definition: MTDArrayBuffer.h:103
MTDArrayBuffer::set_local_error
void set_local_error(uint row, uint col, const LocalError &le)
Definition: MTDArrayBuffer.h:207
MTDArrayBuffer::time_error
float time_error(uint row, uint col) const
Definition: MTDArrayBuffer.h:147
FTLCluster::FTLHitPos::col
constexpr int col() const
Definition: FTLCluster.h:63
MTDArrayBuffer::set_global_point
void set_global_point(uint row, uint col, const GlobalPoint &gp)
Definition: MTDArrayBuffer.h:202
MTDArrayBuffer::subDet
GeomDetEnumerators::Location subDet(uint row, uint col) const
Use subDet to identify whether the Hit is in BTL or ETL.
Definition: MTDArrayBuffer.h:136
MTDArrayBuffer::hitTime_vec
std::vector< float > hitTime_vec
Definition: MTDArrayBuffer.h:105