celeritas icon indicating copy to clipboard operation
celeritas copied to clipboard

Update celer-g4 ROOT I/O

Open stognini opened this issue 1 year ago • 0 comments

The ROOT I/O system in the celer-g4 integration app is currently fully managed by a single class (RootIO) that manages all the data, all the ROOT files (for each thread), and the merging of in-memory TFiles from worker threads into a final ROOT file in the master thread that is written to disk.

An overhaul of the I/O system includes:

  • Making ROOT a build option (currently a requirement), for different output implementations (simple diagnostics, ADIOS, and so on).
  • Easier maintainability by splitting different purposes to different classes:
    • RootFileManager would manage all in-memory TFiles from different threads.
    • A new class would manage thread-local TTree data storage for hit data.
    • A new class would manage ROOT histograms for quick validation and small output files.
    • A new class would manage the merging of the in-memory files if needed. Since different threads manage different events, each file is still a complete file, and celer-g4 could simply write all thread-local files to disk. Analyses would loop over multiple files or possibly just use ROOT's hadd command line tool to merge them.

stognini avatar Feb 13 '24 20:02 stognini