Using TBufferMerger in single-threaded application

I am porting a Gerant4 application with ROOT output to multithreading, and I’m evaluating the possibility to switch from a simple TTree to a TBufferMerger for parallel output on a single file. To reduce the complexity of my code I’d like to use the same code patterns both for MT mode and ST mode (my application can run both with ST and MT builds of Geant4), and this would mean to use TBufferMerger also for the ST version. Is there any issue (most probably related to performance) in doing so?
Thanks.

No, it should be perfectly fine to use TBufferMerger in single-threaded mode, but you are right, it will not be as fast as using TTree directly.

Thank you very much. Another related question: currently in my ST program different user actions create different branches on the same output tree on the output file. When I’ll implement the TBufferMerger I could make each action have its own tree from its own TBufferMergerFile: will the merge work in this situation? I mean, the intended behavior is to end with a single tree with all the branches of the merged trees: is this feasible, or does the merge works only for trees having each one the same set of branches? Could it have a noticeable performance penalty with respect to the current approach?
Thanks again (and sorry for the awkward question…)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.