How to Mokka

How to Mokka simulation
A very simple example for a bash user to run Mokka with ILD_00 detector model is

$ . /proj/soft/ilcsoft/v01-06/Mokka/mokka-06-07-patch01/build_env.sh
$ export LD_LIBRARY_PATH=${CLHEP_BASE_DIR}/lib:${LD_LIBRARY_PATH}
$ Mokka mokka.steer < mokka.g4

where mokka.steer and mokka.g4 are files for parameters. Parameters to be modified in these files are as follows:
 

  • mokka.steer
    • %%START_EVENT_NUMBER%%(integer)
      If this is not 0, the first %%START_EVENT_NUMBER%%-th events are skipped before start Mokka simulation.
    • %%LCIO_FILENAME%%(string)
      The name of the output file of mokka simulation.
    • %%Mokka_dbHost%%(IP address)
      The name of the MySQL database server. If this line is not present, Mokka gets the information from the default host.
    • %%LCIO_PROCESS_NAME%%(string)
      A string defined here is stored in the output LCIO file as the process name of the input generator.
    • %%LCIO_CROSS_SECTION%%(float)
      A float value defined here is stored in the output LCIO file as the cross section of the input generator
  • mokka.g4
    Any geant4 command can be written in this file. This example shows a minimum inputs to run Mokka simulation. A user should modify following two parts.
    • %%MOKKA_INPUT%%(string)
      A name of the input generator file. It should be in a stdhep format.
    • %%NUMBER_OF_EVENTS%%(integer)
      The number of events to be simulated.

For more information, please see Mokka Homepage
 

Mokka display
Mokka can be used to draw a detector geometry. To do this, just run Mokka as described in the above, but change the geant4 command file, mokka.g4, to include Geant4's display commands or omit it to run interactively, i.e.,

$ Mokka mokka.steer
.... (Mokka initialization message)
Idle>

When Idle> is shown, a user is ready to enter display command.
Sample commands are shown below.
Display vertex detector geometry
Idle> /control/execute
drawvtx.g4
drawvtx.g4 calls setInvisible.g4 to disable geometry other than Vertex detector. The ILD_00 model in Mokka defines all geometries for vertex detector in world volume, thus volumes other than vertex detector need to be set invisible to display only vertex detector.

Display EM CAL
Idle> /vis/open OGLIX 700 700
Idle> /control/execute drawecal.g4
This command will display one module of EMCAL. /vis/open OGLIX ... command is to open X window for display. 700 700 is a window size in X and Y. Use window size you like.

Other useful information would be obtained by help command. Some useful commands are listed in hints.txt.
List of all geometry would be obtained by
Idle> /vis/ASCIITree/verbose 4
Idle> /vis/drawTree
 

Useful tips