Skip to content

Commit da870b3

Browse files
committed
Merge branch 'cholmcc_generatos' into cholmcc_generators_more
2 parents 72b3a9d + 0434a6e commit da870b3

File tree

4 files changed

+24
-30
lines changed

4 files changed

+24
-30
lines changed

run/SimExamples/HepMC/README.md

Lines changed: 20 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,33 @@
55
Here are pointers on how to use `GeneratorHepMC` selected by the
66
option `-g hepmc` for `o2-sim`.
77

8-
## Reading HepMC files
8+
## Reading HepMC files
99

1010
The 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

2121
Please refer to the documentation of these for more on how to make
2222
event 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

2827
See 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
3331
also spawn an child EG to produce events. Suppose we have a program
3432
named `eg` which is some EG that writes HepMC event records to the
3533
standard 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

4037
See also [`child.sh`](child.sh)
@@ -50,10 +47,9 @@ There are some requirements on the program `eg`:
5047
If a program does not adhere to these requirements, it will often be
5148
simple enough to make a small wrapper script that enforce this. For
5249
example, `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

5955
The `sed` command selects lines that begin with `HepMC::`, or one
@@ -65,12 +61,12 @@ standard output.
6561
The 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
6763
the 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

7571
Internally `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

8884
The `GeneratorHepMC` (and sister generator `GeneratorTParticle`) will
8985
in the not so distant future be upgraded with new functionality to
9086
more 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
145139
If any of the `Switch` keys are empty, then the corresponding option
146140
is 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_

run/SimExamples/TParticle/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ and a steering class
131131
}
132132
};
133133

134-
Then we could make the script [`MyEG.cc` (complete code)](MyEG.cc) like
134+
Then we could make the script [`MyEG.macro` (complete code)](MyEG.macro) like
135135

136136
void MyEG(Int_t nev,const TString& out,Int_t every=1)
137137
{
@@ -143,7 +143,7 @@ Then we could make the script [`MyEG.cc` (complete code)](MyEG.cc) like
143143
}
144144

145145
and a simple shell-script [`myeg.sh`](myeg.sh) to pass arguments to
146-
the `MyEG.cc` script
146+
the `MyEG.macro` script
147147

148148
#!/bin/sh
149149

@@ -159,7 +159,7 @@ the `MyEG.cc` script
159159
shift
160160
done
161161

162-
root -l MyEG.cc -- $nev \"$out\"
162+
root -l MyEG.macro -- $nev \"$out\"
163163

164164
We can then do
165165

run/SimExamples/TParticle/myeg.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ while test $# -gt 0 ; do
1818
shift
1919
done
2020

21-
root -q -l MyEG.cc${opt} -- $nev \"$out\" $seed
21+
root -q -l MyEG.macro${opt} -- $nev \"$out\" $seed
2222

0 commit comments

Comments
 (0)