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.

138 { return TmpElem(detIdSize_.back().detId(), simhitCollection_.back()); }

References detIdSize_, and simhitCollection_.

◆ begin()

const_iterator PHGCSimAccumulator::begin ( void  ) const
inline

Definition at line 141 of file PHGCSimAccumulator.h.

141 { return cbegin(); }

References cbegin().

◆ cbegin()

const_iterator PHGCSimAccumulator::cbegin ( ) const
inline

Definition at line 140 of file PHGCSimAccumulator.h.

140 { return const_iterator(this); }

Referenced by begin().

◆ cend()

const_iterator PHGCSimAccumulator::cend ( ) const
inline

Definition at line 142 of file PHGCSimAccumulator.h.

142 { return const_iterator(this, detIdSize_.size(), simhitCollection_.size()); }

References detIdSize_, and simhitCollection_.

Referenced by end().

◆ 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.

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  }

References detIdSize_, simhitCollection_, and ecalMatacq_cfi::timing.

◆ end()

const_iterator PHGCSimAccumulator::end ( void  ) const
inline

Definition at line 143 of file PHGCSimAccumulator.h.

143 { return cend(); }

References cend().

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

◆ reserve()

void PHGCSimAccumulator::reserve ( size_t  size)
inline

Definition at line 68 of file PHGCSimAccumulator.h.

68  {
69  detIdSize_.reserve(size);
70  simhitCollection_.reserve(size);
71  }

References detIdSize_, simhitCollection_, and findQualityFiles::size.

◆ shrink_to_fit()

void PHGCSimAccumulator::shrink_to_fit ( )
inline

Definition at line 72 of file PHGCSimAccumulator.h.

72  {
73  detIdSize_.shrink_to_fit();
74  simhitCollection_.shrink_to_fit();
75  }

References detIdSize_, and simhitCollection_.

Member Data Documentation

◆ detIdSize_

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

◆ simhitCollection_

std::vector<SimHitCollection> PHGCSimAccumulator::simhitCollection_
private
PHGCSimAccumulator::detIdSize_
std::vector< DetIdSize > detIdSize_
Definition: PHGCSimAccumulator.h:146
PHGCSimAccumulator::cbegin
const_iterator cbegin() const
Definition: PHGCSimAccumulator.h:140
PHGCSimAccumulator::simhitCollection_
std::vector< SimHitCollection > simhitCollection_
Definition: PHGCSimAccumulator.h:147
PHGCSimAccumulator::cend
const_iterator cend() const
Definition: PHGCSimAccumulator.h:142
ecalMatacq_cfi.timing
timing
Definition: ecalMatacq_cfi.py:26
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443