8 : exponentBits_(conf.getParameter<uint32_t>(
"exponentBits")),
9 mantissaBits_(conf.getParameter<uint32_t>(
"mantissaBits")),
10 truncationBits_(conf.getParameter<uint32_t>(
"truncationBits")),
11 rounding_(conf.getParameter<
bool>(
"rounding")) {
13 throw cms::Exception(
"CodespaceCannotFit") <<
"The code space cannot fit into the unsigned 64-bit space.\n";
22 uint32_t& compressedCode,
35 for (bitlen = 0; valcopy != 0; valcopy >>= 1, bitlen++) {
38 compressedCode = shifted_value;
55 compressedCode = floatval;
58 const bool roundup = ((shifted_value >> (
exponent - 2)) & 1ULL) == 1ULL;
60 compressedCode = floatval;
63 compressedCode = floatval + 1;
70 compressedValue = ((1ULL <<
mantissaBits_) | rmantissa) << (rexponent - 1);
77 std::unordered_map<uint32_t, std::array<uint64_t, 2> >& compressed_payload) {
83 std::array<uint64_t, 2> compressed_item = {{
static_cast<uint64_t>(code), compressed_value}};
84 compressed_payload.emplace(
item.first, compressed_item);
HGCalVFECompressionImpl(const edm::ParameterSet &conf)
void compressSingle(const uint64_t value, uint32_t &compressedCode, uint64_t &compressedValue) const
unsigned long long uint64_t
void compress(const std::unordered_map< uint32_t, uint32_t > &, std::unordered_map< uint32_t, std::array< uint64_t, 2 > > &)
uint64_t saturationValue_