Adding AIDA to Geant4

This document is intended to become a proposal to the Geant4 architecture board, after discussion by the AIDA developers.


AIDA is a set of abstract classes which allow analysis code to be written independent of any particular analysis tool. A particular AIDA compliant analysis tool can be selected at link time with no changes to analysis code.

Currently AIDA is used by a number of examples and tutorials in the Geant4 distribution, but there are a number of problems:

  1. The example are not consistent in their use of AIDA.
  2. The same code needs to be repeated in each analysis module.

This proposal aims to address these problems, and at the same time make it easier to use AIDA with Geant4.


The goals of this proposal are to:

  1. Update the examples and tutorials to use AIDA consistently.
  2. Add a simple set of interactive commands for interactively viewing histograms and n-tuples, and for storing histograms and n-tuples to disk.
  3. Document clearly how to use various AIDA compliant tools with Geant4.
  4. Introduce no new external dependences on Geant4
  5. Make it possible for geant4 kernel code to contain diagnostic histograms, which would be turned off by default but which could be activated on demand (optional).

These goals can be achieved without forcing users to use AIDA, it will be just as easy to use any other analysis tool as it is now.


In order to achieve these goals we propose the following:

AIDA Commands

The following minimal set of AIDA commands should be implemented initially. More commands could be added later.

Command Purpose
/aida/load <aida-implementation> Dynamically load a real AIDA implementation. Must be used before any other AIDA commands.
/aida/ls List all analysis objects in the current directory
/aida/cd <directory> Change the current AIDA directory
/aida/plotter <n> <m> Set the default plotter to an n x m grid
/aida/plotter/next Set the default plotter to the next region
/aida/plotter/clear Clears all regions of the default plotter
/aida/plot <path> Plot the analysis object using the default plotter