Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion L1Trigger/L1THGCal/src/HGCalVFECompressionImpl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ void HGCalVFECompressionImpl::compressSingle(const uint64_t value,
const uint32_t floatval = (exponent << mantissaBits_) | mantissa;

// we will never want to round up maximum code here
if (!rounding_ || floatval == saturationCode_) {
// Also, rounding doesn't apply if exponent==1 since there is no actual compression
// from the conversion to floating point in that case
if (!rounding_ || floatval == saturationCode_ || exponent <= 1) {
compressedCode = floatval;
compressedValue = ((1ULL << mantissaBits_) | mantissa) << (exponent - 1);
} else {
Expand Down