CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 ( )
default
PMTDSimAccumulator::~PMTDSimAccumulator ( )
default

Member Function Documentation

TmpElem PMTDSimAccumulator::back ( ) const
inline

Definition at line 139 of file PMTDSimAccumulator.h.

References data_, and detIdSize_.

139  {
140  const auto& id = detIdSize_.back();
141  return TmpElem(id.detId(), id.row(), id.column(), data_.back());
142  }
std::vector< Data > data_
std::vector< DetIdSize > detIdSize_
const_iterator PMTDSimAccumulator::begin ( void  ) const
inline

Definition at line 145 of file PMTDSimAccumulator.h.

References cbegin().

145 { return cbegin(); }
const_iterator cbegin() const
const_iterator PMTDSimAccumulator::cbegin ( ) const
inline

Definition at line 144 of file PMTDSimAccumulator.h.

Referenced by begin().

144 { return const_iterator(this); }
const_iterator PMTDSimAccumulator::cend ( ) const
inline

Definition at line 146 of file PMTDSimAccumulator.h.

References data_, and detIdSize_.

Referenced by end().

146 { return const_iterator(this, detIdSize_.size(), data_.size()); }
std::vector< Data > data_
std::vector< DetIdSize > detIdSize_
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.

References data_, and detIdSize_.

Referenced by mtd_digitizer::saveSimHitAccumulator().

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  }
std::vector< Data > data_
std::vector< DetIdSize > detIdSize_
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
const_iterator PMTDSimAccumulator::end ( void  ) const
inline

Definition at line 147 of file PMTDSimAccumulator.h.

References cend().

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

147 { return cend(); }
const_iterator cend() const
void PMTDSimAccumulator::reserve ( size_t  size)
inline

Definition at line 52 of file PMTDSimAccumulator.h.

References data_, and detIdSize_.

Referenced by mtd_digitizer::saveSimHitAccumulator().

52  {
53  detIdSize_.reserve(size);
54  data_.reserve(size);
55  }
std::vector< Data > data_
std::vector< DetIdSize > detIdSize_
tuple size
Write out results.
void PMTDSimAccumulator::shrink_to_fit ( )
inline

Definition at line 57 of file PMTDSimAccumulator.h.

References data_, and detIdSize_.

57  {
58  detIdSize_.shrink_to_fit();
59  data_.shrink_to_fit();
60  }
std::vector< Data > data_
std::vector< DetIdSize > detIdSize_

Member Data Documentation

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