Skip to content

Commit 784d532

Browse files
committed
Files updates following coding guidelines
1 parent 8d3acd2 commit 784d532

6 files changed

Lines changed: 51 additions & 52 deletions

File tree

run/SimExamples/HepMC_EPOS4/README.md

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,46 +2,47 @@
22
\page refrunSimExamplesHepMC_EPOS4 Example HepMC_EPOS4
33
/doxy -->
44

5-
The usage of EPOS4 with the O2 machinery is presented in this short manual.
5+
The usage of EPOS4 with the O2 machinery is presented in this short manual.
66
An in-depth explanation of the mechanisms behind the HepMC(3) data handling can be found in the
7-
HepMC_fifo folder of the MC examples.
8-
The scripts use the `cmd` parameter of `GeneratorHepMC` to spawn the EPOS4 generation
9-
via the `epos.sh` script.
7+
HepMC_fifo folder of the MC examples. The scripts use the `cmd` parameter of `GeneratorHepMC`
8+
to spawn the EPOS4 generation via the `epos.sh` script.
9+
1010
EPOS4 uses the outdated HepMC2 libraries, so this had to be specified in the steering scripts
11-
of the generators configuration. If `HepMC.version=2` is removed then the scripts will not work
12-
anymore. This is to say that the balance achieved with the configurations provided is easily
13-
destroyed if the user base edits parts that are not understood completely.
11+
of the generators configuration. If `HepMC.version=2` is removed then the scripts will not work
12+
anymore. This is to say that the balance achieved with the configurations provided is easily
13+
destroyed if the user base edits parts that are not understood completely.
1414

1515
# Scripts description
1616

1717
Four scripts are available to run the simulations
18-
- **epos.sh** → starts the actual EPOS4 generation
18+
- **epos.sh** → starts the actual EPOS4 generation
1919
- **runo2sim.sh** → allows the generation of events using o2-sim
2020
- **rundpg.sh** → starts the DPG machinery for event generation
2121
- **rundpl.sh** → starts the event generation with DPL
2222

