From b20af4a890c5265f8366f458b5dd143a974401f3 Mon Sep 17 00:00:00 2001 From: afurs Date: Fri, 2 Jul 2021 09:01:04 +0200 Subject: [PATCH] FITRaw: hotfix for #6562 --- Detectors/FIT/raw/include/FITRaw/DigitBlockFIT.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Detectors/FIT/raw/include/FITRaw/DigitBlockFIT.h b/Detectors/FIT/raw/include/FITRaw/DigitBlockFIT.h index 404142c5cf270..5805c30eb99a3 100644 --- a/Detectors/FIT/raw/include/FITRaw/DigitBlockFIT.h +++ b/Detectors/FIT/raw/include/FITRaw/DigitBlockFIT.h @@ -87,13 +87,14 @@ auto ConvertDigit2TCMData(const DigitType& digit, TCMDataType& tcmData) -> std:: //tcmData.laser = digit.mTriggers.getLaserBit(); //Turned off for FDD tcmData.nChanA = digit.mTriggers.nChanA; tcmData.nChanC = digit.mTriggers.nChanC; - if (digit.mTriggers.amplA > 131071) { - tcmData.amplA = 131071; //2^17 + const int64_t thresholdSignedInt17bit = 65535; //pow(2,17)/2-1 + if (digit.mTriggers.amplA > thresholdSignedInt17bit) { + tcmData.amplA = thresholdSignedInt17bit; } else { tcmData.amplA = digit.mTriggers.amplA; } - if (digit.mTriggers.amplC > 131071) { - tcmData.amplC = 131071; //2^17 + if (digit.mTriggers.amplC > thresholdSignedInt17bit) { + tcmData.amplC = thresholdSignedInt17bit; } else { tcmData.amplC = digit.mTriggers.amplC; }