From 452b827280f86054477953773735909963135efb Mon Sep 17 00:00:00 2001 From: Marco Giacalone Date: Thu, 10 Apr 2025 15:41:40 +0200 Subject: [PATCH 1/3] Update of example including EPOS4.0.3 version --- MC/config/examples/epos4/epos.sh | 38 ++++++++++++------- MC/config/examples/ini/GeneratorEPOS4-0-3.ini | 11 ++++++ 2 files changed, 36 insertions(+), 13 deletions(-) create mode 100644 MC/config/examples/ini/GeneratorEPOS4-0-3.ini diff --git a/MC/config/examples/epos4/epos.sh b/MC/config/examples/epos4/epos.sh index c416e03f7..076e2d9c1 100755 --- a/MC/config/examples/epos4/epos.sh +++ b/MC/config/examples/epos4/epos.sh @@ -6,6 +6,29 @@ optns="example" seed=$RANDOM +EPOS4="" + +if [ -z "$EPO4VSN" ]; then + echo "Error: EPO4VSN environment variable is not set" + exit 1 +fi + +if [ "$EPO4VSN" = "4.0.0" ]; then + EPOS4="$EPOS4_ROOT/epos4/scripts/epos" + export LIBDIR=$EPOS4_ROOT/epos4/bin +else + EPOS4="$EPOS4_ROOT/epos4/bin/epos" + export BIN_DIR=$EPOS4_ROOT/epos4/bin +fi + +# Check if the environment variable EPO4 is set (mandatory with o2dpg-sim-tests on CI machines) +# If not, set all the EPOS4 related variables, most likely they are unset as well. +if [ -z "${EPO4}" ]; then + export EPO4=$EPOS4_ROOT/epos4/ + export OPT=./ + export HTO=./ + export CHK=./ +fi while test $# -gt 0 ; do case $1 in @@ -26,16 +49,5 @@ if [ $seed -eq 0 ]; then seed=$RANDOM fi -# Check if the environment variable EPO4 is set (mandatory with o2dpg-sim-tests on CI machines) -# If not, set all the EPOS4 related variables, most likely they are unset as well. -if [ -z "${EPO4}" ]; then - export EPO4=$EPOS4_ROOT/epos4/ - export LIBDIR=$EPOS4_ROOT/epos4/bin - export EPO4VSN=4.0.0 - export OPT=./ - export HTO=./ - export CHK=./ -fi - -# Or filters the stdout with only HepMC2 useful data -$EPOS4_ROOT/epos4/scripts/epos -hepstd -s $seed $optns | sed -n 's/^\(HepMC::\|[EAUWVP] \)/\1/p' +# OR filters the stdout with only HepMC useful data +$EPOS4 -hepstd -s $seed $optns | sed -n 's/^\(HepMC::\|[EAUWVP] \)/\1/p' \ No newline at end of file diff --git a/MC/config/examples/ini/GeneratorEPOS4-0-3.ini b/MC/config/examples/ini/GeneratorEPOS4-0-3.ini new file mode 100644 index 000000000..cab0749d6 --- /dev/null +++ b/MC/config/examples/ini/GeneratorEPOS4-0-3.ini @@ -0,0 +1,11 @@ +#---> GeneratorEPOS4 +[GeneratorExternal] +fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/examples/epos4/generator_EPOS4.C +funcName=generateEPOS4("${O2DPG_MC_CONFIG_ROOT}/MC/config/examples/epos4/generator/example.optns", 2147483647) + +[GeneratorFileOrCmd] +cmd=${O2DPG_MC_CONFIG_ROOT}/MC/config/examples/epos4/epos.sh -i cfg +bMaxSwitch=none + +[HepMC] +version=3 \ No newline at end of file From 0cdcff383a8ab3a5f34f4a76321aa0203a5cc575 Mon Sep 17 00:00:00 2001 From: Marco Giacalone Date: Mon, 14 Apr 2025 16:56:31 +0200 Subject: [PATCH 2/3] Include example with EPOS4HQ --- MC/config/examples/epos4/epos.sh | 28 ++++++++++++---- .../examples/epos4/generator/example.optns | 2 +- .../examples/epos4/generator/examplehq.optns | 33 +++++++++++++++++++ MC/config/examples/ini/GeneratorEPOS4.ini | 3 +- ...atorEPOS4-0-3.ini => GeneratorEPOS4HQ.ini} | 2 +- 5 files changed, 59 insertions(+), 9 deletions(-) create mode 100755 MC/config/examples/epos4/generator/examplehq.optns rename MC/config/examples/ini/{GeneratorEPOS4-0-3.ini => GeneratorEPOS4HQ.ini} (86%) diff --git a/MC/config/examples/epos4/epos.sh b/MC/config/examples/epos4/epos.sh index 076e2d9c1..fb1ac96b8 100755 --- a/MC/config/examples/epos4/epos.sh +++ b/MC/config/examples/epos4/epos.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Script based on CRMC example # EPOS4 option files must contain ihepmc set to 2 to print HepMC # data on stdout. -hepmc flag is not needed anymore, but -hepstd is fundamental @@ -17,17 +17,20 @@ if [ "$EPO4VSN" = "4.0.0" ]; then EPOS4="$EPOS4_ROOT/epos4/scripts/epos" export LIBDIR=$EPOS4_ROOT/epos4/bin else - EPOS4="$EPOS4_ROOT/epos4/bin/epos" - export BIN_DIR=$EPOS4_ROOT/epos4/bin + EPOS4="$EPOS4_ROOT/bin/epos" fi # Check if the environment variable EPO4 is set (mandatory with o2dpg-sim-tests on CI machines) # If not, set all the EPOS4 related variables, most likely they are unset as well. if [ -z "${EPO4}" ]; then - export EPO4=$EPOS4_ROOT/epos4/ export OPT=./ export HTO=./ export CHK=./ + if [ "$EPO4VSN" = "4.0.0" ]; then + export EPO4=$EPOS4_ROOT/epos4/ + else + export EPO4=$EPOS4_ROOT/ + fi fi while test $# -gt 0 ; do @@ -41,11 +44,24 @@ done if [ ! -f $optns.optns ]; then echo "Error: Options file $optns.optns not found" - exit 1 + exit 2 +fi + +if grep -Fq "set ihq 1" $optns.optns; then + if [ -z "$EPO4HQVSN" ]; then + # Error: EPOS4HQ version not found + exit 3 + else + # Running with EPOS4HQ + if [ -z "${EPO4HQ}" ]; then + export EPO4HQ=$EPOS4HQ_ROOT/ + fi + EPOS4="$EPO4HQ/bin/eposhq" + fi fi if [ $seed -eq 0 ]; then - echo "Seed can't be 0, random number will be used" + # Seed can't be 0, random number will be used seed=$RANDOM fi diff --git a/MC/config/examples/epos4/generator/example.optns b/MC/config/examples/epos4/generator/example.optns index 553ecafa8..22620815f 100644 --- a/MC/config/examples/epos4/generator/example.optns +++ b/MC/config/examples/epos4/generator/example.optns @@ -11,7 +11,7 @@ set laproj 1 !projectile atomic number set maproj 1 !projectile mass number set latarg 1 !target atomic number set matarg 1 !target mass number -set ecms 13000 !sqrt(s)_pp +set ecms 13600 !sqrt(s)_pp set istmax 25 !max status considered for storage ftime on !string formation time non-zero diff --git a/MC/config/examples/epos4/generator/examplehq.optns b/MC/config/examples/epos4/generator/examplehq.optns new file mode 100755 index 000000000..209f96a55 --- /dev/null +++ b/MC/config/examples/epos4/generator/examplehq.optns @@ -0,0 +1,33 @@ +!-------------------------------------------------------------------- +! proton-proton collision no hydro no hadronic cascade +!-------------------------------------------------------------------- + +!--------------------------------------- +! Define run +!--------------------------------------- + +application hadron !hadron-hadron, hadron-nucleus, or nucleus-nucleus +set laproj 1 !projectile atomic number +set maproj 1 !projectile mass number +set latarg 1 !target atomic number +set matarg 1 !target mass number +set ecms 13600 !sqrt(s)_pp +set istmax 25 !max status considered for storage + +ftime on !string formation time non-zero +!suppressed decays: +nodecays + 110 20 2130 -2130 2230 -2230 1130 -1130 1330 -1330 2330 -2330 3331 -3331 +end + +set ninicon 1 !number of initial conditions used for hydro evolution +core full !core/corona activated +hydro hlle !hydro activated +eos x3ff !eos activated (epos standard EoS) +hacas full !hadronic cascade activated (UrQMD) +set nfreeze 1 !number of freeze out events per hydro event +set modsho 1 !printout every modsho events +set centrality 0 !0=min bias +set ihepmc 2 !HepMC output enabled on stdout +set nfull 10 !Total number of events to be generated +set ihq 1 !Enable EPOS4HQ diff --git a/MC/config/examples/ini/GeneratorEPOS4.ini b/MC/config/examples/ini/GeneratorEPOS4.ini index 33935cbe2..fabfd6066 100644 --- a/MC/config/examples/ini/GeneratorEPOS4.ini +++ b/MC/config/examples/ini/GeneratorEPOS4.ini @@ -6,5 +6,6 @@ funcName=generateEPOS4("${O2DPG_MC_CONFIG_ROOT}/MC/config/examples/epos4/generat cmd=${O2DPG_MC_CONFIG_ROOT}/MC/config/examples/epos4/epos.sh -i cfg bMaxSwitch=none +# Set to version 2 if EPOS4.0.0 is used [HepMC] -version=2 \ No newline at end of file +version=3 diff --git a/MC/config/examples/ini/GeneratorEPOS4-0-3.ini b/MC/config/examples/ini/GeneratorEPOS4HQ.ini similarity index 86% rename from MC/config/examples/ini/GeneratorEPOS4-0-3.ini rename to MC/config/examples/ini/GeneratorEPOS4HQ.ini index cab0749d6..de88cd801 100644 --- a/MC/config/examples/ini/GeneratorEPOS4-0-3.ini +++ b/MC/config/examples/ini/GeneratorEPOS4HQ.ini @@ -1,7 +1,7 @@ #---> GeneratorEPOS4 [GeneratorExternal] fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/examples/epos4/generator_EPOS4.C -funcName=generateEPOS4("${O2DPG_MC_CONFIG_ROOT}/MC/config/examples/epos4/generator/example.optns", 2147483647) +funcName=generateEPOS4("${O2DPG_MC_CONFIG_ROOT}/MC/config/examples/epos4/generator/examplehq.optns", 2147483647) [GeneratorFileOrCmd] cmd=${O2DPG_MC_CONFIG_ROOT}/MC/config/examples/epos4/epos.sh -i cfg From 3e0b2001fc2a05c9b365a71a6529a3a5bba28cde Mon Sep 17 00:00:00 2001 From: Marco Giacalone Date: Fri, 30 May 2025 14:19:40 +0200 Subject: [PATCH 3/3] Make epos.sh compatible to /bin/sh --- MC/config/examples/epos4/epos.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MC/config/examples/epos4/epos.sh b/MC/config/examples/epos4/epos.sh index fb1ac96b8..13a30b0d0 100755 --- a/MC/config/examples/epos4/epos.sh +++ b/MC/config/examples/epos4/epos.sh @@ -1,11 +1,11 @@ -#!/bin/bash +#!/bin/sh # Script based on CRMC example # EPOS4 option files must contain ihepmc set to 2 to print HepMC # data on stdout. -hepmc flag is not needed anymore, but -hepstd is fundamental # in order not to print useless information on stdout (a z-*optns*.mtr file will be created) optns="example" -seed=$RANDOM +seed=$(od -An -N2 -tu2 /dev/urandom | tr -d ' ') EPOS4="" if [ -z "$EPO4VSN" ]; then @@ -62,7 +62,7 @@ fi if [ $seed -eq 0 ]; then # Seed can't be 0, random number will be used - seed=$RANDOM + seed=$(od -An -N2 -tu2 /dev/urandom | tr -d ' ') fi # OR filters the stdout with only HepMC useful data