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 137 of file PHGCSimAccumulator.h.

References detIdSize_, and simhitCollection_.

137 { 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 140 of file PHGCSimAccumulator.h.

References cbegin().

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

◆ cbegin()

const_iterator PHGCSimAccumulator::cbegin ( ) const
inline

Definition at line 139 of file PHGCSimAccumulator.h.

Referenced by begin().

139 { return const_iterator(this); }

◆ cend()

const_iterator PHGCSimAccumulator::cend ( ) const
inline

Definition at line 141 of file PHGCSimAccumulator.h.

References detIdSize_, and simhitCollection_.

Referenced by end().

141 { 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 76 of file PHGCSimAccumulator.h.

References hcalRecHitTable_cff::detId, detIdSize_, simhitCollection_, and ecalMatacq_cfi::timing.

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

◆ end()

const_iterator PHGCSimAccumulator::end ( void  ) const
inline

Definition at line 142 of file PHGCSimAccumulator.h.

References cend().

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

142 { return cend(); }
const_iterator cend() const

◆ reserve()

void PHGCSimAccumulator::reserve ( size_t  size)
inline

Definition at line 67 of file PHGCSimAccumulator.h.

References detIdSize_, simhitCollection_, and findQualityFiles::size.

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

◆ shrink_to_fit()

void PHGCSimAccumulator::shrink_to_fit ( )
inline

Definition at line 71 of file PHGCSimAccumulator.h.

References detIdSize_, and simhitCollection_.

71  {
72  detIdSize_.shrink_to_fit();
73  simhitCollection_.shrink_to_fit();
74  }
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