From 6b894a5083f57c3785cd98ac92e2ad14e46bf968 Mon Sep 17 00:00:00 2001 From: Jonathan Mulvey Date: Wed, 13 Aug 2025 14:17:12 +0200 Subject: [PATCH] Fixed cluster bug. cluster.data is not saved in the correct order (makes extracting 3x3s from 9x9 impossible). This is a bug in all branches --- include/aare/ClusterFinder.hpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/include/aare/ClusterFinder.hpp b/include/aare/ClusterFinder.hpp index 330abc8..abbd39e 100644 --- a/include/aare/ClusterFinder.hpp +++ b/include/aare/ClusterFinder.hpp @@ -195,13 +195,14 @@ class ClusterFinder { // CT tmp = static_cast(frame(iy + ir, ix + ic)) - static_cast(m_pedestal.mean(iy + ir, ix + ic)); - CT tmp = 0; + // CT tmp = 0; if (std_ptr[inner_row_offset + ix + ic] != 0) - tmp = static_cast(frame(iy + ir, ix + ic)) - static_cast(mean_ptr[inner_row_offset + ix + ic]); - - cluster.data[i] = tmp; // Watch for out of bounds access - i++; + { + CT tmp = static_cast(frame(iy + ir, ix + ic)) - static_cast(mean_ptr[inner_row_offset + ix + ic]); + cluster.data[i] = tmp; // Watch for out of bounds access + } } + i++; } }