diff --git a/MC/bin/o2dpg_sim_workflow.py b/MC/bin/o2dpg_sim_workflow.py index 6a6cfa39d..4dc23118f 100755 --- a/MC/bin/o2dpg_sim_workflow.py +++ b/MC/bin/o2dpg_sim_workflow.py @@ -724,9 +724,17 @@ def getDPL_global_options(bigshm=False, ccdbbackend=True): cpu=1, mem=1000) SGNGENtask['cmd']='' - if GENERATOR=="hepmc" and tf > 1: - # determine the skip number - cmd = 'export HEPMCEVENTSKIP=$(${O2DPG_ROOT}/UTILS/ReadHepMCEventSkip.sh ../HepMCEventSkip.json ' + str(tf) + ');' + if GENERATOR=="hepmc": + if tf == 1: + # determine the offset number + eventOffset = environ.get('HEPMCOFFSET') + print("HEPMCOFFSET: ", eventOffset) + if eventOffset == None: + eventOffset = 0 + cmd = 'export HEPMCEVENTSKIP=$(${O2DPG_ROOT}/UTILS/InitHepMCEventSkip.sh ../HepMCEventSkip.json ' + str(eventOffset) + ');' + elif tf > 1: + # determine the skip number + cmd = 'export HEPMCEVENTSKIP=$(${O2DPG_ROOT}/UTILS/ReadHepMCEventSkip.sh ../HepMCEventSkip.json ' + str(tf) + ');' SGNGENtask['cmd'] = cmd SGNGENtask['cmd'] +='${O2_ROOT}/bin/o2-sim --noGeant -j 1 --field ccdb --vertexMode kCCDB' \ + ' --run ' + str(args.run) + ' ' + str(CONFKEY) + str(TRIGGER) \ diff --git a/MC/config/ALICE3/ini/pythia8_pp_13tev.ini b/MC/config/ALICE3/ini/pythia8_pp_13tev.ini new file mode 100644 index 000000000..8d90b3977 --- /dev/null +++ b/MC/config/ALICE3/ini/pythia8_pp_13tev.ini @@ -0,0 +1,9 @@ +[Diamond] +width[2]=6.0 + +[GeneratorExternal] +fileName=${O2DPG_ROOT}/MC/config/ALICE3/pythia8/generator_pythia8_ALICE3.C +funcName=generator_pythia8_ALICE3() + +[GeneratorPythia8] +config=${O2DPG_ROOT}/MC/config/ALICE3/pythia8/generator/pythia8_pp_13tev.cfg diff --git a/MC/config/ALICE3/ini/pythia8_pp_ropes_13tev.ini b/MC/config/ALICE3/ini/pythia8_pp_ropes_13tev.ini new file mode 100644 index 000000000..008ad657f --- /dev/null +++ b/MC/config/ALICE3/ini/pythia8_pp_ropes_13tev.ini @@ -0,0 +1,9 @@ +[Diamond] +width[2]=6.0 + +[GeneratorExternal] +fileName=${O2DPG_ROOT}/MC/config/ALICE3/pythia8/generator_pythia8_ALICE3.C +funcName=generator_pythia8_ALICE3() + +[GeneratorPythia8] +config=${O2DPG_ROOT}/MC/config/ALICE3/pythia8/generator/pythia8_pp_ropes_13tev.cfg diff --git a/MC/config/ALICE3/ini/pythia8_pp_shoving_13tev.ini b/MC/config/ALICE3/ini/pythia8_pp_shoving_13tev.ini new file mode 100644 index 000000000..b6a02a729 --- /dev/null +++ b/MC/config/ALICE3/ini/pythia8_pp_shoving_13tev.ini @@ -0,0 +1,9 @@ +[Diamond] +width[2]=6.0 + +[GeneratorExternal] +fileName=${O2DPG_ROOT}/MC/config/ALICE3/pythia8/generator_pythia8_ALICE3.C +funcName=generator_pythia8_ALICE3() + +[GeneratorPythia8] +config=${O2DPG_ROOT}/MC/config/ALICE3/pythia8/generator/pythia8_pp_shoving_13tev.cfg diff --git a/MC/config/ALICE3/ini/tests/pythia8_pp_13tev.C b/MC/config/ALICE3/ini/tests/pythia8_pp_13tev.C new file mode 100644 index 000000000..8fb911b19 --- /dev/null +++ b/MC/config/ALICE3/ini/tests/pythia8_pp_13tev.C @@ -0,0 +1,3 @@ +int External() { + return 0; +} diff --git a/MC/config/ALICE3/ini/tests/pythia8_pp_ropes_13tev.C b/MC/config/ALICE3/ini/tests/pythia8_pp_ropes_13tev.C new file mode 100644 index 000000000..8fb911b19 --- /dev/null +++ b/MC/config/ALICE3/ini/tests/pythia8_pp_ropes_13tev.C @@ -0,0 +1,3 @@ +int External() { + return 0; +} diff --git a/MC/config/ALICE3/ini/tests/pythia8_pp_shoving_13tev.C b/MC/config/ALICE3/ini/tests/pythia8_pp_shoving_13tev.C new file mode 100644 index 000000000..8fb911b19 --- /dev/null +++ b/MC/config/ALICE3/ini/tests/pythia8_pp_shoving_13tev.C @@ -0,0 +1,3 @@ +int External() { + return 0; +} diff --git a/MC/config/ALICE3/pythia8/generator/pythia8_pp_13tev.cfg b/MC/config/ALICE3/pythia8/generator/pythia8_pp_13tev.cfg new file mode 100644 index 000000000..18c10c6dd --- /dev/null +++ b/MC/config/ALICE3/pythia8/generator/pythia8_pp_13tev.cfg @@ -0,0 +1,16 @@ +### Specify beams +Beams:idA = 2212 +Beams:idB = 2212 +Beams:eCM = 13000. ### energy + +Beams:frameType = 1 +ParticleDecays:limitTau0 = on +ParticleDecays:tau0Max = 10. ### match alice: 1cm/c = 10.0mm/c + +### processes +SoftQCD:inelastic = on # all inelastic processes + +# default: do nothing, Monash 2013 will do its thing +Tune:pp = 14 + +Random:setSeed = on diff --git a/MC/config/ALICE3/pythia8/generator/pythia8_pp_ropes_13tev.cfg b/MC/config/ALICE3/pythia8/generator/pythia8_pp_ropes_13tev.cfg new file mode 100644 index 000000000..a8bd9dc17 --- /dev/null +++ b/MC/config/ALICE3/pythia8/generator/pythia8_pp_ropes_13tev.cfg @@ -0,0 +1,43 @@ +### Specify beams +Beams:idA = 2212 +Beams:idB = 2212 +Beams:eCM = 13000. ### energy + +Beams:frameType = 1 +ParticleDecays:limitTau0 = on +ParticleDecays:tau0Max = 10. ### match alice: 1cm/c = 10.0mm/c + +### processes +SoftQCD:inelastic = on # all inelastic processes + +### Ropes settings +MultiPartonInteractions:pT0Ref = 2.15 + +BeamRemnants:remnantMode = 1 +BeamRemnants:saturation = 5 + +ColourReconnection:mode = 1 +ColourReconnection:allowDoubleJunRem = off +ColourReconnection:m0 = 0.3 +ColourReconnection:allowJunctions = on +ColourReconnection:junctionCorrection = 1.2 +ColourReconnection:timeDilationMode = 2 +ColourReconnection:timeDilationPar = 0.18 + +Ropewalk:RopeHadronization = on +Ropewalk:doShoving = on +Ropewalk:tInit = 1.5 # Propagation time +Ropewalk:deltat = 0.05 +Ropewalk:tShove 0.1 +Ropewalk:gAmplitude = 0. # Set shoving strength to 0 explicitly +Ropewalk:doFlavour = on +Ropewalk:r0 = 0.5 +Ropewalk:m0 = 0.2 +Ropewalk:beta = 0.1 + +### Enabling setting of vertex information. +PartonVertex:setVertex = on +PartonVertex:protonRadius = 0.7 +PartonVertex:emissionWidth = 0.1 + +Random:setSeed = on diff --git a/MC/config/ALICE3/pythia8/generator/pythia8_pp_shoving_13tev.cfg b/MC/config/ALICE3/pythia8/generator/pythia8_pp_shoving_13tev.cfg new file mode 100644 index 000000000..221e08752 --- /dev/null +++ b/MC/config/ALICE3/pythia8/generator/pythia8_pp_shoving_13tev.cfg @@ -0,0 +1,34 @@ +### Specify beams +Beams:idA = 2212 +Beams:idB = 2212 +Beams:eCM = 13000. ### energy + +Beams:frameType = 1 +ParticleDecays:limitTau0 = on +ParticleDecays:tau0Max = 10. ### match alice: 1cm/c = 10.0mm/c + +### processes +SoftQCD:inelastic = on # all inelastic processes + +### Shoving settings +Ropewalk:RopeHadronization = on +Ropewalk:doShoving = on +Ropewalk:doFlavour = off +Ropewalk:rCutOff = 10.0 +Ropewalk:limitMom = on +Ropewalk:pTcut = 2.0 +Ropewalk:r0 = 0.41 +Ropewalk:m0 = 0.2 +Ropewalk:gAmplitude = 10.0 +Ropewalk:gExponent = 1.0 +Ropewalk:deltat = 0.1 +Ropewalk:tShove = 1. +Ropewalk:deltay = 0.1 +Ropewalk:tInit = 1.5 + +### Enabling setting of vertex information. +PartonVertex:setVertex = on +PartonVertex:protonRadius = 0.7 +PartonVertex:emissionWidth = 0.1 + +Random:setSeed = on diff --git a/UTILS/InitHepMCEventSkip.sh b/UTILS/InitHepMCEventSkip.sh new file mode 100755 index 000000000..a7d45273b --- /dev/null +++ b/UTILS/InitHepMCEventSkip.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# Path to the JSON file +JSON_FILE=${1:-HepMC_EventSkip_ALT.json} +EVENTS=$2 + +# insert event count offset +echo "[]" > ${JSON_FILE} # init json file +JQ_COMMAND="jq '. + [{"HepMCEventOffset": ${EVENTS}}]' ${JSON_FILE} > tmp_123.json; mv tmp_123.json ${JSON_FILE}" +eval ${JQ_COMMAND} + +echo ${EVENTS} diff --git a/UTILS/ReadHepMCEventSkip.sh b/UTILS/ReadHepMCEventSkip.sh index f242eafd7..2fc548b09 100755 --- a/UTILS/ReadHepMCEventSkip.sh +++ b/UTILS/ReadHepMCEventSkip.sh @@ -3,5 +3,22 @@ # Path to the JSON file JSON_FILE=$1 tf=$2 + +# get event offset +JQCOMMAND="jq '.[] | select(.HepMCEventOffset) | .HepMCEventOffset' ${JSON_FILE}" +offset=`eval ${JQCOMMAND}` +if [ ! $offset ] +then + offset=0 +fi + +# count generated events JQCOMMAND="jq '[.[] | select(.tf < ${tf}) | .HepMCEventCount] | add' ${JSON_FILE}" -eval ${JQCOMMAND} \ No newline at end of file +events=`eval ${JQCOMMAND}` +if [ ! $events ] +then + events=0 +fi + +# total number of events to skip +echo $((offset + events))