Skip to content

Commit 919e8f2

Browse files
committed
DPL: set runNumber in DataHeader from raw data readers
1 parent 9a197c2 commit 919e8f2

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

Detectors/Raw/TFReaderDD/src/TFReaderSpec.cxx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,12 @@ void TFReaderSpec::stopProcessing(o2f::ProcessingContext& ctx)
327327
auto device = ctx.services().get<o2f::RawDeviceService>().device();
328328
o2f::SourceInfoHeader exitHdr;
329329
exitHdr.state = o2f::InputChannelState::Completed;
330-
const auto exitStack = o2h::Stack(o2h::DataHeader(o2h::gDataDescriptionInfo, o2h::gDataOriginAny, 0, 0), o2f::DataProcessingHeader(), exitHdr);
330+
o2h::DataHeader dh = o2h::DataHeader(o2h::gDataDescriptionInfo, o2h::gDataOriginAny, 0, 0);
331+
try {
332+
dh.runNumber = strtoul(device->fConfig->GetProperty<std::string>("runNumber", "").c_str(), nullptr, 10);
333+
} catch (...) {
334+
}
335+
const auto exitStack = o2h::Stack(dh, o2f::DataProcessingHeader(), exitHdr);
331336
auto fmqFactory = device->GetChannel(mInput.rawChannelConfig, 0).Transport();
332337
auto hdEOSMessage = fmqFactory->CreateMessage(exitStack.size(), fair::mq::Alignment{64});
333338
auto plEOSMessage = fmqFactory->CreateMessage(0, fair::mq::Alignment{64});

Detectors/Raw/src/RawFileReaderWorkflow.cxx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,12 @@ void RawReaderSpecs::run(o2f::ProcessingContext& ctx)
347347
if (!mRawChannelName.empty()) { // send endOfStream message to raw channel
348348
o2f::SourceInfoHeader exitHdr;
349349
exitHdr.state = o2f::InputChannelState::Completed;
350-
const auto exitStack = o2::header::Stack(o2h::DataHeader(o2h::gDataDescriptionInfo, o2h::gDataOriginAny, 0, 0), o2f::DataProcessingHeader(), exitHdr);
350+
o2h::DataHeader dh = o2h::DataHeader(o2h::gDataDescriptionInfo, o2h::gDataOriginAny, 0, 0);
351+
try {
352+
dh.runNumber = strtoul(device->fConfig->GetProperty<std::string>("runNumber", "").c_str(), nullptr, 10);
353+
} catch (...) {
354+
}
355+
const auto exitStack = o2::header::Stack(dh, o2f::DataProcessingHeader(), exitHdr);
351356
auto fmqFactory = device->GetChannel(mRawChannelName, 0).Transport();
352357
auto hdEOSMessage = fmqFactory->CreateMessage(exitStack.size(), fair::mq::Alignment{64});
353358
auto plEOSMessage = fmqFactory->CreateMessage(0, fair::mq::Alignment{64});

0 commit comments

Comments
 (0)