23-
In addition an example.optns file is provided to start EPOS4, but more can be found in the generator example folder
24-
or in the website [epos4learn.web.cern.ch](https://epos4learn.docs.cern.ch/) where an extensive tutorial on the generator is provided.
23+
In addition an example.optns file is provided to start EPOS4, but more can be found in the generator example folder
24+
or in the website [epos4learn.web.cern.ch](https://epos4learn.docs.cern.ch/) where an extensive tutorial on the generator is provided.
2525

2626
## epos.sh
2727

28-
It can be run without the help of the other scripts to simply generate an .hepmc file or print
28+
It can be run without the help of the other scripts to simply generate an .hepmc file or print
2929
to the stdout the HepMC results. It it worth nothing though that EPOS4 must be loaded (via cvmfs through AliGenerators or O2sim for example) or installed. In this case the user should simply redirect the stdout to a file:
3030
```
3131
./epos.sh -i test -s 234345 > test.hepmc
3232
```
3333
This example shows all the functionalities of the script (which are implemented in a similar way inside
34-
the generation steering scripts). In particular the `-i` flag allows to provide .optns parameters to EPOS4,
35-
`-s` feeds the generator with a user seed, and the HepMC output is given by test.hepmc by redirecting the
36-
stdout which will contain only the HepMC data thanks to the `-hepstd` flag set automatically in epos.sh and
37-
the `set ihepmc 2` option which **MUST** be set in the option file (otherwise either an hepmc file will be created - ihepmc 1 - or nothing will be generated - missing ihepmc or != 1|2 ).
38-
It is important to note that setting an empty/null seed in the generator out of the box makes EPOS4 crash, so a protection was added in our steering epos.sh script which now generates a random number if 0 is provided.
34+
the generation steering scripts). In particular the `-i` flag allows to provide .optns parameters to EPOS4,
35+
`-s` feeds the generator with a user seed, and the HepMC output is given by test.hepmc by redirecting the
36+
stdout which will contain only the HepMC data thanks to the `-hepstd` flag set automatically in epos.sh and
37+
the `set ihepmc 2` option which **MUST** be set in the option file (otherwise either an hepmc file will be created - ihepmc 1 - or nothing will be generated - missing ihepmc or != 1|2 ).
38+
39+
It is important to note that setting an empty/null seed in the generator out of the box makes EPOS4 crash, so a protection was added in our steering epos.sh script which now generates a random number if 0 is provided.
3940

4041
## runo2sim.sh, rundpg.sh and rundpl.sh
4142

42-
The three scripts have little differences (especially in the first part), so they will be described together.
43-
They work after loading any O2sim version after the 20/09/2024 (included), since multiple modifications had to be performed on both EPOS4 and the introduction of AliGenO2 in order to be able to load both O2sim and EPOS4 simultaneously.
44-
If no parameters are provided to the scripts, they will run with default values (energy and nevents provided in the example.optns file), but few flags are available to change the settings of the generation:
43+
The three scripts have little differences (especially in the first part), so they will be described together. They work after loading any O2sim version after the 20/09/2024 (included), since multiple modifications had to be performed on both EPOS4 and the introduction of AliGenO2 in order to be able to load both O2sim and EPOS4 simultaneously.
44+
45+
If no parameters are provided to the scripts, they will run with default values (energy and nevents provided in the example.optns file), but few flags are available to change the settings of the generation:
4546
- **-m , --more** → feeds the simulation with advanced parameters provided to the configuration key flags
4647
- **-n , --nevents** → changes the number of events in the .optns file or gets the one in the file if no events are provided
4748
- **-i , --input** → .optns filename to feed EPOS4, no extension must be set in the filename
@@ -50,18 +51,18 @@ If no parameters are provided to the scripts, they will run with default values
5051
- **-e , --ecm** → sets the center-of-mass energy in the options file
5152

5253
In the `rundpg.sh` script an additional flag is available
53-
- **-t , --tf** → number of timeframes to be generated
54+
- **-t , --tf** → number of timeframes to be generated
5455

5556
In this case the options file will be copied in each tf$n folder, otherwise the epos script won't be able to run with multiple timeframes.
56-
In o2sim and DPG scripts the randomly generated seed is set directly, instead this is not feasible with the DPL one, given that the --seed option is not able
57-
to redirect this number to GeneratorHepMC. So a seed 0 is automatically given to epos.sh which generates a random number in return.
57+
In o2sim and DPG scripts the randomly generated seed is set directly, instead this is not feasible with the DPL one, given that the --seed option is not able to redirect this number to GeneratorHepMC. So a seed 0 is automatically given to epos.sh which generates a random number in return.
58+
5859
Now the three scripts start to differ:
5960

6061
- **runo2sim.sh** → o2-sim is launched
6162
- **rundpg.sh** → first the o2dpg_sim_workflow.py script will be launched generating the json configuration, then the o2_dpg_workflow_runner.py script will start the workflow
6263
- **rundpl.sh** → o2-sim-dpl-eventgen is executed piping its results to o2-sim-mctracks-to-aod and afterwards to o2-analysis-mctracks-to-aod-simple-task
6364

6465
The last few lines of the scripts contain the execution of o2-sim, DPG worflow creator/runner and DPL software respectively, so this part can be modified by the users following their requirements. It's important not to delete from the configuration keys `GeneratorFileOrCmd.cmd=$cmd -i $optns;GeneratorFileOrCmd.bMaxSwitch=none;HepMC.version=2;`
65-
and it would be better to provide additional configurations via the -m flag. EPOS4 cannot set a maximum impact parameter value, so it's better to leave the bMaxSwitch to none, while the others serve the sole purpose of running successfully the generator using auto generated FIFOs.
66+
and it would be better to provide additional configurations via the -m flag. EPOS4 cannot set a maximum impact parameter value, so it's better to leave the bMaxSwitch to none, while the others serve the sole purpose of running successfully the generator using auto generated FIFOs.
6667

6768

run/SimExamples/HepMC_EPOS4/epos.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
#!/bin/sh
2-
# Script based on CRMC example
2+
# Script based on CRMC example
33
# EPOS4 option files must contain ihepmc set to 2 to print HepMC
4-
# data on stdout. -hepmc flag is not needed anymore, but -hepstd is fundamental
4+
# data on stdout. -hepmc flag is not needed anymore, but -hepstd is fundamental
55
# in order not to print useless information on stdout (a z-*optns*.mtr file will be created)
66

77
optns="example"
88
seed=$RANDOM
99

1010
while test $# -gt 0 ; do
1111
case $1 in
12-
-i|--input) optns=$2 ; shift ;;
13-
-s|--seed) seed=$2 ; shift ;;
14-
-h|--help) usage; exit 0 ;;
12+
-i|--input) optns=$2 ; shift ;;
13+
-s|--seed) seed=$2 ; shift ;;
14+
-h|--help) usage; exit 0 ;;
1515
esac
1616
shift
1717
done

