1 #ifndef DataFormats_HGCDigi_PHGCSimAccumulator_h 2 #define DataFormats_HGCDigi_PHGCSimAccumulator_h 26 assert(
size()+1 < 1<<detIdOffset);
46 Data(
unsigned short ei,
unsigned short si,
unsigned short d):
47 data_((ei << energyOffset) | (si << sampleOffset) | d)
52 unsigned int data()
const {
return data_ & dataMask; }
69 data_.shrink_to_fit();
79 void emplace_back(
unsigned int detId,
unsigned short energyIndex,
unsigned short sampleIndex,
unsigned short data) {
85 data_.emplace_back(energyIndex, sampleIndex, data);
93 unsigned int detId()
const {
return detId_; }
96 unsigned short data()
const {
return data_.data(); }
106 acc_(acc), iDet_(0), iData_(0),
112 acc_(acc), iDet_(detSize), iData_(dataSize), endData_(0)
116 return iDet_ == other.
iDet_ && iData_ == other.
iData_;
123 if(iData_ == endData_) {
125 endData_ += (iDet_ == acc_->detIdSize_.size()) ? 0 : acc_->detIdSize_[iDet_].size();
136 acc_->data_[iData_]);
unsigned short data() const
unsigned int data() const
const PHGCSimAccumulator * acc_
void emplace_back(unsigned int detId, unsigned short energyIndex, unsigned short sampleIndex, unsigned short data)
std::vector< Data > data_
static constexpr unsigned detIdOffset
PHGCSimAccumulator(unsigned int detId)
static const int kSubdetOffset
bool operator!=(const const_iterator &other) const
static constexpr unsigned detIdMask
const_iterator cend() const
const_iterator begin() const
unsigned int energyIndex() const
unsigned int detIdDetails() const
TmpElem(unsigned int detId, Data data)
bool operator==(const QGLikelihoodParameters &lhs, const QGLikelihoodCategory &rhs)
Test if parameters are compatible with category.
~PHGCSimAccumulator()=default
unsigned int size() const
PHGCSimAccumulator()=default
unsigned short detSubdetId_
unsigned int sampleIndex() const
unsigned short sampleIndex() const
const_iterator(const PHGCSimAccumulator *acc)
void reserve(size_t size)
unsigned short energyIndex() const
std::vector< DetIdSize > detIdSize_
static constexpr unsigned sizeMask
const_iterator operator++(int)
std::vector< std::vector< double > > tmp
char data[epos_bytes_allocation]
const_iterator & operator++()
const_iterator cbegin() const
bool operator==(const const_iterator &other) const
unsigned int detId() const
const_iterator(const PHGCSimAccumulator *acc, unsigned int detSize, unsigned int dataSize)
Data(unsigned short ei, unsigned short si, unsigned short d)
DetIdSize(unsigned int detId)
const_iterator end() const
static constexpr unsigned sizeOffset