|
16 | 16 | #include "Framework/RuntimeError.h" |
17 | 17 | #include <iostream> |
18 | 18 |
|
19 | | -namespace o2 |
20 | | -{ |
21 | | -namespace framework |
22 | | -{ |
23 | | -namespace data_matcher |
| 19 | +namespace o2::framework::data_matcher |
24 | 20 | { |
25 | 21 |
|
26 | 22 | ContextElement::Value const& VariableContext::get(size_t pos) const |
@@ -101,14 +97,18 @@ bool SubSpecificationTypeValueMatcher::match(header::DataHeader const& header, V |
101 | 97 | /// This will match the timing information which is currently in |
102 | 98 | /// the DataProcessingHeader. Notice how we apply the scale to the |
103 | 99 | /// actual values found. |
104 | | -bool StartTimeValueMatcher::match(DataProcessingHeader const& dph, VariableContext& context) const |
| 100 | +bool StartTimeValueMatcher::match(header::DataHeader const& dh, DataProcessingHeader const& dph, VariableContext& context) const |
105 | 101 | { |
106 | 102 | if (auto ref = std::get_if<ContextRef>(&mValue)) { |
107 | 103 | auto& variable = context.get(ref->index); |
108 | 104 | if (auto value = std::get_if<uint64_t>(&variable)) { |
109 | 105 | return (dph.startTime / mScale) == *value; |
110 | 106 | } |
111 | 107 | context.put({ref->index, dph.startTime / mScale}); |
| 108 | + // We always put in 14 the tfCounter |
| 109 | + context.put({14, dh.tfCounter}); |
| 110 | + // We always put in 15 the firstTForbit |
| 111 | + context.put({15, dh.firstTForbit}); |
112 | 112 | return true; |
113 | 113 | } else if (auto v = std::get_if<uint64_t>(&mValue)) { |
114 | 114 | return (dph.startTime / mScale) == *v; |
@@ -262,11 +262,12 @@ bool DataDescriptorMatcher::match(char const* d, VariableContext& context) const |
262 | 262 | } else if (auto pval4 = std::get_if<ConstantValueMatcher>(&mLeft)) { |
263 | 263 | leftValue = pval4->match(); |
264 | 264 | } else if (auto pval5 = std::get_if<StartTimeValueMatcher>(&mLeft)) { |
| 265 | + auto dh = o2::header::get<header::DataHeader*>(d); |
265 | 266 | auto dph = o2::header::get<DataProcessingHeader*>(d); |
266 | 267 | if (dph == nullptr) { |
267 | 268 | throw runtime_error("Cannot find DataProcessingHeader"); |
268 | 269 | } |
269 | | - leftValue = pval5->match(*dph, context); |
| 270 | + leftValue = pval5->match(*dh, *dph, context); |
270 | 271 | } else { |
271 | 272 | throw runtime_error("Bad parsing tree"); |
272 | 273 | } |
@@ -295,8 +296,9 @@ bool DataDescriptorMatcher::match(char const* d, VariableContext& context) const |
295 | 296 | } else if (auto pval4 = std::get_if<ConstantValueMatcher>(&mRight)) { |
296 | 297 | rightValue = pval4->match(); |
297 | 298 | } else if (auto pval5 = std::get_if<StartTimeValueMatcher>(&mRight)) { |
| 299 | + auto dh = o2::header::get<header::DataHeader*>(d); |
298 | 300 | auto dph = o2::header::get<DataProcessingHeader*>(d); |
299 | | - rightValue = pval5->match(*dph, context); |
| 301 | + rightValue = pval5->match(*dh, *dph, context); |
300 | 302 | } |
301 | 303 | // There are cases in which not having a rightValue might be legitimate, |
302 | 304 | // so we do not throw an exception. |
@@ -478,6 +480,4 @@ std::ostream& operator<<(std::ostream& os, DataDescriptorMatcher::Op const& op) |
478 | 480 | return os; |
479 | 481 | } |
480 | 482 |
|
481 | | -} // namespace data_matcher |
482 | | -} // namespace framework |
483 | | -} // namespace o2 |
| 483 | +} // namespace o2::framework::data_matcher |
0 commit comments