Overview Contents Previous Next Geant4 User's Guide
For Application Developers
Geometry


4.1.10 Converting Geometries from Geant 3.21

Approach

G3toG4 is the Geant4 facility to convert GEANT 3.21 geometries into Geant4. This is done in two stages:

  1. The user supplies a GEANT 3.21 RZ-file (.rz) containing the initialization data structures. An executable rztog4 reads this file and produces an ASCII call list file containing instructions on how to build the geometry. The source code of rztog4 is FORTRAN.
  2. A call list interpreter (G4BuildGeom.cc) reads these instructions and builds the geometry in the user's client code for Geant4.

Importing converted geometries into Geant4

Two examples of how to use the call list interpreter are supplied in the directory examples/extended/g3tog4:

  1. cltog4 is a simple example which simply invokes the call list interpreter method G4BuildGeom from the G3toG4DetectorConstruction class, builds the geometry and exits.
  2. clGeometry, is more complete and is patterned as for the novice Geant4 examples. It also invokes the call list interpreter, but in addition, allows the geometry to be visualized and particles to be tracked.
To compile and build the G3toG4 libraries, you need to have set in your environment the variable G4LIB_BUILD_G3TOG4 at the time of installation. The G3toG4 libraries are not built by default. Then, simply type
  gmake
from the top-level source/g3tog4 directory.

To build the converter executable rztog4, simply type

  gmake bin
To make everything, simply type:
  gmake global
To remove all G3toG4 libraries, executables and .d files, simply type
  gmake clean
Current Status

The package has been tested with the geometries from experiments like: BaBar, CMS, Atlas, Alice, Zeus, L3, and Opal.
Here is a comprehensive list of features supported and not supported or implemented in the current version of the package:


About the authors