To get a local Mokka installation from the CVS repository:
$ export CVSROOT=:pserver:firstname.lastname@example.org:/home/flc/cvs $ cvs login $ Passwd: %ilc% $ cvs co -r HEAD Mokka
This will checkout (co) the directory (-r) version HEAD of Mokka as a tar compressed file. To unpack this file type
$ tar -xzvf Mokka-mokka-XX-YY.tgz
where mokka-XX-YY is the tag name.
Before installation you have to set the environment. Therefore, adjust the env.sh script to the latest available versions of lcio, clhep, ...
$ . env.sh
Now you can build Mokka:
$ cd source $ make
If you have problems building Mokka and the error messages point to the "mysql.h" file not found, check if you have set MySQL variables in your environment (e.g. ~/.zshrc). As described in this ilc forum thread under "IV. Revised Makefiles to Locate mysql Headers and Libraries", Mokka has several ways to find the MySQL directories:
- Use mysql_INCLUDEDIR and mysql_LIBDIR, if defined
- Use mysql_PATH, if defined
- Use the "mysql_config" tool, if known to the shell (i.e. in the PATH)
- Use "/usr/lib/mysql" and "/usr/include/mysql" as a default
These can interfere with other path settings you made.
$ ./bin/Linux-g++/Mokka mokka.steer
Getting an Overview
You can have a look at which detector models are currently available in Mokka, and how these detectors are build in the Mokka Detector Model Database Browser
Incase you want to visualize the detector and / or particles, use the event displays available in Mokka.
Idle > /vis/scene/create Idle > /vis/scene/add/trajectories Idle > /vis/open OGLIX (OGLIXm / OGLSX / OGLSXm) Idle > /generator/generator particleGun Idle > /gun/energy 10 GeV Idle > /gun/particle gamma Idle > /Mokka/Draw 1 Idle > /step/draw 1 Idle > /vis/viewer/refresh Idle > /run/beamOn
- OGLIX = OpenGLImmediateX
- OGLIXm = OpenGLImmediateXm
- OGLSX = OpenGLStoredX
- OGLSXm = OpenGLStoredXm
The 'm' option allows for easy rotation, zoom, ... without this can be handled by line commands:
Idle > /vis/viewer/set/viewpointThetaPhi 90 0 Idle > /vis/viewer/zoomTo 2
Modifying the physics list
How to modify the physics list is described in Geant4.
What the particles are doing
Find out all about your particles with
Idle> /particle/list Idle> /particle/select pi0 Idle> /particle/property/dump Idle> /particle/process/dump
-M: specify the detector model
-l: name of an lcio file where output should be written to
-S: subdetector to be used (for whole detector leave it out, list of all available subdetectors can be found in the Mokka Detector Model Database Browser)
Mokka -MILD_O1_v02 -Stpc10_01 -lmyLCIOFile.slcio
Create a particle gun, set position, set direction, set energy, set particle type (here muon), set momentum (overwrites energy!), set step by which momentum should be changed for each created particle, set amount of smearing:
Idle> /generator/generator particleGun Idle> /gun/position 0 0 0 Idle> /gun/direction 0 1 0 Idle> /gun/energy 3 GeV Idle> /gun/particle mu- Idle> /gun/momentum 1GeV Idle> /gun/momentumStep 1 GeV Idle> /gun/momentumSmearing 0.1 GeV
For further parameters which can be set check the release note release_notes_mokka-05-02.
For help just type
This prints all commands that are available.
The commands can also written into a macro file which can then be executed by
Idle> /control/execute <filename>
An example macro file can be found here.
Check which parameters were set for the gun:
Idle> /run/beamOn 10
The number (here 10) gives the number of particles to be created. For each of these particles one event is written to the lcio file containing the initial particle as well as its daughters.