11 using namespace fhicl;
21 typedef std::vector<bool>
Bools;
27 for (
auto const&
str : s) {
36 for (
unsigned int i = 0; i < b.size(); ++i) {
51 int number_of_trigger_paths = 0;
52 std::vector<unsigned char> bitArray;
59 for (
unsigned int b = 0;
b < mask.size(); ++
b) {
60 bm.at(
b) = (mask[
b] ? pass :
fail);
66 if ((number_of_trigger_paths % 4) == 0)
67 bitArray.push_back(0);
68 int byteIndex = number_of_trigger_paths / 4;
69 int subIndex = number_of_trigger_paths % 4;
72 ++number_of_trigger_paths;
75 if (jmask == 8 && mask.size() > 4) {
83 trigger_pset.
put<
Strings>(
"trigger_paths", paths);
84 ParameterSetRegistry::put(trigger_pset);
88 if (result != answer) {
89 std::cerr <<
"failed to compare pattern with mask using pset ID: " 90 <<
"correct=" << answer <<
" " 91 <<
"results=" << std::boolalpha << result <<
'\n' 92 <<
"pattern=" << pattern <<
"\n" 93 <<
"mask=" << mask <<
"\n" 94 <<
"jmask = " << jmask <<
"\n";
105 for (
unsigned int i = 0; i < patterns.size(); ++i) {
106 for (
unsigned int j = 0; j < masks.size(); ++j) {
107 testone(paths, patterns[i], masks[j], answers[i][j], j);
115 Strings const paths{
"a1",
"a2",
"a3",
"a4",
"a5"};
119 patterns[0] = {
"a1",
"a2"};
120 patterns[1] = {
"!a1",
"!a2"};
121 patterns[2] = {
"a1",
"!a2"};
123 patterns[4] = {
"!*"};
124 patterns[5] = {
"*",
"!*"};
125 patterns[6] = {
"*",
"!a2"};
126 patterns[7] = {
"!*",
"a2"};
127 patterns[8] = {
"a1",
"a2",
"a5"};
128 patterns[9] = {
"a3",
"a4"};
129 patterns[10] = {
"!a5"};
132 testmasks[0] = {
true,
false,
true,
false,
true};
133 testmasks[1] = {
false,
true,
true,
false,
true};
134 testmasks[2] = {
true,
true,
true,
false,
true};
135 testmasks[3] = {
false,
false,
true,
false,
true};
136 testmasks[4] = {
false,
false,
false,
false,
false};
137 testmasks[5] = {
true,
true,
true,
true,
true};
138 testmasks[6] = {
true,
true,
true,
true,
false};
139 testmasks[7] = {
false,
false,
false,
false,
true};
140 testmasks[8] = {
false,
147 {
true,
true,
true,
false,
false,
true,
true,
false,
false},
148 {
true,
true,
false,
true,
true,
false,
false,
true,
true},
149 {
true,
false,
true,
true,
true,
true,
true,
true,
true},
150 {
true,
true,
true,
true,
false,
true,
true,
true,
false},
154 {
false,
false,
false,
false,
true,
false,
false,
false,
false},
155 {
true,
true,
true,
true,
true,
true,
true,
true,
false},
159 {
true,
true,
true,
true,
true,
true,
true,
true,
true},
160 {
false,
true,
true,
false,
true,
true,
true,
false,
false},
161 {
true,
true,
true,
true,
false,
true,
true,
true,
false},
165 {
true,
true,
true,
true,
false,
true,
true,
false,
false},
166 {
false,
false,
false,
false,
true,
false,
true,
false,
false}
175 for (
auto const&
name : paths) {
180 testall(bit_qualified_paths, patterns, testmasks, ans);
static constexpr ScheduleID first()
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
std::ostream & operator<<(std::ostream &os, const GroupSelector &gs)
std::vector< Bools > VBools
ParameterSetID id() const
std::vector< Strings > VStrings
std::vector< bool > Bools
void testone(const Strings &paths, const Strings &pattern, const Bools &mask, bool answer, int jmask)
void testall(const Strings &paths, const VStrings &patterns, const VBools &masks, const Answers &answers)
std::vector< std::string > Strings
constexpr int numPatterns
std::string to_string(ModuleType const mt)
std::vector< std::vector< bool > > Answers
void put(std::string const &key)