GEAMAG routines and files, compilation & execution

Linux or Unix?

Much of GEAMAG is independent of the operating system. The only significant differences are in the linking with CERNLIB (see "Compilation and Linking" below) and that consequently the CERN library random number generator is not available under Linux. Instead one uses the GEANT one, and the Gaussian distribution of random numbers is given by the function APHERF in the file distgau.f, which I have extracted from the ZGOUBI source.

The compilation switch from Unix to Linux is facilitated by the Boolean flag LINUX in the file UOPSYS.inc.

UGEOM

As its name implies, the UGEOM subroutine is where the geometry of the experiment is defined. But there is much more to both UGEOM and the file geageom.f. Materials and tracking media are also defined here. Most of the principal geometrical definitions are set in the include file UGEOM.inc. There is also a logical (boolean) variable "flip_dipole" which controls whether the dipole bends to the beam-right (.FALSE.) or beam-left (.TRUE.). The origin of particles (i.e., the target location) is at (x,y,z) = (0,0,-200).

GUKINE

The subroutine GUKINE is where the origin of each event is defined in co-ordinate and vector momemtum space. The particle type is also be defined here. Some or all of these parameters are taken from the KINE card of the input .dat file, in which case they are fixed for all events. This is almost always the case for interactive GEANT (although a KINE card can be input interactively to change these parameters). For GEAMAG, the parameters on the KINE card are used as follows:

KINE itype xi yi zi |p| qi fi BDip B/rquad

where, following the GEANT convention, distances are in cm, the momemtum is in GeV/c, angles are in degrees and fields are in kG. itype defines the particle type, as given in the GEANT manual (section CONS300). for numbers up to 112. Note that particle types 1 through 50 are tracked by GTELEC, GTHADR, GTMUON, etc., whereas particle types 61 through 112 are tracked by GTHION. Particles tracked by GTHION (in yellow in the table below) are treated differently to those tracked by other routines: an effective charge state Qeff is defined for energy-loss and straggling in media (including vacuum). Particles tracked by GTHADR (in red in the table below) keep the same charge state. Also, particles tracked by GTHION do not generate delta rays or decay into other particles, even if the lifetime is defined to be short. Additional particle types can be defined beyond 112; this is done by the routine GSPART in the file geageom.f.

List of some common particle types used in GEAMAG.
Particle No. Mass (GeV) Charge
Proton 14 0.93956563 1
Alpha 47 3.727417 2
Li6 61 5.60305 3
O16 69 14.89917 8

For the batch version of GEAMAG, we have often taken the convention that itype > 200 in the KINE card will active Monte Carlo parameter generation that overrides the default variables. Usually in this case the particle type is taken as (itype - 200), although sometimes the GUKINE routine is written to generate itype independently of the value in the KINE card.

List of archived GUKINE source files.
File nameComment
gukine.TOF TOF resln test. 38,39Ca with specific momenta. 80% of cts in g.s.
gukine.apres DE test with 36Ar,39K,40Ca,45Sc. q = 35.5 - 65.5, thus origin of particle should be after the dipole.
gukine.dE DE test with 39,40Ti,38-40Sc,38,39Ca, assumes reaction for 40Ca starts in middle of f.p.
gukine.dEch DE test with 39,40Ti,38-40Sc,38,39Ca, ground state peaks. Possibility to generate charge states (or fix them).
gukine.fullacc p=p0,p0+/-5%,p=p0+/-10%, fixed q=3, full angle acceptance. qi = 11.5 * RNDML(2) - 5.2 dg, fi = 14.9 * RNDML(3) - 7.45
gukine.mold Old version of momentum resolution test. p=p0,p0+/-5%, p=p0+/-10%, qi = 8.0 * RNDML(6) - 4.0, fi = 14.9 * RNDML(7) - 7.45
gukine.mom Momentum resolution test, for 7Li, 16O or 40Ca. Restricted qi, fi, p=p0,p0+/-5%,p=p0+/-10%
gukine.rotfp Rotated detector wrt f.p. 3 possible cases for qi ("x_ang") to be changed by hand. 5 momenta. Charge state fixed to 8, so run with 16O.
gukine.7Be Study of states in 14B from the (7Li,7Be) reaction. Kinematic factor = 0.15. Charge state fixed to 3. See ref. [1].
gukine.trojan Study of "Trojan Horse" method to measure astrophysical 12C + a resonant reaction via 6Li(12C,12Ca)d.

