I have the necessity to let various independent data analysis object to write their event description objects in the same file. I see two ways of doing this:
-
Create a single tree in the output file, each data analysis object creates its own branch in this tree, in the event loop each data analysis object updates its write buffers and then TTree::fill is called once per event by a centralized tree management service
-
Each data analysis object creates its own tree in the output file and manages it exclusively (create branch and call TTree::Fill once per event)
I am concerned about the performance of reading a file built in one of the above ways. According to this twiki page solution 2 is going to produce files with slow readout. But it’s still appealing to me because it allows for a looser coupling of data analysis objects. I think that a final answer like “you’ll increase read time by x%” does not exist and that the difference of the two solutions above depends strongly on the specific content of the file, but nevertheless I’d like to know if there is any general consideration that can be done to roughly evaluate when the performance loss of solution 2 will be large.
Thanks.