Skip to content

Commit

Permalink
SIM: Fix detectorList parsing
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
f3sch authored and sawenzel committed May 29, 2024
1 parent 68e0e4f commit 5b5abc2
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions Common/SimConfig/src/SimConfig.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include <cmath>
#include <chrono>
#include <regex>
#include <algorithm>

using namespace o2::conf;
namespace bpo = boost::program_options;
Expand Down Expand Up @@ -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<std::string> 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) {
Expand Down Expand Up @@ -423,7 +426,11 @@ bool SimConfig::filterSkippedElements(std::vector<std::string>& elements, std::v
LOGP(error, " + {: <2}. {}", j++, m);
}
std::vector<std::string> 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);
Expand Down

0 comments on commit 5b5abc2

Please sign in to comment.