From 5b5abc2382d6cf7e86689512e0ac48dc42d1ee25 Mon Sep 17 00:00:00 2001 From: Felix Schlepper Date: Tue, 28 May 2024 17:41:43 +0200 Subject: [PATCH] SIM: Fix detectorList parsing set_difference only accepts sorted lists, when testing I think I only ever tested with ITS/IT3 which is the first detector and thus it worked always fine... Signed-off-by: Felix Schlepper --- Common/SimConfig/src/SimConfig.cxx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Common/SimConfig/src/SimConfig.cxx b/Common/SimConfig/src/SimConfig.cxx index b7c48bf734924..eede95c89997b 100644 --- a/Common/SimConfig/src/SimConfig.cxx +++ b/Common/SimConfig/src/SimConfig.cxx @@ -20,7 +20,6 @@ #include #include #include -#include using namespace o2::conf; namespace bpo = boost::program_options; @@ -197,7 +196,11 @@ bool SimConfig::determineActiveModulesList(const std::string& version, std::vect // check if specified modules are in list if (inputargs.size() != 1 || inputargs[0] != "all") { std::vector diff; - std::set_difference(inputargs.begin(), inputargs.end(), modules.begin(), modules.end(), std::back_inserter(diff)); + for (const auto& in : inputargs) { + if (std::find(modules.begin(), modules.end(), in) == std::end(modules)) { + diff.emplace_back(in); + } + } if (!diff.empty()) { LOGP(error, "Modules specified that are not present in detector list {}", version); for (int j{0}; const auto& m : diff) { @@ -423,7 +426,11 @@ bool SimConfig::filterSkippedElements(std::vector& elements, std::v LOGP(error, " + {: <2}. {}", j++, m); } std::vector diff; - std::set_difference(skipped.begin(), skipped.end(), elements.begin(), elements.end(), std::back_inserter(diff)); + for (const auto& skip : skipped) { + if (std::find(elements.begin(), elements.end(), skip) == std::end(elements)) { + diff.emplace_back(skip); + } + } LOGP(error, "Specified skipped modules not present in built modules:"); for (int j{0}; const auto& m : diff) { LOGP(error, " - {: <2}. {}", j++, m);