6 : exponentBits_(conf.getParameter<uint32_t>(
"exponentBits")),
7 mantissaBits_(conf.getParameter<uint32_t>(
"mantissaBits")),
8 truncationBits_(conf.getParameter<uint32_t>(
"truncationBits")),
9 rounding_(conf.getParameter<
bool>(
"rounding")) {
11 throw cms::Exception(
"CodespaceCannotFit") <<
"The code space cannot fit into the unsigned 64-bit space.\n";
20 uint32_t& compressedCode,
33 for (bitlen = 0; valcopy != 0; valcopy >>= 1, bitlen++) {
36 compressedCode = shifted_value;
50 compressedCode = floatval;
53 const bool roundup = ((shifted_value >> (
exponent - 2)) & 1ULL) == 1ULL;
55 compressedCode = floatval;
58 compressedCode = floatval + 1;
65 compressedValue = ((1ULL <<
mantissaBits_) | rmantissa) << (rexponent - 1);
72 std::unordered_map<uint32_t, std::array<uint64_t, 2> >& compressed_payload) {
78 std::array<uint64_t, 2> compressed_item = {{
static_cast<uint64_t>(code), compressed_value}};
79 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_