FairRootGroup / FairRoot

C++ simulation, reconstruction and analysis framework for particle physics experiments
http://fairroot.gsi.de
Other
57 stars 96 forks source link

Sink closed before generator finalizes #1498

Closed mgoncerz closed 5 months ago

mgoncerz commented 6 months ago

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?

ChristianTackeGSI commented 6 months ago

I think, we have mostly fixed this in our dev branch my moving the Close function much later:

See: 328bd8bc400509c428043eef4a6dd9850f8d45e1

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.

mgoncerz commented 6 months ago

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.

karabowi commented 5 months ago

We plan to release v19.0 in the next 2-3 weeks. Hope this time is OK with you.