Skip to content

Commit

Permalink
Added FIFOs generation tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
jackal1-66 authored and sawenzel committed Oct 2, 2024
1 parent 47c47ca commit 82ac755
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions docs/generators/generatorso2.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,25 @@ This reads primaries to be transported from a HepMC file. A command would look l
```bash
o2-sim -g hepmc --configKeyValues "HepMC.fileName=<path/to/HepMC/file>"
```
It is important to know which HepMC version is considered: by default `o2-sim` assumes HepMC3, but if this is not the case (as for EPOS4) `HepMC.version=2`
must be added in the configuration keys, otherwise the simulation task could fail.

## Generating using FIFOs

It is also possible to use FIFOs which allow not to store data from generators but to feed them directly to o2-sim. This can be done *manually*, by creating a FIFO and then feeding it as HepMC file to both your generator and the o2-sim script, or automatically via `GeneratorHepMC` using the `cmd` parameter. The use of the latter, instead of the former, is **highly encouraged** and three examples are provided in [O2](https://github.com/AliceO2Group/AliceO2/tree/dev/run/SimExamples) inside the `HepMC*` folders.

This function spawns a simulation task using an external generator provided that this:
- returns HepMC data in the stdout &rarr; this is the only real hard requirement
- accepts a `-s` flag to set the generation seed
- has control of the number of events with a `-n` flag or different mechanism
- has the possibility of setting the impact parameter (`-b` flag).

These flags are automatically fed to the executable (or script) provided with `GeneratorFileOrCmd.cmd=<scriptname>`.
In most generators these conditions are either available out of the box or they can be satisfied by creating a simple steering script. The only real stopper to run with this method is not having HepMC in the stdout, however the user must be careful what the other flags do in the provided generator because they could be interpreted in a different way and return unexpected results. In order not to provide an impact parameter limit `GeneratorFileOrCmd.bMaxSwitch=none` can be set in the configuration keys, which is useful because your generator might not be able to configure this option by default. An example command to run with automatically generated FIFOs is:
```bash
o2-sim -n 100 -g hepmc --seed 12345 --configKeyValues "GeneratorFileOrCmd.cmd=epos.sh;GeneratorFileOrCmd.bMaxSwitch=none;"
```
where epos.sh is the steering script of EPOS4 which can be found [here](https://github.com/AliceO2Group/AliceO2/tree/dev/run/SimExamples/HepMC_EPOS4). More information are at the user disposal in the README files of each HepMC example folder.

## External generators

Expand Down

0 comments on commit 82ac755

Please sign in to comment.