CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Attributes
PMTDSimAccumulator Class Reference

#include <PMTDSimAccumulator.h>

Classes

class  const_iterator
 
class  Data
 
class  DetIdSize
 
class  TmpElem
 

Public Member Functions

TmpElem back () const
 
const_iterator begin () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 
void emplace_back (unsigned int detId, unsigned char row, unsigned char column, unsigned short energyIndex, unsigned short sampleIndex, unsigned short data)
 
const_iterator end () const
 
 PMTDSimAccumulator ()=default
 
void reserve (size_t size)
 
void shrink_to_fit ()
 
 ~PMTDSimAccumulator ()=default
 

Private Attributes

std::vector< Datadata_
 
std::vector< DetIdSizedetIdSize_
 

Detailed Description

Definition at line 9 of file PMTDSimAccumulator.h.

Constructor & Destructor Documentation

◆ PMTDSimAccumulator()

PMTDSimAccumulator::PMTDSimAccumulator ( )
default

◆ ~PMTDSimAccumulator()

PMTDSimAccumulator::~PMTDSimAccumulator ( )
default

Member Function Documentation

◆ back()

TmpElem PMTDSimAccumulator::back ( ) const
inline

Definition at line 139 of file PMTDSimAccumulator.h.

139  {
140  const auto& id = detIdSize_.back();
141  return TmpElem(id.detId(), id.row(), id.column(), data_.back());
142  }

References data_, and detIdSize_.

◆ begin()

const_iterator PMTDSimAccumulator::begin ( void  ) const
inline

Definition at line 145 of file PMTDSimAccumulator.h.

145 { return cbegin(); }

References cbegin().

◆ cbegin()

const_iterator PMTDSimAccumulator::cbegin ( ) const
inline

Definition at line 144 of file PMTDSimAccumulator.h.

144 { return const_iterator(this); }

Referenced by begin().

◆ cend()

const_iterator PMTDSimAccumulator::cend ( ) const
inline

Definition at line 146 of file PMTDSimAccumulator.h.

146 { return const_iterator(this, detIdSize_.size(), data_.size()); }

References data_, and detIdSize_.

Referenced by end().

◆ emplace_back()

void PMTDSimAccumulator::emplace_back ( unsigned int  detId,
unsigned char  row,
unsigned char  column,
unsigned short  energyIndex,
unsigned short  sampleIndex,
unsigned short  data 
)
inline

Adds data for a given detId, energyIndex, and sampleIndex.

It is the caller's responsibility to ensure that energyIndex, sampleIndex, and data fit in the space reserved for them in the Data bitfield above.

Definition at line 69 of file PMTDSimAccumulator.h.

74  {
75  if (detIdSize_.empty() || detIdSize_.back().detId() != detId || detIdSize_.back().row() != row ||
76  detIdSize_.back().column() != column) {
77  detIdSize_.emplace_back(detId, row, column);
78  }
79  data_.emplace_back(energyIndex, sampleIndex, data);
80  detIdSize_.back().increaseSize();
81  }

References data, data_, and detIdSize_.

Referenced by mtd_digitizer::saveSimHitAccumulator().

◆ end()

const_iterator PMTDSimAccumulator::end ( void  ) const
inline

Definition at line 147 of file PMTDSimAccumulator.h.

147 { return cend(); }

References cend().

Referenced by Types.LuminosityBlockRange::cppID(), and Types.EventRange::cppID().

◆ reserve()

void PMTDSimAccumulator::reserve ( size_t  size)
inline

Definition at line 52 of file PMTDSimAccumulator.h.

52  {
53  detIdSize_.reserve(size);
54  data_.reserve(size);
55  }

References data_, detIdSize_, and findQualityFiles::size.

Referenced by mtd_digitizer::saveSimHitAccumulator().

◆ shrink_to_fit()

void PMTDSimAccumulator::shrink_to_fit ( )
inline

Definition at line 57 of file PMTDSimAccumulator.h.

57  {
58  detIdSize_.shrink_to_fit();
59  data_.shrink_to_fit();
60  }

References data_, and detIdSize_.

Member Data Documentation

◆ data_

std::vector<Data> PMTDSimAccumulator::data_
private

◆ detIdSize_

std::vector<DetIdSize> PMTDSimAccumulator::detIdSize_
private
PMTDSimAccumulator::data_
std::vector< Data > data_
Definition: PMTDSimAccumulator.h:151
PMTDSimAccumulator::detIdSize_
std::vector< DetIdSize > detIdSize_
Definition: PMTDSimAccumulator.h:150
PMTDSimAccumulator::cbegin
const_iterator cbegin() const
Definition: PMTDSimAccumulator.h:144
PMTDSimAccumulator::cend
const_iterator cend() const
Definition: PMTDSimAccumulator.h:146
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443