Go to the source code of this file.
Definition at line 113 of file EventSelector_t.cpp.
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);
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
std::vector< Bools > VBools
std::vector< Strings > VStrings
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
std::ostream& operator<< |
( |
std::ostream & |
ost, |
|
|
const Strings & |
s |
|
) |
| |
std::ostream& operator<< |
( |
std::ostream & |
ost, |
|
|
const Bools & |
b |
|
) |
| |
Definition at line 100 of file EventSelector_t.cpp.
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);
void testone(const Strings &paths, const Strings &pattern, const Bools &mask, bool answer, int jmask)
Definition at line 43 of file EventSelector_t.cpp.
51 int number_of_trigger_paths = 0;
52 std::vector<unsigned char> bitArray;
59 for (
unsigned int b = 0;
b <
mask.size(); ++
b) {
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);
87 bool const result = selector.acceptEvent(ScheduleID::first(), results_id);
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";
ParameterSetID id() const
std::vector< std::string > Strings
void put(std::string const &key)
constexpr size_t numBits = 5 |
constexpr int numMasks = 9 |
constexpr int numPatterns = 11 |