1 #ifndef CondFormats_HGCalObjects_interface_HGCalDenseIndexerBase_h 2 #define CondFormats_HGCalObjects_interface_HGCalDenseIndexerBase_h 25 maxIdx_ = std::accumulate(
vmax_.begin(),
vmax_.end(), 1, std::multiplies<uint32_t>());
30 for (
size_t i = 1;
i <
n_;
i++)
36 std::vector<uint32_t> codes(
n_, 0);
38 const auto rend =
vmax_.rend();
39 for (
auto rit =
vmax_.rbegin(); rit != rend; ++rit) {
40 size_t i = rend - rit - 1;
41 codes[
i] = rtn % (*rit);
53 void check(
size_t osize)
const {
55 throw cms::Exception(
"ValueError") <<
" unable to update indexer max values. Expected " <<
n_ <<
" received "
std::vector< uint32_t > unpackDenseIndex(uint32_t rtn) const
uint32_t getMaxIndex() const
HGCalDenseIndexerBase(int n)
void check(size_t osize) const
this is a simple class that takes care of building a dense index for a set of categories the maximum ...
~HGCalDenseIndexerBase()=default
HGCalDenseIndexerBase(std::vector< uint32_t > const &o)
uint32_t denseIndex(std::vector< uint32_t > v) const
#define COND_SERIALIZABLE
std::vector< uint32_t > vmax_
void updateRanges(std::vector< uint32_t > const &o)