19 EventIDMatcher::EventIDMatcher(std::string
const& pattern)
20 : pattern_(), parsed_patterns_()
22 if (pattern.empty()) {
24 <<
"EventIDMatcher given an empty pattern!";
34 if (patterns.size() == 0) {
36 <<
"EventIDMatcher given an empty list of patterns!";
40 for (
auto const& val : patterns) {
43 <<
"EventIDMatcher given an empty pattern!";
61 "[[:blank:]]*-[[:blank:]]*" 68 for (
auto const& given_pattern :
pattern_) {
70 regex_iterator<string::const_iterator> I(
71 given_pattern.cbegin(), given_pattern.cend(), pat);
72 regex_iterator<string::const_iterator>
E;
82 if (m.str(7).size()) {
86 if (m.position() != (prev_pos + prev_len)) {
90 buf <<
"Illegal character in pattern near here:\n";
93 for (
auto i = 0L; i < (prev_pos + prev_len); ++i) {
103 }
else if (m[4].matched) {
107 for (
auto val : m.str(4)) {
108 num = (num * 10U) + (val -
'0');
115 for (
auto val : m.str(5)) {
116 num_low = (num_low * 10U) + (val -
'0');
119 for (
auto val : m.str(6)) {
120 num_high = (num_high * 10U) + (val -
'0');
123 num_low, num_high,
false);
127 if (part_num == 0U) {
129 }
else if (part_num == 1U) {
131 }
else if (part_num == 2U) {
136 <<
"Syntax error, event part of pattern ended with a ':' here:\n";
137 buf << given_pattern;
139 for (
auto i = 0L; i < m.position(7); ++i) {
146 }
else if (sep ==
',') {
151 prev_pos = m.position();
152 prev_len = m.length();
155 if (prev_sep !=
'\0') {
159 printf(
"pep: Syntax error, near here:\n");
160 buf << given_pattern;
162 for (
auto i = 0L; i < (prev_pos + prev_len); ++i) {
168 if (static_cast<string::size_type>(prev_pos + prev_len) !=
169 given_pattern.size()) {
173 printf(
"pep: Syntax error, near here:\n");
174 buf << given_pattern;
176 for (
auto i = 0L; i < (prev_pos + prev_len); ++i) {
223 for (
auto i = 0U; i < 3; ++i) {
236 for (
auto const& val : parsed_pattern[i]) {
242 }
else if (val.low_ == val.high_) {
246 if (eid.
run() == val.low_) {
253 }
else if (i == 1U) {
255 if (eid.
subRun() == val.low_) {
264 if (eid.
event() == val.low_) {
277 if ((eid.
run() >= val.low_) && (eid.
run() <= val.high_)) {
284 }
else if (i == 1U) {
286 if ((eid.
subRun() >= val.low_) && (eid.
subRun() <= val.high_)) {
295 if ((eid.
event() >= val.low_) && (eid.
event() <= val.high_)) {
RunID const & runID() const
SubRunID const & subRunID() const
bool match(EventID const &) const
printf("%d Experimental points found\n", nlines)
std::vector< std::string > pattern_
bool operator()(EventID const &) const
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
EventIDMatcher(std::string const &pattern)
EventNumber_t event() const
std::vector< std::vector< std::vector< PatternRangeElement > > > parsed_patterns_
SubRunNumber_t subRun() const