55Here are pointers on how to use ` GeneratorHepMC ` selected by the
66option ` -g hepmc ` for ` o2-sim ` .
77
8+ HepMC event structures can be read from any file format supported by
9+ HepMC it self (see
10+ [ here] ( http://hepmc.web.cern.ch/hepmc/group__IO.html ) and
11+ [ here] ( http://hepmc.web.cern.ch/hepmc/group__factory.html ) .
12+
813## Reading HepMC files
914
1015The generator ` GeneratorHepMC ` can read events from a
@@ -23,7 +28,7 @@ event files in the HepMC format.
2328
2429To make a simulation reading from the file ` events.hepmc ` , do
2530
26- o2-sim -g hepmc --configKeyValues "HepMC.fileName =events.hepmc" ...
31+ o2-sim -g hepmc --configKeyValues "FileOrCmd.fileNames =events.hepmc" ...
2732
2833See also [ ` read.sh ` ] ( read.sh ) .
2934
@@ -34,17 +39,34 @@ named `eg` which is some EG that writes HepMC event records to the
3439standard output. Then we can execute a simulation using this external
3540EG by
3641
37- o2-sim -g hepmc --configKeyValues "HepMC.progCmd =eg"
42+ o2-sim -g hepmc --configKeyValues "FileOrCmd.cmd =eg"
3843
3944See also [ ` child.sh ` ] ( child.sh ) .
4045
4146There are some requirements on the program ` eg ` :
4247
43- - It _ must_ write the HepMC event structures to standard output
44- (` /dev/stdout ` ).
45- - It may _ not_ write other information to standard output.
46- - It _ must_ accept the option ` -n n-events ` to set the number of
47- events to produce to ` n-events ` .
48+ - The EG program _ must_ be able to write the HepMC event structures to
49+ a specified file. The option passed to the program is specified via
50+ the key ` FileOrCmd.outputSwitch ` . This defaults to ` > ` which means
51+ the EG program is assumed to write the HepMC event structures to
52+ standard output, _ and_ that nothing else is printed on standard
53+ output.
54+ - It _ must_ accept an option to set the number of events to generate.
55+ This is controlled by the configuration key
56+ ` FileOrCmd.nEventsSwitch ` and defaults to ` -n ` . Thus, the EG
57+ application should accept ` -n 10 ` to mean that it should generate
58+ ` 10 ` events, for example.
59+ - The EG application should accept a command line switch to set the
60+ random number generator seed. This option is specified via the
61+ configuration key ` FileOrCmd.seedSwitch ` and defaults to ` -s ` .
62+ Thus, the EG application must accept ` -s 123456 ` to mean to set the
63+ random number seed to ` 123456 ` for example.
64+ - The EG application should accept a command line switch to set the
65+ maximum impact parameter (in Fermi-metre) sampled. This is set via
66+ the configuration key ` FileOrCmd.bMaxSwithc ` and defaults to ` -b ` .
67+ Thus, the EG application should take the command line argument `-b
68+ 10` to mean that it should only generate events with an impact
69+ parameter between 0fm and 10fm.
4870
4971If a program does not adhere to these requirements, it will often be
5072simple enough to make a small wrapper script that enforce this. For
@@ -65,7 +87,7 @@ The script above also passes any additional command line options on to
6587the CRMC suite. For example, if we want to simulate p-Pb collisions
6688using DpmJET, we can do
6789
68- o2-sim -g hepmc --configKeyValues "HepMC.progCmd =crmc.sh -m 12 -i2212 -I 1002080820"
90+ o2-sim -g hepmc --configKeyValues "FileOrCmd.cmd =crmc.sh -m 12 -i2212 -I 1002080820"
6991
7092
7193### Implementation details
@@ -81,58 +103,52 @@ Internally `GeneratorHepMC`
81103
821044 . and executes that command line
83105
84- ## The future
85-
86- The ` GeneratorHepMC ` (and sister generator ` GeneratorTParticle ` ) will
87- in the not so distant future be upgraded with new functionality to
88- more easily customise reading files and executing a child process. In
89- particular
106+ ## The configuration keys
90107
91- - HepMC event structures can be read from any file format supported by
92- HepMC it self (see
93- [ here] ( http://hepmc.web.cern.ch/hepmc/group__IO.html ) and
94- [ here] ( http://hepmc.web.cern.ch/hepmc/group__factory.html ) .
108+ The ` GeneratorHepMC ` (and sister generator ` GeneratorTParticle ` )
109+ allows customisation of the execution via configuration keys passed
110+ via ` --configKeyValues `
95111
96- - New options that can be specified in ` --configKeyValues `
112+ - ` HepMC.eventsToSkip=number ` a number events to skip at the
113+ beginning of each file read.
97114
98- - ` HepMC.eventsToSkip=number ` a number events to skip at the
99- beginning of each file read.
115+ - ` FileOrCmd.fileNames=list ` a comma separated list of HepMC files
116+ to read.
100117
101- - ` FileOrCmd.fileNames=list ` a comma separated list of HepMC files
102- to read.
118+ - ` FileOrCmd.cmd=command line ` a command line to execute as a
119+ background child process. If this is set (not the empty string),
120+ then ` FileOrCmd.fileNames ` is ignored.
103121
104- - ` FileOrCmd.cmd=command line ` a command line to execute as a
105- background child process. If this is set (not the empty string),
106- then ` FileOrCmd.fileNames ` is ignored.
122+ - A number of keys that specifies the command line option switch
123+ that the child program accepts for certain things. If any of
124+ these are set to the empty string, then that switch and
125+ corresponding option value is not passed to the child program.
107126
108- - A number of keys that specifies the command line option switch
109- that the child program accepts for certain things. If any of
110- these are set to the empty string, then that switch and
111- corresponding option value is not passed to the child program.
127+ - ` FileOrCmd.outputSwitch=switch ` (default ` > ` ) to specify output
128+ file. The default of ` > ` assumes that the program write HepMC
129+ events, and _ only_ those, to standard output.
112130
113- - ` FileOrCmd.outputSwitch =switch ` (default ` > ` ) to specify output
114- file. The default of ` > ` assumes that the program write HepMC
115- events, and _ only _ those, to standard output.
131+ - ` FileOrCmd.seedSwitch =switch ` (default ` -s ` ) to specify the
132+ random number generator seed. The value passed is selected by
133+ the ` o2-sim ` option ` --seed `
116134
117- - ` FileOrCmd.seedSwitch =switch ` (default ` -s ` ) to specify the
118- random number generator seed. The value passed is selected by
119- the ` o2-sim ` option ` --seed `
135+ - ` FileOrCmd.bMaxSwitch =switch ` (default ` -b ` ) to specify the
136+ upper limit on the impact parameters sampled. The value passed
137+ is selected by the ` o2-sim ` option ` --bMax `
120138
121- - ` FileOrCmd.bMaxSwitch =switch ` (default ` -b ` ) to specify the
122- upper limit on the impact parameters sampled . The value passed
123- is selected by the ` o2-sim ` option ` --bMax `
139+ - ` FileOrCmd.nEventsSwitch =switch ` (default ` -n ` ) to specify the
140+ number of events to generate . The value passed is selected by
141+ the ` o2-sim ` option ` --nEvents ` or ( ` -n ` )
124142
125- - ` FileOrCmd.nEventsSwitch=switch ` (default ` -n ` ) to specify the
126- number of events to generate. The value passed is selected by
127- the ` o2-sim ` option ` --nEvents ` or (` -n ` )
128-
129- - ` FileOrCmd.backgroundSwitch=switch ` (default ` & ` ) to specify how
130- the program is put in the background. Typically this should be
131- ` & ` , but a program may itself fork to the background.
143+ - ` FileOrCmd.backgroundSwitch=switch ` (default ` & ` ) to specify how
144+ the program is put in the background. Typically this should be
145+ ` & ` , but a program may itself fork to the background.
132146
133147- Some options are no longer available
148+
134149 - ` HepMC.fileName ` - use ` FileOrCmd.fileNames `
135- - ` HepMC.progCmd ` - use ` FileOrCmd.cmd `
150+ - ` HepMC.version ` - now the code itself figures out which format
151+ version the input file is in.
136152
137153The command line build will now be
138154
0 commit comments