Simulation resulting in multiple o2sim trees

I noticed that o2-sim is resulting in several copies of the o2sim tree in o2sim.root. Each event creates a new tree. For 30 events I get this
image
The file grows exponentially with the number of events since each new copy of the tree contains not only data from one event, but all previous ones.

This happens only when running o2-sim but not for o2-sim-serial. Looks like a bug in the Merger process.

Are you sure the actually storage grows exponentially? In my understanding this is merely an increasing version number of the tree resulting from multiple “tree->Write()” operations.

Ok: tree->Write("", TObject::kOverwrite); // save only the new version of the tree

seems to be needed.

A quick comparison between simulations with 100 events with 100 muons each, with and without serialization:

7.4M -> o2-sim
2,8M -> o2-sim-serial

I run overnight with 100000 events and the file size filled my HD with more than 700GB of data.

Fair enough.

This should be fixed now.

1 Like