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
PHGCSimAccumulator Class Reference

#include <PHGCSimAccumulator.h>

Classes

class  const_iterator
 
class  DetIdSize
 
class  SimHitCollection
 
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 short sampleIndex, const std::vector< unsigned short > &accCharge, const std::vector< unsigned short > &timing)
 
const_iterator end () const
 
 PHGCSimAccumulator ()=default
 
void reserve (size_t size)
 
void shrink_to_fit ()
 
 ~PHGCSimAccumulator ()=default
 

Private Attributes

std::vector< DetIdSizedetIdSize_
 
std::vector< SimHitCollectionsimhitCollection_
 

Detailed Description

Definition at line 8 of file PHGCSimAccumulator.h.

Constructor & Destructor Documentation

PHGCSimAccumulator::PHGCSimAccumulator ( )
default
PHGCSimAccumulator::~PHGCSimAccumulator ( )
default

Member Function Documentation

TmpElem PHGCSimAccumulator::back ( ) const
inline

Definition at line 138 of file PHGCSimAccumulator.h.

References detIdSize_, and simhitCollection_.

138 { return TmpElem(detIdSize_.back().detId(), simhitCollection_.back()); }
std::vector< SimHitCollection > simhitCollection_
std::vector< DetIdSize > detIdSize_
const_iterator PHGCSimAccumulator::begin ( void  ) const
inline

Definition at line 141 of file PHGCSimAccumulator.h.

References cbegin().

141 { return cbegin(); }
const_iterator cbegin() const
const_iterator PHGCSimAccumulator::cbegin ( ) const
inline

Definition at line 140 of file PHGCSimAccumulator.h.

Referenced by begin().

140 { return const_iterator(this); }
const_iterator PHGCSimAccumulator::cend ( ) const
inline

Definition at line 142 of file PHGCSimAccumulator.h.

References detIdSize_, and simhitCollection_.

Referenced by end().

142 { return const_iterator(this, detIdSize_.size(), simhitCollection_.size()); }
std::vector< SimHitCollection > simhitCollection_
std::vector< DetIdSize > detIdSize_
void PHGCSimAccumulator::emplace_back ( unsigned int  detId,
unsigned short  sampleIndex,
const std::vector< unsigned short > &  accCharge,
const std::vector< unsigned short > &  timing 
)
inline

Definition at line 77 of file PHGCSimAccumulator.h.

References detIdSize_, and simhitCollection_.

80  {
81  if (detIdSize_.empty() || detIdSize_.back().detId() != detId) {
82  detIdSize_.emplace_back(detId);
83  }
84  simhitCollection_.emplace_back(sampleIndex, accCharge, timing);
85  detIdSize_.back().increaseSize();
86  }
std::vector< SimHitCollection > simhitCollection_
std::vector< DetIdSize > detIdSize_
const_iterator PHGCSimAccumulator::end ( void  ) const
inline

Definition at line 143 of file PHGCSimAccumulator.h.

References cend().

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

143 { return cend(); }
const_iterator cend() const
void PHGCSimAccumulator::reserve ( size_t  size)
inline

Definition at line 68 of file PHGCSimAccumulator.h.

References detIdSize_, and simhitCollection_.

68  {
69  detIdSize_.reserve(size);
70  simhitCollection_.reserve(size);
71  }
std::vector< SimHitCollection > simhitCollection_
std::vector< DetIdSize > detIdSize_
tuple size
Write out results.
void PHGCSimAccumulator::shrink_to_fit ( )
inline

Definition at line 72 of file PHGCSimAccumulator.h.

References detIdSize_, and simhitCollection_.

72  {
73  detIdSize_.shrink_to_fit();
74  simhitCollection_.shrink_to_fit();
75  }
std::vector< SimHitCollection > simhitCollection_
std::vector< DetIdSize > detIdSize_

Member Data Documentation

std::vector<DetIdSize> PHGCSimAccumulator::detIdSize_
private
std::vector<SimHitCollection> PHGCSimAccumulator::simhitCollection_
private