ATLFAST
The ATLAS Fast Simulation Program
René Brun
CERN/IT
Fons Rademakers
GSI/Darmstadt and Hewlett-Packard
Elzbieta Richter-Was
Krakow/Atlas
Abstract
ATLFast is the fast ATLAS MonteCarlo and reconstruction program.
It is based on the ROOT collection classes, data base and graphics.
ATLFast has been designed as a general framework illustrating how to
develop independent modules (called Makers), but communicating via
a common object-bus and data base.
ATLFast includes a simple but powerful event display package.
A detailed information can be found at http://root.cern.ch/root/Atlfast.html.
ATLFast originally written in Fortran has been converted to C++
using the ROOT container classes, Input/Output and graphics facilities.
It is an interesting application that shows how to use several
important facets of the ROOT system:
-
How to organize a program in modules (the Makers)
-
How to mix compiled and interpreted code
-
How to manage histograms in each module
-
How to use the TClonesArray class to store results
-
How to create a ROOT Tree using the TClonesArray
-
How to save the Run parameters in the output file
-
How to call Fortran from C++
-
How to build an event display class
-
How to use the ROOT browser
1. Program control
The ATLFAST program is managed by the
ATLFast class.
An example of a ROOT macro invoking this class is shown below.

The program is organized as a pipeline of processes (called Makers).
The following makers are implemented:
The input to one Maker is the output of another Maker. For example,
A list of histograms is attached to each maker.
The data generated by all makers are automatically saved into
a TTree.
The following information is saved into the ROOT data base:
- Program parameters. The ATLFast object as well as all Maker
objects are saved. An analysis program knows the exact
parameters used to produce the current data base.
- The list of histograms from each maker.
- The list of objects produced for each event.
The Tree called "T" in ATLFast is automatically built from
the class model. The generation of branches is automatic for each maker. In turn,
each attribute of the result objects goes into a separate branch. This organisation
has the following advantages:
- It preserves the original object model.
- The organisation of containers in the data base is automatic
and optimal for data analysis.
- The data compression algorithm is optimum because branch buffers contain
homogeneous data types.

2. ATLFMaker: General Principles
ATLFMaker
is the base class for all Makers. It provides the followng functions:
- The constructor automatically adds the maker to the list
of Makers in the
ATLFast object.
- The Browse function provides a default functionality (usually sufficient)
to browse the products of this maker.
- The Clear function called at the end of each event removes the event objects
from the TClonesArray list.
- The Draw function controls the event display for this Maker.
- The MakeBranch function is called by
ATLFast::MakeTree.
It creates the Tree branch for the TClonesArray or TObject result product of this Maker.
- The SetChainAddress function is called by
ATLFast::SetChainAddress
in case a list of ROOT files must be analyzed. It takes care of setting the
appropriate TClonesArray address when reading each file in the chain.
3. Event Display
A simple event display class
ATLFDisplay
can be used to show front/side/top views of one event. Pressing the X3D
button in the menu will invoke the 3-D ROOT viewer with the possibility
to rotate and zoom in the event. An alternative 3-D viewer based on OPENGL
is also available.

4. The Object Inspector
When moving the mouse to any object in the display area, one can inspect
this object. A new window is created with the dump of the corresponding object (data
member name, value and title). If the data member is a pointer
to another object, you can click on the pointer to inspect the pointed object, etc.
In the same way, selecting the DrawClass item in the context menu
will display the class inheritance tree in a separate window.
For example, the following picture has been produced
by pointing to a track with the right mouse button and selecting
the Inspect item.

5. The browser
One can use the ROOT browser to naviguate in the Makers structures
and products. The browser shows two panes: the containers pane and the objects pane.
In the containers pane (left), you see the list of browsable containers.
Click on the ATLFast container to see new containers:
- The Tree "T".
- The histograms containers.
- The BigBang.
- The Makers containers.
Clicking on T shows the corresponding maker branches. For example,
selecting Clusters will display in the right pane all the attributes
of ATLFCluster. Clicking on one attribute will automatically
loop on all events, for each event on all clusters, and then histogram
this attribute.
Clicking on Histograms container displays a similar organisation.
Selecting Clustermaker will show in the right pane the list
of standard histograms for the Clustermaker. Click on one histogram
to draw it. Using the right mouse button instead, gives a choice of different
functions (fit,etc.). Once an histogram is displayed in the graphics canvas, you can point
to the histogram contour with the right mouse button
and select one of the proposed actions. You can produce a Postscript file of the
picture in the canvas by selecting the item Save as canvas.ps in the canvas
File menu.

By selecting the BigBang entry in the left pane of the browser,
one can naviguate in the event genealogy.

Acknowledgements
The authors are particularly grateful to Daniel Froidevaux from the ATLAS
collaboration for supporting this project and to Leanne Guy
from ATLAS who has recently extended the functionality of this package.
Many thanks to many other physicists from the ATLAS collaboration
for many useful comments.