Skip to content

Commit 01ddbc3

Browse files
committed
DPL: fix setting of run number
This is actually a workaround. The real issue is that timer at the moment are completely outside of the data streaming and therefore do not have access to the DataTakingService, where the proper calculation for the run number happens and it's cached. OK for now. In the future we should make sure that the LifetimeHelpers::enumerate gets a "Streaming" context, not the global one.
1 parent cadc5fa commit 01ddbc3

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Framework/Core/src/LifetimeHelpers.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ ExpirationHandler::Handler LifetimeHelpers::enumerate(ConcreteDataMatcher const&
423423
dh.payloadSerializationMethod = gSerializationMethodNone;
424424
dh.tfCounter = timestamp;
425425
try {
426-
dh.runNumber = atoi(services.get<DataTakingContext>().runNumber.c_str());
426+
dh.runNumber = strtoull(services.get<RawDeviceService>().device()->fConfig->GetProperty<std::string>("runNumber", "0").c_str(), nullptr, 10);
427427
} catch (...) {
428428
dh.runNumber = 0;
429429
}

Framework/Core/test/test_SimpleTimer.cxx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@ std::vector<DataProcessorSpec> defineDataProcessing(ConfigContext const&)
3838
InputSpec{"atimer", "TST", "TIMER", 0, Lifetime::Timer}},
3939
{},
4040
AlgorithmSpec{
41-
adaptStateless([](ControlService& control) {
41+
adaptStateless([](ControlService& control, InputRecord& inputs) {
42+
DataRef ref = inputs.get("atimer");
43+
assert(header);
44+
auto* header = o2::header::get<o2::header::DataHeader*>(ref.header);
45+
LOG(info) << "Run number: " << header->runNumber;
4246
// This is invoked autonomously by the timer.
4347
control.readyToQuit(QuitRequest::Me);
4448
})}},

0 commit comments

Comments
 (0)