How to create an interface between UrQMD and GEANT4 toolkit

:: for GEANT4 developers only!

-- KhaledAbdelWaged - 06-Feb-2012

This page provides installation requirements and instructions of the Geant4 -UrQMD interace. This interface is developed by Khaled Abdel-Waged et al., and sponsered by KACST /NCMP under the contract number 31-465.

Software installation requirements

The Geant4 interface to UrQMD-1.3cr Fortran code uses the following software tools and packages:

  1. UrQMD-1.3cr Event Generator (in its original Fortran implementation)
  2. Geant4 version: ver.9.3.p01
The interface and original UrQMD-1.3cr source code have been compiled and tested using:
  1. gcc 4.1.2 with g77 (FORTRAN77 and GNUmake)

Operating systems used for this test is : Red Hat Linux 4.1.2-64

Overall interface design

The use of UrQMD-1.3cr physics in Geant4 has resulted in the introduction of a new event model (G4UrQMD1_3Model).

The general steps in the logical sequence are determined by:

  1. Instantiation of the G4UrQMD1_3Model process.
  2. Generation of interaction events.

Instantiation of G4UrQMD1_3Model

Upon instantiation of Geant4 -UrQMD interface, the class constructor initialises variables associated with the class and the UrQMD-1.3cr FORTRAN model. The latter involves initialisation of a series of common-block variables from the C++ code, mimicking the initialisation process performed by the FORTRAN code when used in standalone mode.

Generation of interaction events

In order to generate interaction events, the ApplyYourself member function of Geant4 is executed. The details of the projectile and target are determined (e.g., mass number, charge, projectile energy…). The FORTRAN subroutine UrQMD() is called from ApplyYourself. Upon completion of the UrQMD event, the information on the secondary particles generated are transferred to the product vector.

If no data exist for the specific projectile-target combination, a “Warning” is declared, and the run is stopped.

Class structure for model

The interface comprises G4UrQMD1_3Model class, which is derived from G4HadronicInteraction, and is defined within the Geant4 user physics list if access to UrQMD1_3physics is required. It controls initialisation of UrQMD-1.3cr through common block variables.

A small FORTRAN subroutine is included with the G4UrQMD distribution. This is required to ensure that block data initialisation in G4UrQMD1_3Model is performed (through FORTRAN EXTERNAL statements). Specifically the new FORTRAN subroutine is:

  1. g4urqmdblockdata.f

Installing UrQMD-1.3cr and building the libG4hadronic_urqmd13 library

Copy the file g4urqmd-1.3cr.2012.tar to the directory:

cd $G4INSTALL/source/processes/hadronic/models

Untar the files, e.g.:

tar –xvzf g4urqmd-1.3cr.2012.tar

This creates the UrQMD13 directory, which contains UrQMDsrc, include and src directories. Note that the header (G4UrQMD1_3Interface.hh & G4UrQMD1_3Model.hh) and C++ ( files are in UrQMD13/include and UrQMD13/src, respectively.

Execute the script patch_make_and_install.csh from the directory UrQMD13. This executes a patch script and compiles all the relevant FORTRAN files in UrQMD13src, and copies the object files to the directory:


Change directory and execute make on the C++ source:

cd ..


This will build the library:


Ensure that the GNUmakefile for you application (in UrQMD13 directory) includes the following lines:

CPPFLAGS += -I$(G4BASE)/processes/hadronic/models/UrQMD13/include

The main () program

Geant4 does not provide the main(). In the main(), one has to construct G4ProcessManager, in order to process a run for the interface.

Ensure that the GNUmakefile for you application (in “main” directory) includes the following lines:

CPPFLAGS += -I$(G4BASE)/processes/hadronic/models/UrQMD13/include

EXTRALIBS += -L$(G4INSTALL)/lib/$(G4SYSTEM)–lG4hadronic_UrQMD13



cd $(G4BASE)/processes/hadronic/models/UrQMD13; $(MAKE)

Download G4UrQMD-1.3cr.2012.tar

* G4UrQMD-1.3cr.2012.tar

Edit | Attach | Watch | Print version | History: r20 < r19 < r18 < r17 < r16 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r18 - 2012-02-16 - KhaledAbdelWaged
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Sandbox All webs login

  • Edit
  • Attach
This site is powered by the TWiki collaboration platform Powered by PerlCopyright &© 2008-2021 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback