From 08dc8e3cbb2ed8bd8bfdb01756deb98420426c62 Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Tue, 16 Jul 2024 11:59:17 +0200 Subject: [PATCH] client bug fix: m3 multi module bad channel file throws bad allocation when modules skipped, needed to add vectors in 2d vector of bad channel list (#920) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Erik Fröjdh --- slsDetectorSoftware/src/DetectorImpl.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/slsDetectorSoftware/src/DetectorImpl.cpp b/slsDetectorSoftware/src/DetectorImpl.cpp index 523c472f8..7792383b0 100644 --- a/slsDetectorSoftware/src/DetectorImpl.cpp +++ b/slsDetectorSoftware/src/DetectorImpl.cpp @@ -1981,7 +1981,7 @@ void DetectorImpl::setBadChannels(const std::vector list, Positions pos) { // update to multi values if multi modules if (isAllPositions(pos)) { - std::vector> badchannels; + std::vector> badchannels(modules.size()); int nchan = modules[0]->getNumberOfChannels().x; if (shm()->detType == MYTHEN3) { // assuming single counter @@ -2000,16 +2000,9 @@ void DetectorImpl::setBadChannels(const std::vector list, Positions pos) { std::to_string(badchannel) + " out of bounds."); } - if (badchannels.size() != imod + 1) { - badchannels.push_back(std::vector{}); - } badchannels[imod].push_back(ch); } for (size_t imod = 0; imod != modules.size(); ++imod) { - // add empty vector if no bad channels in this module - if (badchannels.size() != imod + 1) { - badchannels.push_back(std::vector{}); - } Parallel(&Module::setBadChannels, {static_cast(imod)}, badchannels[imod]); }