Ntuples

The batch version of GEAMAG creates a structured event file called an "ntuple". This is then analysed interactively with PAW. To set up the ntuple in GEAMAG, first the ntuple length must be defined in the Fortran INCLUDE file UNTPLE.inc. Then in geabat_subs.f the labels and parameters should be set in the routines UHINIT and GUOUT, respectively. Typical parameters of interest are:

The energy loss and TOF parameters could be corrected for qfoc by a polynominal function.

Compilation and Linking

The link files have the same name under Unix and Linux, although some details differ internally in the compilation line.
link file name executable file
Interactive complinkgea-int geantX11
Batch complinkgea-bat geant

Under Linux, you need to type "source complinkgea-int", etc. If the compilation is successful, the executable file is moved to the $HOME/bin directory. If you get the obscure message "No cigar", the compilation has failed.

Execution

.dat files

Always run the program (interactive or batch) from the /geamag directory where the dipole field map (zgoubi.res) is stored. Then the input .dat file, which should be kept on the geamag/dat directory, needs the path dat/ to be entered. The naming convention for .dat files for interactive GEAMAG is geamag_mSYM.dat, the corresponding names for batch GEAMAG is geabat_mSYM.dat, where "m" is the atomic mass and "SYM" is the chemical symbol of a particular ion species. Do not try to mix the interactive and batch files!

Some input .dat files.
Particle Energy (MeV) Interactive Batch
Proton 30 geamag_H
7Li 49 geamag_7Li geabat_7Li
16O 135 geamag_16O geabat_16O
16O 74 geamag_16O_bis geabat_16O_bis
40Ca 167 geamag_40Ca geabat_40Ca

These files contain the default KINE command and various initialisation options. For the batch files, the number of events is specified here (TRIG nevt). Since the execution time is obviously dependent on this, it should be adjusted with care. For most jobs, < 5000 events are enough, although heavy ions (A ~ 40) sometimes need more counts because of broader peaks. It is recommended that short (nevt < 500) tests are tried before final runs.

.kumac files (interactive GEAMAG)

For the interactive version, one needs to enter the path kum/ before the name of the .kumac files. This sounds a bit cumbersome at first, but, since previously entered commands can be recalled with the up-arrow key, it is a small price to pay for the resulting organisational sanity. The .kumac files fall into two categories: the simple drawing routines and the routines to trace a set of "rays" through the system. For the drawing routines, it is recommended always to start with draw_mrs.kumac. This initialises colours and seen/unseen volumes that other drawing .kumac files may depend on.

Batch submission

The batch version is normally run on Unix with a short input file run_geant piped into the command line:

nice -0 nohup bin/geant < run_geant > geant.out
where the output is directed into the file geant.out. The job can then be run in the background (by entering a CTRL/Z to temporarily suspend the job, followed by typing bg. Under Linux, one justs types geant and answer the prompts. GEAMAG makes a record every hundred event ("100", "200", etc.) so that by viewing the file geant.out, you can monitor the progress of your job. The input file run_geant merely contains the name of the .dat file and the name of the ntuple output file. By convention, the output ntuple is put on geamag/paw with the file extension ".ntp".

.log files

Both the interactive and batch versions make log files (geantx11.log and geant.log, respectively). Diagnostic output to unit 23 from GEAMAG (but not from GEANT) is written here. These files can be inspected in case of problems or unusual events. Note that they are overwritten each time the program is run.

Bibliography

[1] S. Orrigo, "Spettroscopia del 14B via (7Li,7Be): Test e progetto di misura con MAGNEX", Tesi di Laurea, University of Catania (2001).

[2] Baudinet and Robinet, Nucl. Instrum. Methods 190 (1981) 197.


 
Back to Melbeck's Home page Back to GEAMAG index

Last modified: 18 March 2002