Isa Heinze

Email: <isa DOT heinze AT SPAMFREE desy DOT de>


Some commands I have to look up again and again




Setting correct path to CMakeModules: cmake -DCMAKE_MODULE_PATH=/afs/ -C /afs/ ..

How to create single muons in the ILD with Mokka

Commandline options:

-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.

Other Mokka Commands

Check which parameters were set for the gun:

Idle> /gun/info

Create particles:

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.

The commands can also written into a macro file which can then be executed by

Idle> /control/execute <filename>

One can also do

Idle> /run/beamOn 100 macrofilename

This will create 100 events with particles defined in the macrofile.

To execute a macro file several times one can also use /control/loop [macrofile] [counterName] [start] [end] [steps].

Idle> /control/loop macrofilename EvtNum 0 99 1

Mokka Macro Files

A macro file looks like this:

#Mokka -MILD_O1_v02 -lmyMacroTest.slcio
/generator/generator particleGun
/gun/position 0 0 0
/gun/direction 0 1 0
/gun/particle mu-
/gun/momentum 1.5 GeV
/run/beamOn 1000

*.HEPEvt Files

It is also possible to write a file which specifies the number of particles in the event, the type of particles and their momenta.

1 13 0 0 0.0 3.0 0.0 1.06e-01
1 13 0 0 3.0 0.0 0.0 1.06e-01

The first line gives the number of (initial) particles in the event followed by one line per particle.

<status> <pdgid> 0 0 <px> <py> <pz> <mass>

The file needs to be called *.HEPEvt. Then one can type

Idle> /generator/generator *.HEPEvt
Idle> /run/beamOn

This only works for single events, to create more than one event use macros.

More on the usage of Mokka can be found here.


IsaHeinze (last edited 2012-11-30 15:28:16 by IsaHeinze)