Apr 1, 2000
Object Oriented Design in PHENIX
Brookhaven National Laboratory
The PHENIX experiment at RHIC is designed for high luminosity and
large diversity of information. Twelve independent sub-detectors
provide a flood of complex data - a challenge for online as well
as offline computing.
The entire software for event reconstruction is now written in
C++, forming some 200,000 lines of code. The only FORTRAN legacy
is found in detector simulation, largely due to the usage of
GEANT3. Several design patterns were implemented to cope with
a number of independent sub-systems and a, consequently,
large number of independent programming styles. To enable data
interchange between different pieces of software, so-called
modules, a tree structure of data in memory has been designed
using composite objects. This package, the PHenix Object Oriented
Library PHOOL, uses Root for DST I/O, but, at the same time, avoids
the overall inheritance from TObject, the Root-system base-class,
and thus maintains flexibility and, even more important, type-safety.
This is achieved by the extensive usage of encapsulation, multiple
inheritance and run-time type-information.
In the same general spirit of shielding the user from direct usage
of a package, a set of wrapper classes has been designed which manages
the storage of calibration constants in an Objectivity-database.
The talk will describe the implementation of these techniques, give
examples of encountered (and solved) problems and report on the successful
use in the, so called, mock data challenges.