Skip to content

Commit 9948f7d

Browse files
authored
Update of example including EPOS4.0.3 version (#1961)
* Update of example including EPOS4.0.3 version * Include example with EPOS4HQ * Make epos.sh compatible to /bin/sh
1 parent 88b173b commit 9948f7d

File tree

5 files changed

+91
-18
lines changed

5 files changed

+91
-18
lines changed

MC/config/examples/epos4/epos.sh

Lines changed: 44 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,33 @@
55
# in order not to print useless information on stdout (a z-*optns*.mtr file will be created)
66

77
optns="example"
8-
seed=$RANDOM
8+
seed=$(od -An -N2 -tu2 /dev/urandom | tr -d ' ')
9+
EPOS4=""
10+
11+
if [ -z "$EPO4VSN" ]; then
12+
echo "Error: EPO4VSN environment variable is not set"
13+
exit 1
14+
fi
15+
16+
if [ "$EPO4VSN" = "4.0.0" ]; then
17+
EPOS4="$EPOS4_ROOT/epos4/scripts/epos"
18+
export LIBDIR=$EPOS4_ROOT/epos4/bin
19+
else
20+
EPOS4="$EPOS4_ROOT/bin/epos"
21+
fi
22+
23+
# Check if the environment variable EPO4 is set (mandatory with o2dpg-sim-tests on CI machines)
24+
# If not, set all the EPOS4 related variables, most likely they are unset as well.
25+
if [ -z "${EPO4}" ]; then
26+
export OPT=./
27+
export HTO=./
28+
export CHK=./
29+
if [ "$EPO4VSN" = "4.0.0" ]; then
30+
export EPO4=$EPOS4_ROOT/epos4/
31+
else
32+
export EPO4=$EPOS4_ROOT/
33+
fi
34+
fi
935

1036
while test $# -gt 0 ; do
1137
case $1 in
@@ -18,24 +44,26 @@ done
1844

1945
if [ ! -f $optns.optns ]; then
2046
echo "Error: Options file $optns.optns not found"
21-
exit 1
47+
exit 2
2248
fi
2349

24-
if [ $seed -eq 0 ]; then
25-
echo "Seed can't be 0, random number will be used"
26-
seed=$RANDOM
50+
if grep -Fq "set ihq 1" $optns.optns; then
51+
if [ -z "$EPO4HQVSN" ]; then
52+
# Error: EPOS4HQ version not found
53+
exit 3
54+
else
55+
# Running with EPOS4HQ
56+
if [ -z "${EPO4HQ}" ]; then
57+
export EPO4HQ=$EPOS4HQ_ROOT/
58+
fi
59+
EPOS4="$EPO4HQ/bin/eposhq"
60+
fi
2761
fi
2862

29-
# Check if the environment variable EPO4 is set (mandatory with o2dpg-sim-tests on CI machines)
30-
# If not, set all the EPOS4 related variables, most likely they are unset as well.
31-
if [ -z "${EPO4}" ]; then
32-
export EPO4=$EPOS4_ROOT/epos4/
33-
export LIBDIR=$EPOS4_ROOT/epos4/bin
34-
export EPO4VSN=4.0.0
35-
export OPT=./
36-
export HTO=./
37-
export CHK=./
63+
if [ $seed -eq 0 ]; then
64+
# Seed can't be 0, random number will be used
65+
seed=$(od -An -N2 -tu2 /dev/urandom | tr -d ' ')
3866
fi
3967

40-
# Or filters the stdout with only HepMC2 useful data
41-
$EPOS4_ROOT/epos4/scripts/epos -hepstd -s $seed $optns | sed -n 's/^\(HepMC::\|[EAUWVP] \)/\1/p'
68+
# OR filters the stdout with only HepMC useful data
69+
$EPOS4 -hepstd -s $seed $optns | sed -n 's/^\(HepMC::\|[EAUWVP] \)/\1/p'

MC/config/examples/epos4/generator/example.optns

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ 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
14-
set ecms 13000 !sqrt(s)_pp
14+
set ecms 13600 !sqrt(s)_pp
1515
set istmax 25 !max status considered for storage
1616

1717
ftime on !string formation time non-zero
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
!--------------------------------------------------------------------
2+
! proton-proton collision no hydro no hadronic cascade
3+
!--------------------------------------------------------------------
4+
5+
!---------------------------------------
6+
! Define run
7+
!---------------------------------------
8+
9+
application hadron !hadron-hadron, hadron-nucleus, or nucleus-nucleus
10+
set laproj 1 !projectile atomic number
11+
set maproj 1 !projectile mass number
12+
set latarg 1 !target atomic number
13+
set matarg 1 !target mass number
14+
set ecms 13600 !sqrt(s)_pp
15+
set istmax 25 !max status considered for storage
16+
17+
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
21+
end
22+
23+
set ninicon 1 !number of initial conditions used for hydro evolution
24+
core full !core/corona activated
25+
hydro hlle !hydro activated
26+
eos x3ff !eos activated (epos standard EoS)
27+
hacas full !hadronic cascade activated (UrQMD)
28+
set nfreeze 1 !number of freeze out events per hydro event
29+
set modsho 1 !printout every modsho events
30+
set centrality 0 !0=min bias
31+
set ihepmc 2 !HepMC output enabled on stdout
32+
set nfull 10 !Total number of events to be generated
33+
set ihq 1 !Enable EPOS4HQ

MC/config/examples/ini/GeneratorEPOS4.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ funcName=generateEPOS4("${O2DPG_MC_CONFIG_ROOT}/MC/config/examples/epos4/generat
66
cmd=${O2DPG_MC_CONFIG_ROOT}/MC/config/examples/epos4/epos.sh -i cfg
77
bMaxSwitch=none
88

9+
# Set to version 2 if EPOS4.0.0 is used
910
[HepMC]
10-
version=2
11+
version=3
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#---> GeneratorEPOS4
2+
[GeneratorExternal]
3+
fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/examples/epos4/generator_EPOS4.C
4+
funcName=generateEPOS4("${O2DPG_MC_CONFIG_ROOT}/MC/config/examples/epos4/generator/examplehq.optns", 2147483647)
5+
6+
[GeneratorFileOrCmd]
7+
cmd=${O2DPG_MC_CONFIG_ROOT}/MC/config/examples/epos4/epos.sh -i cfg
8+
bMaxSwitch=none
9+
10+
[HepMC]
11+
version=3

0 commit comments

Comments
 (0)