Skip to content

Commit 1570db6

Browse files
authored
[EMCAL-741] Use std::round for pedestal ADC extraction (#13078)
1 parent 550033f commit 1570db6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Detectors/EMCAL/calibration/include/EMCALCalibration/EMCALCalibExtractor.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#define EMCALCALIBEXTRACTOR_H_
2020

2121
#include <algorithm>
22+
#include <cmath>
2223
#include <iostream>
2324
#include "CCDB/BasicCCDBManager.h"
2425
#include "EMCALCalib/BadChannelMap.h"
@@ -465,7 +466,7 @@ class EMCALCalibExtractor
465466
if (rms > EMCALCalibParams::Instance().maxPedestalRMS) {
466467
mean = mMaxPedestalVal;
467468
}
468-
pedestalData.addPedestalValue(iCell, mean, isLG, isLEDMON);
469+
pedestalData.addPedestalValue(iCell, std::round(mean), isLG, isLEDMON);
469470
}
470471
}
471472
}
@@ -488,7 +489,7 @@ class EMCALCalibExtractor
488489
if (!obj)
489490
continue;
490491
for (unsigned short iCell = 0; iCell < maxChannels; ++iCell) {
491-
short mean = static_cast<short>(obj->GetBinContent(iCell + 1));
492+
short mean = static_cast<short>(std::round(obj->GetBinContent(iCell + 1)));
492493
short rms = static_cast<short>(obj->GetBinError(iCell + 1) / obj->GetBinEntries(iCell + 1));
493494
if (rms > EMCALCalibParams::Instance().maxPedestalRMS) {
494495
mean = mMaxPedestalVal;

0 commit comments

Comments
 (0)