Skip to content

Commit

Permalink
Merge branch 'AliceO2Group:master' into fix-laser-raw-qc
Browse files Browse the repository at this point in the history
  • Loading branch information
rmunzer authored Sep 24, 2024
2 parents 8502eaf + 9780b46 commit bc4acc4
Show file tree
Hide file tree
Showing 12 changed files with 170 additions and 4 deletions.
14 changes: 11 additions & 3 deletions MC/bin/o2dpg_sim_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down
9 changes: 9 additions & 0 deletions MC/config/ALICE3/ini/pythia8_pp_13tev.ini
Original file line number Diff line number Diff line change
@@ -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
9 changes: 9 additions & 0 deletions MC/config/ALICE3/ini/pythia8_pp_ropes_13tev.ini
Original file line number Diff line number Diff line change
@@ -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
9 changes: 9 additions & 0 deletions MC/config/ALICE3/ini/pythia8_pp_shoving_13tev.ini
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions MC/config/ALICE3/ini/tests/pythia8_pp_13tev.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
int External() {
return 0;
}
3 changes: 3 additions & 0 deletions MC/config/ALICE3/ini/tests/pythia8_pp_ropes_13tev.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
int External() {
return 0;
}
3 changes: 3 additions & 0 deletions MC/config/ALICE3/ini/tests/pythia8_pp_shoving_13tev.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
int External() {
return 0;
}
16 changes: 16 additions & 0 deletions MC/config/ALICE3/pythia8/generator/pythia8_pp_13tev.cfg
Original file line number Diff line number Diff line change
@@ -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
43 changes: 43 additions & 0 deletions MC/config/ALICE3/pythia8/generator/pythia8_pp_ropes_13tev.cfg
Original file line number Diff line number Diff line change
@@ -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
34 changes: 34 additions & 0 deletions MC/config/ALICE3/pythia8/generator/pythia8_pp_shoving_13tev.cfg
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions UTILS/InitHepMCEventSkip.sh
Original file line number Diff line number Diff line change
@@ -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}
19 changes: 18 additions & 1 deletion UTILS/ReadHepMCEventSkip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}
events=`eval ${JQCOMMAND}`
if [ ! $events ]
then
events=0
fi

# total number of events to skip
echo $((offset + events))

0 comments on commit bc4acc4

Please sign in to comment.