CMS 3D CMS Logo

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::PHGCSimAccumulator ( )
default

◆ ~PHGCSimAccumulator()

PHGCSimAccumulator::~PHGCSimAccumulator ( )
default

Member Function Documentation

◆ back()

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_

◆ begin()

const_iterator PHGCSimAccumulator::begin ( void  ) const
inline

Definition at line 141 of file PHGCSimAccumulator.h.

References cbegin().

141 { return cbegin(); }
const_iterator cbegin() const

◆ cbegin()

const_iterator PHGCSimAccumulator::cbegin ( ) const
inline

Definition at line 140 of file PHGCSimAccumulator.h.

Referenced by begin().

140 { return const_iterator(this); }

◆ cend()

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_

◆ emplace_back()

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_, simhitCollection_, and ecalMatacq_cfi::timing.

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_

◆ end()

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

◆ reserve()

void PHGCSimAccumulator::reserve ( size_t  size)
inline

Definition at line 68 of file PHGCSimAccumulator.h.

References detIdSize_, simhitCollection_, and findQualityFiles::size.

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

◆ shrink_to_fit()

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

◆ detIdSize_

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

◆ simhitCollection_

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