diff --git a/MC/config/examples/epos4/epos.sh b/MC/config/examples/epos4/epos.sh index c416e03f7..13a30b0d0 100755 --- a/MC/config/examples/epos4/epos.sh +++ b/MC/config/examples/epos4/epos.sh @@ -5,7 +5,33 @@ # 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 + 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/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 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 case $1 in @@ -18,24 +44,26 @@ done if [ ! -f $optns.optns ]; then echo "Error: Options file $optns.optns not found" - exit 1 + exit 2 fi -if [ $seed -eq 0 ]; then - echo "Seed can't be 0, random number will be used" - seed=$RANDOM +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 -# 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=./ +if [ $seed -eq 0 ]; then + # Seed can't be 0, random number will be used + seed=$(od -An -N2 -tu2 /dev/urandom | tr -d ' ') 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/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/GeneratorEPOS4HQ.ini b/MC/config/examples/ini/GeneratorEPOS4HQ.ini new file mode 100644 index 000000000..de88cd801 --- /dev/null +++ b/MC/config/examples/ini/GeneratorEPOS4HQ.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/examplehq.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