Sink closed before generator finalizes
Closed this issue · 3 comments
I need to store in the output ntuple an additional 1-event tree with event generator information known only after it finalizes. I'm trying to do this in a method overriding FairGenerator::Finish by creating a TTree and doing
FairRootManager::Instance()->GetSink()->WriteObject(mytree, "info");
.
The code compiles and runs, but it is not saved and I get an error:
Error in <TFile::WriteTObject>: Directory myfile.root is not writable
I think this may be caused by the sink being closed before the generator is finalized, here https://github.com/FairRootGroup/FairRoot/blob/master/base/sim/FairMCApplication.cxx#L417-L424
Would it be a problem to change the order there?
I think, we have mostly fixed this in our dev
branch my moving the Close function much later:
See: 328bd8b
Do you have a chance of trying the dev branch? (Please take a look at the ChangeLog, we have changed a lot of CMake related stuff.)
How important is this to you? Then we can try to either backport this or re-order, as you suggested.
Yes, on the dev branch saving is working fine. Also our software seems to run perfectly fine on it, without any major tweaks, so I guess we can use it for a while if the release of new FairRoot is not far.
If it's planned much later and you are going to introduce possibly compatibility breaking changes, I would really appreciate a smaller release with just this change. It is crucial for us, as it is stopping our analysts from working effectively on test run data. We can of course deal with it temporarily in a few ways, but if it's not a problem for you, it would be great to have a stable FR release it works with.