run/SimExamples/HepMC_EPOS4/example.optns

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,27 @@
66
! Define run
77
!---------------------------------------
88

9-
application hadron !hadron-hadron, hadron-nucleus, or nucleus-nucleus
9+
application hadron !hadron-hadron, hadron-nucleus, or nucleus-nucleus
1010
set laproj 1 !projectile atomic number
1111
set maproj 1 !projectile mass number
1212
set latarg 1 !target atomic number
1313
set matarg 1 !target mass number
1414
set ecms 7000 !sqrt(s)_pp
15-
set istmax 25 !max status considered for storage
15+
set istmax 25 !max status considered for storage
1616

1717
ftime on !string formation time non-zero
18-
!suppressed decays:
19-
nodecays
20-
110 20 2130 -2130 2230 -2230 1130 -1130 1330 -1330 2330 -2330 3331 -3331
18+
!suppressed decays:
19+
nodecays
20+
110 20 2130 -2130 2230 -2230 1130 -1130 1330 -1330 2330 -2330 3331 -3331
2121
end
2222

2323
set ninicon 1 !number of initial conditions used for hydro evolution
2424
core off !core/corona not activated
2525
hydro off !hydro not activated
2626
eos off !eos not activated
27-
hacas off !hadronic cascade not activated
28-
set nfreeze 1 !number of freeze out events per hydro event
27+
hacas off !hadronic cascade not activated
28+
set nfreeze 1 !number of freeze out events per hydro event
2929
set modsho 1 !printout every modsho events
30-
set centrality 0 !0=min bias
30+
set centrality 0 !0=min bias
3131
set ihepmc 2 !HepMC output enabled on stdout
3232
set nfull 10

run/SimExamples/HepMC_EPOS4/rundpg.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Options:
3636
-i,--input INPUT Options file fed to EPOS4 ($optns)
3737
-j,--jobs JOBS Number of jobs ($JOBS)
3838
-h,--help Print these instructions
39-
-e,--ecm ENERGY Center-of-Mass energy
39+
-e,--ecm ENERGY Center-of-Mass energy
4040
-t,--tf TF Timeframes ($TF)
4141
-- Rest of command line sent to o2-sim
4242
@@ -58,7 +58,7 @@ while test $# -gt 0 ; do
5858
-n|--nevents) NEV=$2 ; shift ;;
5959
-i|--input) optns=$2 ; shift ;;
6060
-j|--jobs) JOBS=$2 ; shift ;;
61-
-e|--ecm) eCM=$2 ; shift ;;
61+
-e|--ecm) eCM=$2 ; shift ;;
6262
-h|--help) usage; ${O2DPG_ROOT}/MC/bin/o2dpg_sim_workflow.py --help ; exit 0 ;;
6363
-t|--tf) TF=$2 ; shift ;;
6464
--) shift ; break ;;
@@ -92,7 +92,7 @@ else
9292
else
9393
echo "Error: Number of events not set in EPOS4"
9494
exit 5
95-
fi
95+
fi
9696
fi
9797

9898
# Set ECM
@@ -126,7 +126,7 @@ done
126126
# create workflow
127127

