55Here are pointers on how to use ` GeneratorHepMC ` selected by the
66option ` -g hepmc ` for ` o2-sim ` .
77
8- ## Reading HepMC files
8+ ## Reading HepMC files
99
1010The generator ` GeneratorHepMC ` can read events from a
11- [ HepMC(3)] ( http://hepmc.web.cern.ch/hepmc/ ) formatted file. These files
12- can be produced by a standalone event generator program (EG).
13- Examples of such programs are
11+ [ HepMC(3)] ( http://hepmc.web.cern.ch/hepmc/ ) formatted file. These
12+ files can be produced by a standalone event generator program (EG).
13+ Examples of such programs are
1414
1515- [ Pythia8] ( https://pythia.org )
16- - The [ CRMC] ( https://gitlab.iap.kit.edu/AirShowerPhysics/crmc ) suite
16+ - The [ CRMC] ( https://gitlab.iap.kit.edu/AirShowerPhysics/crmc ) suite
1717- [ Herwig] ( https://herwig.hepforge.org/ )
1818- [ SMASH] ( https://smash-transport.github.io/ )
19- - ... and many others
19+ - ... and many others
2020
2121Please refer to the documentation of these for more on how to make
2222event files in the HepMC format.
2323
24- To make a simulation reading from the file ` events.hepmc ` , do
25-
24+ To make a simulation reading from the file ` events.hepmc ` , do
2625 o2-sim -g hepmc --configKeyValues "HepMC.fileName=events.hepmc" ...
2726
2827See also [ ` read.sh ` ] ( read.sh )
2928
30- ## Reading HepMC events from child process
31-
29+ ## Reading HepMC events from child process
3230` GeneratorHepMC ` can not only read HepMC events from a file, but can
3331also spawn an child EG to produce events. Suppose we have a program
3432named ` eg ` which is some EG that writes HepMC event records to the
3533standard output. Then we can execute a simulation using this external
36- EG by
37-
34+ EG by
3835 o2-sim -g hepmc --configKeyValues "HepMC.progCmd=eg"
3936
4037See also [ ` child.sh ` ] ( child.sh )
@@ -50,10 +47,9 @@ There are some requirements on the program `eg`:
5047If a program does not adhere to these requirements, it will often be
5148simple enough to make a small wrapper script that enforce this. For
5249example, ` crmc ` will write a lot of information to standard output.
53- We can filter that out via a shell script ([ ` crmc.sh ` ] ( crmc.sh ) ) like
50+ We can filter that out via a shell script ([ ` crmc.sh ` ] ( crmc.sh ) ) like
5451
55- #!/bin/sh
56-
52+ #!/bin/sh
5753 crmc $@ -o hepmc3 -f /dev/stdout | sed -n 's/^\(HepMC::\|[EAUWVP] \)/\1/p'
5854
5955The ` sed ` command selects lines that begin with ` HepMC:: ` , or one
@@ -65,12 +61,12 @@ standard output.
6561The script above also passes any additional command line options on to
6662` crmc ` via ` $@ ` . We can utilise this with ` o2-sim ` to set options to
6763the CRMC suite. For example, if we want to simulate p-Pb collisions
68- using DpmJET, we can do
64+ using DpmJET, we can do
6965
7066 o2-sim -g hepmc --configKeyValues "HepMC.progCmd=crmc.sh -m 12 -i2212 -I 1002080820"
7167
7268
73- ### Implementation details
69+ ### Implementation details
7470
7571Internally ` GeneratorHepMC `
7672
@@ -81,14 +77,14 @@ Internally `GeneratorHepMC`
8177
8278 eg options > fifo-name &
8379
84- 4 . and executes that command line
80+ 4 . and executes that command line
8581
86- ## The future
82+ ## The future
8783
8884The ` GeneratorHepMC ` (and sister generator ` GeneratorTParticle ` ) will
8985in the not so distant future be upgraded with new functionality to
9086more easily customise reading files and executing a child process. In
91- particular
87+ particular
9288
9389- HepMC event structures can be read from any file format supported by
9490 HepMC it self (see
@@ -101,8 +97,7 @@ particular
10197 beginning of each file read.
10298
10399 - ` FileOrCmd.fileNames=list ` a comma separated list of HepMC files
104- to read
105-
100+ to read
106101 - ` FileOrCmd.cmd=command line ` a command line to execute as a
107102 background child process. If this is set (not the empty string),
108103 then ` FileOrCmd.fileNames ` is ignored.
@@ -132,19 +127,18 @@ particular
132127 the program is put in the background. Typically this should be
133128 ` & ` , but a program may itself fork to the background.
134129
135- - Some options are no longer available
136-
130+ - Some options are no longer available
137131 - ` HepMC.fileName ` - use ` FileOrCmd.fileNames `
138132 - ` HepMC.progCmd ` - use ` FileOrCmd.cmd `
139133
140- The command line build will now be
134+ The command line build will now be
141135
142136> _ commandLine_ _ nEventsSwitch_ _ nEvents_ _ seedSwitch_ _ seed_
143137> _ bMaxSwitch_ _ bMax_ _ outputSwitch_ _ output_ _ backgroundSwitch_
144138
145139If any of the ` Switch ` keys are empty, then the corresponding option
146140is not propagated to the command line. For example, if _ bMaxSwitch_
147- is empty, then the build command line will be
141+ is empty, then the build command line will be
148142
149143> _ commandLine_ _ nEventsSwitch_ _ nEvents_ _ seedSwitch_ _ seed_
150144> _ outputSwitch_ _ output_ _ backgroundSwitch_
0 commit comments