Version and header info recorded in root output

Issue #109 resolved
Laurie Nevay created an issue

Proposal: We introduce a header structure / map to the root output file.

The primary purpose being to differentiate between data file versions. We had the original root format, the current one we've used for a while, I'm working on reducing into a simple and detailed split, and Stewart is working on a new root file format altogether. If we have extra information in the file, we can differentiate which classes to use in analysis while maintaining backwards compatibility.

ROOT has a TMap class, but this is inferior to std::map. You can write an std::map to a TFile but there are a few questions which I'm not sure of because of root:

1) Is it possible to write the map to the file and update it later? Ie append to the map as we go along through the program - you'd still want to have certain information even if BDSIM was killed.

2) Is there some heavy #pragma wizardry needed for the necessary dictionary support?

The CLHEP random number generator seed states could also be saved, but these require an std::ostream and std::istream to write and read a seed state (typically text file).

Possible entries: file version bdsim version date seed number of events platform map of all bdsim options (full recreatability) map of beam distribution parameters

The file version is the obvious and easy addition, but with this we could have very strong reproducibility.

Comments (2)

  1. Laurie Nevay reporter

    The options used to run BDSIM are stored in the root output now. ExecOptions is a set of options that is merged with options from the parser and the final set stored. Events can be recreated fully using the root output file. The seed state is stored per event in the root output and we have ensured that Geant4 is built with the external CLHEP library (required for our beam distribution generators) so that both Geant4 and BDSIM use the same random number generator at run time.

    Additionally, the CMake scripts have been extended to configure the options header with the exact git commit the software is built from which is recorded in the options so we know the exact version of BDSIM used to generate the data.

  2. Log in to comment