bugfix in some macros: save RTDB after the run initialization
Bug fix in some macros that look "official" to me. The other 350 macros should be probably fixed by their authors.
The problem I found is that the FairRuntimeDb::saveOutput() does not work when FairRunAna is not initialized.
Here is the typical case:
FairParRootFileIo* parOut = new FairParRootFileIo(kParameterMerged);
parOut->open(parFile.Data());
rtdb->setOutput(parOut);
rtdb->saveOutput();
rtdb->print();
..
run->Run(..);
Here rtdb->saveOutput(); writes an empty file. One should call it after run->Init() or after run->Run().
Why it happens:
In principle, there is no need to call the rtdb->saveOutput(). Once the output file is set, the FairRuntimeDb is supposed to save the database automatically. It internally calls saveOutput() whenever the run number changes + at the end of the data processing, namely in the FairRuntimeDb destructor.
The problem is that in our macros, the FairRuntimeDb destructor is never called since we never care to delete the database or the run objects. Therefore, the database is not automatically written at the end.
To get around this problem, we call the rtdb->saveOutput() explicitly. But this approach only works when the run is already initialized, i.e., after run->Init();
I think the best place to call the rtdb->saveOutput() is not after run->Init() but at the very end, after run->Run(). This solution works for the case when the run number changes during the reconstruction.
Merge request reports
Activity
requested review from @p.-a.loizeau
assigned to @se.gorbunov
added BugFix label
the failed test looks suspiciously like the error reported by Eoin in #3213
I tried to restart the jobs to find out if it is something spurious or something deterministic
- Resolved by Florian Uhlig
Dear @i.selyuzhenkov, @se.gorbunov, @v.akishina, @f.uhlig, @p.-a.loizeau,
you have been identified as code owner of at least one file which was changed with this merge request.
Please check the changes and approve them or request changes.
added CodeOwners label
requested review from @f.uhlig and removed review request for @p.-a.loizeau
added 1 commit
- 003018d4 - bugfix in macros: save rtdb after the run initialization
added 306 commits
-
003018d4...054f6d12 - 305 commits from branch
computing:master
- 1da4117b - bugfix in macros: save rtdb after the run initialization
-
003018d4...054f6d12 - 305 commits from branch
enabled an automatic merge when the pipeline for 1da4117b succeeds