Introduction¶
The analysis category based on g4tools was added in the Geant4 9.5 release with the aim to provide the users a “light” analysis tool available directly with Geant4 installation without a need to link their Geant4 application with an external analysis package. It consists of the analysis manager classes and it includes also the g4tools package.
g4tools provides code to write and read histograms and ntuples in several formats: ROOT, HDF5, XML AIDA format and CSV (comma-separated values format). It is a part of inlib and exlib libraries, that include also other facilities like fitting and plotting.
The output in HDF5 format (since Geant4 10.4) requires the HDF5 libraries installation as well as Geant4 libraries built with the -DGEANT4_USE_HDF5=ON CMake option.
The analysis classes provide a uniform, user-friendly interface to g4tools and hide the differences according to a selected output technology from the user. They take care of a higher-level management of the g4tools objects (files, histograms and ntuples), handle allocation and removal of the objects in memory and provide the access methods to them via indexes. They are fully integrated in the Geant4 framework: they follow Geant4 coding style and also implement the built-in Geant4 user interface commands that can be used by users to define or configure their analysis objects.
An example of use of analysis manager classes is provided in basic
examples B4 and B5, in their RunAction
and EventAction
classes.