Skip to content
Snippets Groups Projects

Digi float -> int truncation fix

Merged Carl Gwilliam requested to merge gwilliam/calypso:digi_int_fix into master
5 files
+ 10
8
Compare changes
  • Side-by-side
  • Inline
Files
5
@@ -6,6 +6,7 @@
@@ -6,6 +6,7 @@
#include <map>
#include <map>
#include <utility>
#include <utility>
 
#include <cmath>
CaloWaveformDigiAlg::CaloWaveformDigiAlg(const std::string& name,
CaloWaveformDigiAlg::CaloWaveformDigiAlg(const std::string& name,
ISvcLocator* pSvcLocator)
ISvcLocator* pSvcLocator)
@@ -122,8 +123,8 @@ CaloWaveformDigiAlg::execute(const EventContext& ctx) const {
@@ -122,8 +123,8 @@ CaloWaveformDigiAlg::execute(const EventContext& ctx) const {
// Subtract count from basleine and add result to correct waveform vector
// Subtract count from basleine and add result to correct waveform vector
for (const auto& c : counts) {
for (const auto& c : counts) {
unsigned int baseline = m_digiTool->generate_baseline(m_base_mean, m_base_rms);
float baseline = m_digiTool->generate_baseline(m_base_mean, m_base_rms);
int value = baseline - c.second;
int value = std::round(baseline - c.second);
if (value < 0) {
if (value < 0) {
ATH_MSG_WARNING("Found pulse " << c.second << " larger than baseline " << c.first);
ATH_MSG_WARNING("Found pulse " << c.second << " larger than baseline " << c.first);
Loading