128128
${O2DPG_ROOT}/MC/bin/o2dpg_sim_workflow.py -eCM $eCM -ns $NEV -gen hepmc -tf $TF -j $JOBS \
129-
-interactionRate 500000 -confKey "GeneratorFileOrCmd.cmd=$cmd -i $optns;GeneratorFileOrCmd.bMaxSwitch=none;HepMC.version=2;${more}"
129+
-interactionRate 500000 -confKey "GeneratorFileOrCmd.cmd=$cmd -i $optns;GeneratorFileOrCmd.bMaxSwitch=none;HepMC.version=2;${more}"
130130

131-
# Run workflow
131+
# Run workflow
132132
${O2DPG_ROOT}/MC/bin/o2_dpg_workflow_runner.py -f workflow.json -tt aod --stdout-on-failure

run/SimExamples/HepMC_EPOS4/rundpl.sh

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
#!/usr/bin/env bash
22
#
3-
# This is a simple simulation example showing how to
4-
3+
# This is a simple simulation example showing how to
54
# start EPOS4 generation automatically using cmd with hepmc output on FIFO
65
# and simultaneosly use o2-sim for transport
76

87
# This script works only with O2sim version starting from the 20/09/2024
98

10-
# EPOS4 and O2 must be loaded
9+
# EPOS4 and O2 must be loaded
1110
set -x
1211
if [ ! "${EPOS4_ROOT}" ]; then
1312
echo "This needs EPOS4 loaded; alienv enter ..."
@@ -34,7 +33,7 @@ Options:
3433
-n,--nevents EVENTS Number of events ($nev)
3534
-i,--input INPUT Options file fed to EPOS4 ($optns)
3635
-j,--jobs JOBS Number of jobs ($JOBS)
37-
-e,--ecm ENERGY Center-of-Mass energy
36+
-e,--ecm ENERGY Center-of-Mass energy
3837
-h,--help Print these instructions
3938
-- Rest of command line sent to o2-sim
4039
@@ -89,7 +88,7 @@ else
8988
else
9089
echo "Error: Number of events not set in EPOS4"
9190
exit 5
92-
fi
91+
fi
9392
fi
9493

9594
# Set ECM
@@ -113,7 +112,7 @@ else
113112
fi
114113

115114
# Starting simulation => seed is fed automatically to epos with the --seed flag. HepMC.version = 2 is mandatory
116-
# otherwise the simulation won't work.
115+
# otherwise the simulation won't work.
117116
# Seed is automatically set to Random by the epos.sh script because the --seed option with o2-sim-dpl-eventgen does not feed the number to GeneratorHepMC
118117

119118
o2-sim-dpl-eventgen -b --nEvents ${NEV} --generator hepmc --configKeyValues "GeneratorFileOrCmd.cmd=$cmd -i $optns;GeneratorFileOrCmd.bMaxSwitch=none;HepMC.version=2;${more}" |\

run/SimExamples/HepMC_EPOS4/runo2sim.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
#!/usr/bin/env bash
22
#
3-
# This is a simple simulation example showing how to
4-
3+
# This is a simple simulation example showing how to
54
# start EPOS4 generation automatically using cmd with hepmc output on FIFO
65
# and simultaneosly use o2-sim for transport
76

87
# This script works only with O2sim version starting from the 20/09/2024
98

10-
# EPOS4 and O2 must be loaded
9+
# EPOS4 and O2 must be loaded
1110
set -x
1211
if [ ! "${EPOS4_ROOT}" ]; then
1312
echo "This needs EPOS4 loaded; alienv enter ..."
@@ -34,7 +33,7 @@ Options:
3433
-n,--nevents EVENTS Number of events ($nev)
3534
-i,--input INPUT Options file fed to EPOS4 ($optns)
3635
-j,--jobs JOBS Number of jobs ($JOBS)
37-
-e,--ecm ENERGY Center-of-Mass energy
36+
-e,--ecm ENERGY Center-of-Mass energy
3837
-h,--help Print these instructions
3938
-- Rest of command line sent to o2-sim
4039
@@ -89,7 +88,7 @@ else
8988
else
9089
echo "Error: Number of events not set in EPOS4"
9190
exit 5
92-
fi
91+
fi
9392
fi
9493

9594
# Set ECM

0 commit comments

Comments
 (0)