Exercise 1: Manipulation of basic variables

Object: Play around a bit with different energies, particles, magnetic fields, and views.

Note: 'Makefile' included with the distribution might need to modified.

  • If you get messages indicating the library files can't be found, in the `LIBS=...cernlib ... ` line, insert '-v 2000' (or whatever your installation version is) after 'cernlib'. Also, make sure the environment variable CERN is set to '/opt/cern'.

  • If you get a message indicating 'cernlib' can't be found, add /opt/cern/2000/bin (or wherever your CERN installation 'bin' is) to your PATH variable.

See the installation notes for more information.

First, compile and start the program:

> make

Use the command dialog box if using Motif, or use option '1' at startup. (Note: all of the commands below do have Motif navigator equivalents)

To initialize the setup,

GEANT> exec view2




This actually executes the file 'view2.kumac' which is not only used at startup, but also resets the simulation's initial parameters before making any changes in an interactive session. Any file suffixed '.kumac' is a PAW/GEANT macro file, which executes often used interactive commands and special macro commands (see Chapter 11, MACRO in PAW manual, and section XINT002 in the GEANT manual). Looking at 'view2.kumac', you will see two basic types of initializations: display and physics.

There are two 'viewbanks' set up with the combination of 'DOPEN', 'DRAW', 'DCLOSE' commands, along with some extra scales and a header. The 'SATT' interactive command is used in this case to make sure all volumes are visible, as it is possible to selectively hide volumes with this command. Finally, the program has been coded so that turning on the debug flag allows tracks to be displayed as the simulation runs, and this is done by using the 'DEBUG' command.

The reaction types allowed are set by status variables through interactive commands like 'PAIR' and 'BREM'. At some point, the particles being simulated have so low an energy that the use of computational power is excessive for the miniscule improvement in the accuracy in calorimetry or particle movement. So 'CUTS' is used to set the minimum gamma ray and electron energies of interest. 'KINE' is used to set the particle type, its energy, its direction of travel, and its starting point (Note: this is defined by the user can can be different in other GEANT simulations). This can, of course, be overridden in the subroutine 'GUKINE'. Note: call this script BEFORE manually customizing the settings of the aforementioned parameters.

The simulation starts with 50 MeV electrons. Now generate one event:

GEANT> trig 1

You might see something like this:


What you get is probably different than the picture because of the differences in the random numbers being generated. As long as you see a spray of dotted lines, or gamma rays, it is ok.

GEANT> trig 10




Now, reset everything and change energy to 500 MeV:

GEANT> exec view2
GEANT> kine 3 0.5
GEANT> trig 50




Try a couple of different viewpoints,

GEANT> ne
GEANT> draw vol1 30 15
GEANT> trig 50
GEANT> ne
GEANT> draw vol1 75 45 0
GEANT> trig 50




If you find a particularly useful viewpoint, you can set up a 'viewbank' in 'view2.kumac' which you can recall by:

GEANT> dshow 2

where '2' in this case refers the viewbank #2 as defined in 'view2.kumac'.

Now, change to 50 MeV gamma rays,

GEANT> exec view2
GEANT> kine 1
GEANT> trig 50




Go up to 500 MeV,

GEANT> exec view2
GEANT> kine 1 0.5
GEANT> trig 50




Now change the beam angle using the KINE command:

GEANT> exec view2
GEANT> kine 1 0.5 75 320
GEANT> trig 50
This should generate a downward stream of neutral particles and skewed charged particle loops.



To move the starting point to near the far upper corner of VOL1 (without clearing the previous tracks),

GEANT> kine 1 0.5 75 320 -12 10 -10
GEANT> trig 50



Now, it is time to switch the region of the magnetic field. Edit ugeom2.f and change IFIELD in 'Target' to 3, and in 'Drift' to 0. The program should be re-compiled after any change in the fortran files.

> make

GEANT> exec view2
GEANT> trig



GEANT> trig 50




In ugeom2.f, change the strength of the magnetic field, FIELDM, in 'Target' to 20 kG. Then recompile.

>make

GEANT> exec view2
GEANT> trig 50




You can print out some of your plots, or save it to a postscript file.




  [Home] [Next]