52 bool unrestricted_star =
false;
53 bool negated_star =
false;
54 bool exception_star =
false;
56 for (std::string
const& pathSpecifier : paths) {
58 string specifier{pathSpecifier};
60 boost::erase_all(specifier,
" \t");
62 unrestricted_star =
true;
63 if (specifier ==
"!*")
65 if (specifier ==
"exception@*")
66 exception_star =
true;
69 bool noex_demanded{
false};
70 std::string
const& noexLiteral{
"&noexception"};
71 auto const noexception_pos = specifier.find(noexLiteral);
72 if (noexception_pos != string::npos) {
73 if (noexception_pos + noexLiteral.length() < specifier.length()) {
75 <<
"EventSelector::init, An OutputModule is using SelectEvents\n" 76 "to request a trigger name that has extra characters after " 78 <<
"The improper trigger name is: " << pathSpecifier <<
"\n";
80 specifier.erase(noexception_pos);
85 bool negative_criterion{
false};
86 if (specifier[0] ==
'!') {
87 negative_criterion =
true;
88 specifier.erase(0, 1);
90 bool exception_spec{
false};
91 std::string
const& exLiteral{
"exception@"};
92 auto const pos = specifier.find(exLiteral);
94 exception_spec =
true;
95 specifier.erase(0, exLiteral.length());
96 }
else if (pos != std::string::npos) {
98 <<
"EventSelector::init, An OutputModule is using SelectEvents\n" 99 "to request a trigger name that has disallowed characters before " 101 <<
"The improper trigger name is: " << pathSpecifier <<
"\n";
104 if (negative_criterion && exception_spec)
106 <<
"EventSelector::init, An OutputModule is using SelectEvents\n" 107 "to request a trigger name starting with !exception@.\n" 108 "This is not supported.\n" 109 <<
"The improper trigger name is: " << pathSpecifier <<
"\n";
111 if (noex_demanded && exception_spec)
113 <<
"EventSelector::init, An OutputModule is using SelectEvents\n" 114 "to request a trigger name starting with exception@ " 115 "and also demanding no &exceptions.\n" 116 <<
"The improper trigger name is: " << pathSpecifier <<
"\n";
123 std::string
const& realname{specifier};
124 vector<Strings::const_iterator> matches =
127 if (matches.empty()) {
130 <<
"EventSelector::init, An OutputModule is using SelectEvents\n" 131 "to request a wildcarded trigger name that does not match any " 133 <<
"The wildcarded trigger name is: " << realname
134 <<
" (from trigger-path specification: " << pathSpecifier <<
") \n";
137 <<
"EventSelector::init, An OutputModule is using SelectEvents\n" 138 "to request a trigger name that does not exist\n" 139 <<
"The unknown trigger name is: " << realname
140 <<
" (from trigger-path specification: " << pathSpecifier <<
") \n";
144 auto makeBitInfoPass = [&triggernames](
auto m) {
145 return BitInfo(distance(triggernames.begin(), m),
true);
148 auto makeBitInfoFail = [&triggernames](
auto m) {
149 return BitInfo(distance(triggernames.begin(), m),
false);
152 if (!negative_criterion && !noex_demanded && !exception_spec) {
155 }
else if (!negative_criterion && noex_demanded) {
158 }
else if (exception_spec) {
161 }
else if (negative_criterion && !noex_demanded) {
162 if (matches.empty()) {
164 <<
"EventSelector::init, An OutputModule is using SelectEvents\n" 165 "to request all fails on a set of trigger names that do not " 167 <<
"The problematic name is: " << pathSpecifier <<
"\n";
169 }
else if (matches.size() == 1) {
170 BitInfo bi(distance(triggernames.begin(), matches[0]),
false);
176 matches, std::back_inserter(mustfail), makeBitInfoFail);
179 }
else if (negative_criterion && noex_demanded) {
180 if (matches.empty()) {
182 <<
"EventSelector::init, An OutputModule is using SelectEvents\n" 183 "to request all fails on a set of trigger names that do not " 185 <<
"The problematic name is: " << pathSpecifier <<
"\n";
186 }
else if (matches.size() == 1) {
187 BitInfo bi(distance(triggernames.begin(), matches[0]),
false);
192 matches, std::back_inserter(mustfail), makeBitInfoFail);
198 if (unrestricted_star && negated_star && exception_star)
std::vector< std::vector< std::string >::const_iterator > regexMatch(std::vector< std::string > const &strings, std::regex const ®exp)
Bits conditional_acceptors_
std::vector< BitInfo > Bits
Bits exception_acceptors_
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
std::vector< Bits > all_must_fail_noex_
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
std::vector< Bits > all_must_fail_
bool is_glob(std::string const &pattern)