File indexing completed on 2023-03-17 11:03:54
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #include <algorithm>
0015 #include <array>
0016
0017
0018 #include "FWCore/Utilities/interface/path_configuration.h"
0019
0020 namespace edm::path_configuration {
0021
0022 SchedulingConstructLabelSet const& schedulingConstructLabels() {
0023 static const SchedulingConstructLabelSet s_set({{"@"}, {"#"}});
0024 return s_set;
0025 }
0026
0027
0028
0029 std::vector<std::string> configurationToModuleBitPosition(std::vector<std::string> iConfig) {
0030 auto const& labelsToRemove = schedulingConstructLabels();
0031 iConfig.erase(
0032 std::remove_if(iConfig.begin(),
0033 iConfig.end(),
0034 [&labelsToRemove](auto const& n) { return labelsToRemove.find(n) != labelsToRemove.end(); }),
0035 iConfig.end());
0036 return iConfig;
0037 }
0038
0039 std::string removeSchedulingTokensFromModuleLabel(std::string iLabel) {
0040 constexpr std::array<char, 4> s_tokens = {{'!', '-', '+', '|'}};
0041 if (not iLabel.empty()) {
0042 for (auto t : s_tokens) {
0043 if (t == iLabel[0]) {
0044 iLabel.erase(0, 1);
0045 break;
0046 }
0047 }
0048 }
0049 return iLabel;
0050 }
0051
0052 }