|
37 | 37 | #include "Framework/Task.h" |
38 | 38 | #include "Framework/WorkflowSpec.h" |
39 | 39 | #include "Framework/Logger.h" |
| 40 | +#include "Framework/InputRecordWalker.h" |
40 | 41 |
|
41 | 42 | #include "Headers/RAWDataHeader.h" |
42 | 43 | #include "DetectorsRaw/RDHUtils.h" |
@@ -159,6 +160,21 @@ void DataDecoderTask::decodeTF(framework::ProcessingContext& pc) |
159 | 160 |
|
160 | 161 | // get the input buffer |
161 | 162 | auto& inputs = pc.inputs(); |
| 163 | + |
| 164 | + // if we see requested data type input with 0xDEADBEEF subspec and 0 payload this means that the "delayed message" |
| 165 | + // mechanism created it in absence of real data from upstream. Processor should send empty output to not block the workflow |
| 166 | + { |
| 167 | + std::vector<InputSpec> dummy{InputSpec{"dummy", ConcreteDataMatcher{"HMP", "RAWDATA", 0xDEADBEEF}}}; |
| 168 | + for (const auto& ref : InputRecordWalker(inputs, dummy)) { |
| 169 | + const auto dh = o2::framework::DataRefUtils::getHeader<o2::header::DataHeader*>(ref); |
| 170 | + if (dh->payloadSize == 0) { |
| 171 | + LOGP(WARNING, "Found input [{}/{}/{:#x}] TF#{} 1st_orbit:{} Payload {} : assuming no payload for all links in this TF", |
| 172 | + dh->dataOrigin.str, dh->dataDescription.str, dh->subSpecification, dh->tfCounter, dh->firstTForbit, dh->payloadSize); |
| 173 | + return; |
| 174 | + } |
| 175 | + } |
| 176 | + } |
| 177 | + |
162 | 178 | DPLRawParser parser(inputs, o2::framework::select("TF:HMP/RAWDATA")); |
163 | 179 | mDeco->mDigits.clear(); |
164 | 180 | for (auto it = parser.begin(), end = parser.end(); it != end; ++it) { |
@@ -253,22 +269,21 @@ void DataDecoderTask::decodeRawFile(framework::ProcessingContext& pc) |
253 | 269 | } |
254 | 270 |
|
255 | 271 | //_________________________________________________________________________________________________ |
256 | | -o2::framework::DataProcessorSpec getDecodingSpec(std::string inputSpec) |
| 272 | +o2::framework::DataProcessorSpec getDecodingSpec(bool askDISTSTF) |
257 | 273 | { |
258 | 274 | std::vector<o2::framework::InputSpec> inputs; |
259 | | - inputs.emplace_back("TF", o2::framework::ConcreteDataTypeMatcher{"HMP", "RAWDATA"}, o2::framework::Lifetime::Timeframe); |
260 | | - inputs.emplace_back("file", o2::framework::ConcreteDataTypeMatcher{"ROUT", "RAWDATA"}, o2::framework::Lifetime::Timeframe); |
261 | | - // inputs.emplace_back("readout", o2::header::gDataOriginHMP, "RAWDATA", 0, Lifetime::Timeframe); |
262 | | - // inputs.emplace_back("readout", o2::header::gDataOriginHMP, "RAWDATA", 0, Lifetime::Timeframe); |
263 | | - // inputs.emplace_back("rawfile", o2::header::gDataOriginHMP, "RAWDATA", 0, Lifetime::Timeframe); |
| 275 | + inputs.emplace_back("TF", o2::framework::ConcreteDataTypeMatcher{"HMP", "RAWDATA"}, o2::framework::Lifetime::Optional); |
| 276 | + if (askDISTSTF) { |
| 277 | + inputs.emplace_back("stdDist", "FLP", "DISTSUBTIMEFRAME", 0, Lifetime::Timeframe); |
| 278 | + } |
264 | 279 |
|
265 | 280 | std::vector<o2::framework::OutputSpec> outputs; |
266 | 281 | outputs.emplace_back("HMP", "DIGITS", 0, o2::framework::Lifetime::Timeframe); |
267 | 282 | outputs.emplace_back("HMP", "INTRECORDS", 0, o2::framework::Lifetime::Timeframe); |
268 | 283 |
|
269 | 284 | return DataProcessorSpec{ |
270 | 285 | "HMP-RawStreamDecoder", |
271 | | - o2::framework::select(inputSpec.c_str()), |
| 286 | + inputs, |
272 | 287 | outputs, |
273 | 288 | AlgorithmSpec{adaptFromTask<DataDecoderTask>()}, |
274 | 289 | Options{{"result-file", VariantType::String, "/tmp/hmpRawDecodeResults", {"Base name of the decoding results files."}}, |
|
0 commit comments