Skip to content

Commit d4a8417

Browse files
committed
Fix broken StaticContainer functionality in FairRunOnline
Added check for `fStatic` in the `FairRunOnline::EventLoop()`. When `fStatic` is set to true by `SetContainerStatic()`, `ReInit()` will not be called when changed `RunId` detected.
1 parent 39c78aa commit d4a8417

2 files changed

Lines changed: 12 additions & 7 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ file an issue, so that we can see how to handle this.
9797
* Check the return value of `source->InitUnpackers()`/`source->ReinitUnpackers()`
9898
in `FairRunOnline`. Stop run if `false` returned.
9999
* Remove sink from Tutorial3/MQ/sampler.cxx.
100+
* Fixed broken `StaticContainer` functionality (do not `ReInit`ialize when `RunId` changes) in `FairRunOnline`.
100101
101102
### Other Notable Changes
102103
* Allow running without output sink. In this case even persistent branches would not be stored anywhere.

fairroot/online/steer/FairRunOnline.cxx

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -215,16 +215,20 @@ Int_t FairRunOnline::EventLoop()
215215

216216
FillEventHeader();
217217
auto const tmpId = GetEvtHeaderRunId();
218-
219218
if (tmpId != fRunId) {
220-
LOG(info) << "FairRunOnline::EventLoop() Call Reinit due to changed RunID (from " << fRunId << " to " << tmpId;
219+
LOG(info) << "FairRunOnline::EventLoop() Detected changed RunID from " << fRunId << " to " << tmpId;
221220
fRunId = tmpId;
222-
Reinit(fRunId);
223-
if (!GetSource()->ReInitUnpackers()) {
224-
LOG(fatal) << "FairRunOnline->EventLoop() ReInitUnpackers() failed!";
225-
return 1;
221+
if (!fStatic) {
222+
LOG(info) << "FairRunOnline::EventLoop() Call Reinit.";
223+
Reinit(fRunId);
224+
if (!GetSource()->ReInitUnpackers()) {
225+
LOG(fatal) << "FairRunOnline->EventLoop() ReInitUnpackers() failed!";
226+
return 1;
227+
}
228+
fTask->ReInitTask();
229+
} else {
230+
LOG(info) << "FairRunOnline::EventLoop() ReInit not called because initialisation is static.";
226231
}
227-
fTask->ReInitTask();
228232
}
229233

230234
fRootManager->StoreWriteoutBufferData(fRootManager->GetEventTime());

0 commit comments

Comments
 (0)