     =========================================================
     Geant4 - an Object-Oriented Toolkit for Simulation in HEP
     =========================================================


                               HADR02

		     V.Ivanchenko, A.Ivanchenko
                       CERN, Geneva, Switzerland
        	     Geant4 Associate International
		University of Bordeaux, CENBG/IN2P3/CNRS
                     (ESA contract 22712/09/NL/AT)


This example application iproviding simulation of ion beam interaction with different 
targets. Hadronic aspects of beam target interaction are demonstrating in the example 
including longitudinal profile of energy deposition, spectra of secondary  particles,
isotope production spectra. The results are presenting in a form of average numbers 
and histograms. All ion/ion models of Geant4 are available and also the interface to
the FORTRAN code DPMJET-2.5 developed by J.Ranft for FLUKA. The interface was developed
by P.Truscott (QinetiQ, UK) under European Space Agency (ESA) contract 19770/06/NL/JD. 


	                  INSTALLATION

For simulation with Geant4 native models installation procedure is the same as for 
other examples. In order to use DPMJET additional installation steps are required.
It is recommended to use DPMJET with SLC5 64 bit PC with gcc4.3.2 or newer compiler. 

Two environment variables should be defined:

        G4DPMJET2_5DATA - path to Glauber data
        CERNLIB         - path to cernlib library
        G4_USE_DPMJET   - flag of DPMJET activation

To run the example with DPMJET:

  	$G4WORKDIR/bin/Linux-g++/hadr02 dpmjet.in QGSP_BIC

The last parameter is optional. It is the name of Geant4 reference Physics List on
top of which a new ion physics is added. Alternatively Physics List can be defined via 
environment variable

        setenv PHYSLIST QGSP_BIC


                           GEOMETRY

The Target volume is a cylinder placed inside Check cylindrical volume. The 
Check volume is placed inside the World volume. The radius and the length of
the Check volume are 1 mm larger than the radius and the length of the Target.
The material of the Check volume is the same as the World material. The World
volume has the sizes 10 mm larger than that of the Target volume. Any material
from the Geant4 database can be defined. The default World  material is
G4Galactic and the default  Target material is aluminum. The Target is
subdivided on number of equal slices. Following UI commands are available to
modify the geometry:

/testhadr/TargetMat     G4_Pb
/testhadr/WorldMat      G4_AIR
/testhadr/TargetRadius  10 mm
/testhadr/TargetLength  20 cm
/testhadr/NumberDivZ    200

Beam direction coincides with the target axis and is Z axis in the global
coordinate system. G4ParticleGun is used as a primary generator. The energy 
and the type of the beam can be defined via standard UI commands

/gun/energy   150 GeV
/gun/particle ion
/gun/ion 6 12

Default beam position is -(targetHalfLength + 5*mm) and direction along Z axis.
Beam position and direction can be changed by gun UI commands:

/gun/position  1 10 3 mm
/gun/direction 1 0 0

however, position command is active only if before it the flag is set

/testhadr/DefaultBeamPosition false   
 
                           SCORING

The scoring is performed with the help of UserStackingAction class and two
sensitive detector  classes: one associated with a target slice, another with
the Check volume. Each secondary particle is scored by the StackingAction.  In
the StackingAction it is also possible to kill all or only EM (e+, e-, gamma)
secondary particles 

/testhadr/killAll     
/testhadr/KillEM  

To control running the following options are available:

/testhadr/PrintModulo      10


                           PHYSICS

PhysicsList of the application uses components, which are distributed with
Geant4 in /geant4/physics_lists subdirectory. 

Reference Physics Lists are used and the environment variable PHYSLIST should 
be defined. 

Additionally it is possible to add ion-ion interactions using UI command

/testhadr/ionPhysics   DPMJET
/testhadr/ionPhysics   FTF


                          VISUALIZATION

For interactive mode G4 visualization options and variables should be
defined, then the example should be recompiled:

gmake visclean
gmake

The vis.mac file can be used an example of visualization. The following command can 
be used:

/testhadr/DrawTracks  charged
/testhadr/DrawTracks  charged+n
/testhadr/DrawTracks  neutral
/testhadr/DrawTracks  all


                          HISTOGRAMS

To use histograms any of implementations of AIDA interfaces should
be available (see http://aida.freehep.org).

A package including AIDA and extended interfaces also using Python
is PI, available from: http://cern.ch/pi .

Once installed PI or PI-Lite in a specified local area $PI_DIR, it is
required to add the installation path to $PATH, i.e. for example,
for release 1.2.1 of PI:

setenv PATH ${PATH}:$PI_DIR/1.3.12/app/releases/PI/PI_1_3_12/slc3_gcc323/bin

CERN users can use the PATH to the LCG area on AFS.

Before compilation of the example it is optimal to clean up old 
files:

gmake histclean
setenv G4ANALYSIS_USE 1
gmake

Before running the example the command should be issued:

eval `aida-config --runtime csh`

It is possible to choose the format of the output file with 
histograms using UI command:

/testhadr/HistoName   name
/testhadr/HistoType   type

The following types are available: hbook, root, aida. They will be 
stored in the file "name.hbook", "name.root", or "name.aida". 
If the environment variable HISTODIR is defined, files are stored in this 
subdirectory.

To show the content of a histogram ID=i the commands may be applied:

/testhadr/HistoPrint  i

All histograms are normalized to the number of events.

