Skip to content

Commit 12513b0

Browse files
committed
addapt GA/JE run scripts to run with weight pT hard and fixed pT hard range
1 parent dd27365 commit 12513b0

File tree

9 files changed

+181
-73
lines changed

9 files changed

+181
-73
lines changed

MC/bin/o2dpg_sim_workflow.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,9 @@ def getDPL_global_options(bigshm=False,nosmallrate=False):
215215
TRIGGER=' -t ' + args.trigger
216216

217217
## Pt Hat productions
218-
WEIGHTPOW=int(args.weightPow)
219-
PTHATMIN=int(args.ptHatMin)
220-
PTHATMAX=int(args.ptHatMax)
218+
WEIGHTPOW=float(args.weightPow)
219+
PTHATMIN=float(args.ptHatMin)
220+
PTHATMAX=float(args.ptHatMax)
221221

222222
# Recover PTHATMIN and PTHATMAX from pre-defined array depending bin number PTHATBIN
223223
# I think these arrays can be removed and rely on scripts where the arrays are hardcoded
@@ -310,7 +310,7 @@ def getDPL_global_options(bigshm=False,nosmallrate=False):
310310
--process='+str(PROCESS)+' \
311311
--ptHatMin=' + str(PTHATMIN) + ' \
312312
--ptHatMax=' + str(PTHATMAX)
313-
if WEIGHTPOW > -1:
313+
if WEIGHTPOW > 0:
314314
SGN_CONFIG_task['cmd'] = SGN_CONFIG_task['cmd'] + ' --weightPow=' + str(WEIGHTPOW)
315315
# if we configure pythia8 here --> we also need to adjust the configuration
316316
# TODO: we need a proper config container/manager so as to combine these local configs with external configs etc.

MC/run/PWGGAJE/run_decaygammajets.sh

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
# Generate jet-jet events, PYTHIA8 in a given pt hard bin.
3+
# Generate jet-jet events, PYTHIA8 in a given pt hard bin and weighted.
44
# Select the event depending min Pt and acceptance of decay photons.
55
# Execute: ./run_decaygammajets.sh
66
# Set at least before running PTHATBIN with 1 to 6
@@ -19,8 +19,14 @@ RNDSEED=${RNDSEED:-0} # [default = 0] time-based random seed
1919
NSIGEVENTS=${NSIGEVENTS:-20}
2020
NTIMEFRAMES=${NTIMEFRAMES:-5}
2121
NWORKERS=${NWORKERS:-8}
22+
MODULES="--skipModules ZDC" #"PIPE ITS TPC EMCAL"
2223
CONFIG_ENERGY=${CONFIG_ENERGY:-13000.0}
2324
SIMENGINE=${SIMENGINE:-TGeant4}
25+
WEIGHTPOW=${WEIGHTPOW:-6.0}
26+
27+
# Default for weighted productions
28+
PTHATMIN=${PTHATMIN:-5.0}
29+
PTHATMAX=${PTHATMAX:-300.0}
2430

2531
# Recover environmental vars for detector acceptance binning
2632
# accessed inside prompt_gamma.C
@@ -37,29 +43,27 @@ echo 'Decay photon minimum pT option ' $PTTRIGMIN "GeV/c"
3743
#PTHATBIN=${PTHATBIN:-1}
3844

3945
if [ -z "$PTHATBIN" ]; then
40-
echo "Pt-hat bin (env. var. PTHATBIN) not set, abort."
41-
exit 1
42-
fi
43-
44-
# Define the pt hat bin arrays and set bin depending threshold
45-
if [ $PTTRIGMIN = "3.5" ]; then
46-
pthatbin_loweredges=(5 7 9 12 16 21)
47-
pthatbin_higheredges=(7 9 12 16 21 -1)
48-
49-
PTHATMIN=${pthatbin_loweredges[$PTHATBIN]}
50-
PTHATMAX=${pthatbin_higheredges[$PTHATBIN]}
46+
echo "Open Pt-hat range set"
47+
else
48+
# Define the pt hat bin arrays and set bin depending threshold
49+
if [ $PTTRIGMIN = "3.5" ]; then
50+
pthatbin_loweredges=(5 7 9 12 16 21)
51+
pthatbin_higheredges=(7 9 12 16 21 -1)
52+
53+
PTHATMIN=${pthatbin_loweredges[$PTHATBIN]}
54+
PTHATMAX=${pthatbin_higheredges[$PTHATBIN]}
55+
fi
56+
57+
if [ $PTTRIGMIN = "7" ]; then
58+
pthatbin_loweredges=(8 10 14 19 26 35 48 66)
59+
pthatbin_higheredges=(10 14 19 26 35 48 66 -1)
60+
61+
PTHATMIN=${pthatbin_loweredges[$PTHATBIN]}
62+
PTHATMAX=${pthatbin_higheredges[$PTHATBIN]}
63+
fi
64+
echo "Set Pt hard bin " $PTHATBIN ": [" $PTHATMIN " , " $PTHATMAX "]"
5165
fi
5266

53-
if [ $PTTRIGMIN = "7" ]; then
54-
pthatbin_loweredges=(8 10 14 19 26 35 48 66)
55-
pthatbin_higheredges=(10 14 19 26 35 48 66 -1)
56-
57-
PTHATMIN=${pthatbin_loweredges[$PTHATBIN]}
58-
PTHATMAX=${pthatbin_higheredges[$PTHATBIN]}
59-
fi
60-
61-
echo "Set Pt hard bin " $PTHATBIN ": [" $PTHATMIN " , " $PTHATMAX "]"
62-
6367
# Recover environmental vars for detector acceptance binning
6468
# accessed inside prompt_gamma.C
6569
export PARTICLE_ACCEPTANCE=${PARTICLE_ACCEPTANCE:-1}
@@ -76,6 +80,7 @@ ${O2DPG_ROOT}/MC/bin/o2dpg_sim_workflow.py -eCM ${CONFIG_ENERGY} -col pp -gen py
7680
-ptHatMin ${PTHATMIN} -ptHatMax ${PTHATMAX} \
7781
-tf ${NTIMEFRAMES} -ns ${NSIGEVENTS} -e ${SIMENGINE} \
7882
-j ${NWORKERS} -mod "--skipModules ZDC" \
83+
-weightPow ${WEIGHTPOW} \
7984
-trigger "external" -ini "\$O2DPG_ROOT/MC/config/PWGGAJE/ini/trigger_decay_gamma.ini"
8085

8186
# run workflow

MC/run/PWGGAJE/run_dirgamma.sh

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
# Generate gamma-jet events, PYTHIA8 in a given pt hard bin.
3+
# Generate gamma-jet events, PYTHIA8 in a given pt hard bin and weighted.
44
# Select the event depending detector acceptance and/or outgoing parton flavour.
55
# Execute: ./run_dirgamma.sh
66
# Set at least before running PTHATBIN with 1 to 6
@@ -22,6 +22,11 @@ NWORKERS=${NWORKERS:-8}
2222
MODULES="--skipModules ZDC" #"PIPE ITS TPC EMCAL"
2323
CONFIG_ENERGY=${CONFIG_ENERGY:-13000.0}
2424
SIMENGINE=${SIMENGINE:-TGeant4}
25+
WEIGHTPOW=${WEIGHTPOW:-6.0}
26+
27+
# Default for weighted productions
28+
PTHATMIN=${PTHATMIN:-5.0}
29+
PTHATMAX=${PTHATMAX:-300.0}
2530

2631
# Define the pt hat bin arrays
2732
pthatbin_loweredges=(5 11 21 36 57 84)
@@ -31,13 +36,12 @@ pthatbin_higheredges=(11 21 36 57 84 -1)
3136
#PTHATBIN=${PTHATBIN:-1}
3237

3338
if [ -z "$PTHATBIN" ]; then
34-
echo "Pt-hat bin (env. var. PTHATBIN) not set, abort."
35-
exit 1
39+
echo "Open Pt-hat range set"
40+
else
41+
PTHATMIN=${pthatbin_loweredges[$PTHATBIN]}
42+
PTHATMAX=${pthatbin_higheredges[$PTHATBIN]}
3643
fi
3744

38-
PTHATMIN=${pthatbin_loweredges[$PTHATBIN]}
39-
PTHATMAX=${pthatbin_higheredges[$PTHATBIN]}
40-
4145
# Recover environmental vars for detector acceptance binning
4246
# accessed inside prompt_gamma.C
4347
export PARTICLE_ACCEPTANCE=${PARTICLE_ACCEPTANCE:-1}
@@ -60,6 +64,7 @@ ${O2DPG_ROOT}/MC/bin/o2dpg_sim_workflow.py -eCM ${CONFIG_ENERGY} -col pp -gen py
6064
-ptHatMin ${PTHATMIN} -ptHatMax ${PTHATMAX} \
6165
-tf ${NTIMEFRAMES} -ns ${NSIGEVENTS} -e ${SIMENGINE} \
6266
-j ${NWORKERS} -mod "--skipModules ZDC" \
67+
-weightPow ${WEIGHTPOW} \
6368
-trigger "external" -ini "\$O2DPG_ROOT/MC/config/PWGGAJE/ini/trigger_prompt_gamma.ini"
6469

6570
# run workflow

MC/run/PWGGAJE/run_dirgamma_embedding.sh

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/usr/bin/env bash
22

3-
# Embed gamma-jet events in a pre-defined pT hard bin into HI events, both Pythia8
3+
# Embed gamma-jet events in a pre-defined pT hard bin and weighted
4+
# into HI events, both Pythia8
45
# Execute: ./run_dirgamma_embedding.sh
5-
# Set at least before running PTHATBIN with 1 to 6
66

77
#set -x
88

@@ -16,8 +16,14 @@ NSIGEVENTS=${NSIGEVENTS:-2}
1616
NBKGEVENTS=${NBKGEVENTS:-1}
1717
NTIMEFRAMES=${NTIMEFRAMES:-5}
1818
NWORKERS=${NWORKERS:-8}
19+
MODULES="--skipModules ZDC" #"PIPE ITS TPC EMCAL"
1920
CONFIG_ENERGY=${CONFIG_ENERGY:-5020.0}
2021
SIMENGINE=${SIMENGINE:-TGeant4}
22+
WEIGHTPOW=${WEIGHTPOW:-6.0}
23+
24+
# Default for weighted productions
25+
PTHATMIN=${PTHATMIN:-5.0}
26+
PTHATMAX=${PTHATMAX:-300.0}
2127

2228
# Define the pt hat bin arrays
2329
pthatbin_loweredges=(5 11 21 36 57 84)
@@ -27,13 +33,12 @@ pthatbin_higheredges=(11 21 36 57 84 -1)
2733
#PTHATBIN=${PTHATBIN:-1}
2834

2935
if [ -z "$PTHATBIN" ]; then
30-
echo "Pt-hat bin (env. var. PTHATBIN) not set, abort."
31-
exit 1
36+
echo "Open Pt-hat range set"
37+
else
38+
PTHATMIN=${pthatbin_loweredges[$PTHATBIN]}
39+
PTHATMAX=${pthatbin_higheredges[$PTHATBIN]}
3240
fi
3341

34-
PTHATMIN=${pthatbin_loweredges[$PTHATBIN]}
35-
PTHATMAX=${pthatbin_higheredges[$PTHATBIN]}
36-
3742
# Recover environmental vars for detector acceptance binning
3843
# accessed inside prompt_gamma.C
3944
export PARTICLE_ACCEPTANCE=${PARTICLE_ACCEPTANCE:-1}
@@ -55,6 +60,7 @@ ${O2DPG_ROOT}/MC/bin/o2dpg_sim_workflow.py -eCM ${CONFIG_ENERGY} -col pp -gen py
5560
-tf ${NTIMEFRAMES} -ns ${NSIGEVENTS} -e ${SIMENGINE} \
5661
-nb ${NBKGEVENTS} --embedding \
5762
-j ${NWORKERS} -mod "--skipModules ZDC" \
63+
-weightPow ${WEIGHTPOW} \
5864
-trigger "external" -ini "\$O2DPG_ROOT/MC/config/PWGGAJE/ini/trigger_prompt_gamma.ini"
5965

6066
# run workflow

MC/run/PWGGAJE/run_dirgamma_hook.sh

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
#!/usr/bin/env bash
22

3-
# Generate gamma-jet events, PYTHIA8 in a given pt hard bin.
3+
# Generate gamma-jet events, PYTHIA8 in a given pt hard bin and weighted.
44
# Select the event depending detector acceptance and/or outgoing parton flavour
55
# using PYTHIA8 hooks.
66
# Execute: ./run_dirgamma_hook.sh
7-
# Set at least before running PTHATBIN with 1 to 6
87
# and PARTICLE_ACCEPTANCE, see
98
# $O2DPG_ROOT/MC/config/PWGGAJE/hooks/prompt_gamma_hook.C
109

@@ -23,6 +22,11 @@ NWORKERS=${NWORKERS:-8}
2322
MODULES="--skipModules ZDC" #"PIPE ITS TPC EMCAL"
2423
CONFIG_ENERGY=${CONFIG_ENERGY:-13000.0}
2524
SIMENGINE=${SIMENGINE:-TGeant4}
25+
WEIGHTPOW=${WEIGHTPOW:-6.0}
26+
27+
# Default for weighted productions
28+
PTHATMIN=${PTHATMIN:-5.0}
29+
PTHATMAX=${PTHATMAX:-300.0}
2630

2731
# Define the pt hat bin arrays
2832
pthatbin_loweredges=(5 11 21 36 57 84)
@@ -32,13 +36,12 @@ pthatbin_higheredges=(11 21 36 57 84 -1)
3236
#PTHATBIN=${PTHATBIN:-1}
3337

3438
if [ -z "$PTHATBIN" ]; then
35-
echo "Pt-hat bin (env. var. PTHATBIN) not set, abort."
36-
exit 1
39+
echo "Open Pt-hat range set"
40+
else
41+
PTHATMIN=${pthatbin_loweredges[$PTHATBIN]}
42+
PTHATMAX=${pthatbin_higheredges[$PTHATBIN]}
3743
fi
3844

39-
PTHATMIN=${pthatbin_loweredges[$PTHATBIN]}
40-
PTHATMAX=${pthatbin_higheredges[$PTHATBIN]}
41-
4245
# Recover environmental vars for detector acceptance binning
4346
# accessed inside prompt_gamma.C
4447
export PARTICLE_ACCEPTANCE=${PARTICLE_ACCEPTANCE:-1}
@@ -61,6 +64,7 @@ ${O2DPG_ROOT}/MC/bin/o2dpg_sim_workflow.py -eCM ${CONFIG_ENERGY} -col pp -gen py
6164
-ptHatMin ${PTHATMIN} -ptHatMax ${PTHATMAX} \
6265
-tf ${NTIMEFRAMES} -ns ${NSIGEVENTS} -e ${SIMENGINE} \
6366
-j ${NWORKERS} -mod "--skipModules ZDC" \
67+
-weightPow ${WEIGHTPOW} \
6468
-ini "\$O2DPG_ROOT/MC/config/PWGGAJE/ini/hook_prompt_gamma.ini"
6569

6670
# run workflow
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
#!/usr/bin/env bash
2+
3+
# Embed gamma-jet events, PYTHIA8 in a given pt hard bin and weighted
4+
# into HI events, both Pythia8
5+
# Select the event depending detector acceptance and/or outgoing parton flavour
6+
# using PYTHIA8 hooks.
7+
# Execute: ./run_dirgamma_hook.sh
8+
# and PARTICLE_ACCEPTANCE, see
9+
# $O2DPG_ROOT/MC/config/PWGGAJE/hooks/prompt_gamma_hook.C
10+
11+
#set -x
12+
13+
# ----------- LOAD UTILITY FUNCTIONS --------------------------
14+
. ${O2_ROOT}/share/scripts/jobutils.sh
15+
16+
# ----------- START ACTUAL JOB -----------------------------
17+
18+
RNDSEED=${RNDSEED:-0} # [default = 0] time-based random seed
19+
NSIGEVENTS=${NSIGEVENTS:-2}
20+
NBKGEVENTS=${NBKGEVENTS:-1}
21+
NTIMEFRAMES=${NTIMEFRAMES:-5}
22+
NWORKERS=${NWORKERS:-8}
23+
MODULES="--skipModules ZDC" #"PIPE ITS TPC EMCAL"
24+
CONFIG_ENERGY=${CONFIG_ENERGY:-5200.0}
25+
SIMENGINE=${SIMENGINE:-TGeant4}
26+
WEIGHTPOW=${WEIGHTPOW:-6.0}
27+
28+
# Default for weighted productions
29+
PTHATMIN=${PTHATMIN:-5.0}
30+
PTHATMAX=${PTHATMAX:-300.0}
31+
32+
# Define the pt hat bin arrays
33+
pthatbin_loweredges=(5 11 21 36 57 84)
34+
pthatbin_higheredges=(11 21 36 57 84 -1)
35+
36+
# Recover environmental vars for pt binning
37+
#PTHATBIN=${PTHATBIN:-1}
38+
39+
if [ -z "$PTHATBIN" ]; then
40+
echo "Open Pt-hat range set"
41+
else
42+
PTHATMIN=${pthatbin_loweredges[$PTHATBIN]}
43+
PTHATMAX=${pthatbin_higheredges[$PTHATBIN]}
44+
fi
45+
46+
# Recover environmental vars for detector acceptance binning
47+
# accessed inside prompt_gamma.C
48+
export PARTICLE_ACCEPTANCE=${PARTICLE_ACCEPTANCE:-1}
49+
50+
if [ -z "$PARTICLE_ACCEPTANCE" ]; then
51+
echo "Detector acceptance option (env. var. PARTICLE_ACCEPTANCE) not set, abort."
52+
exit 1
53+
fi
54+
55+
echo 'Detector acceptance option ' $PARTICLE_ACCEPTANCE
56+
57+
# Recover environmental vars for outgoing parton flavour
58+
# accessed inside prompt_gamma.C
59+
export CONFIG_OUTPARTON_PDG=${CONFIG_OUTPARTON_PDG:-0}
60+
61+
echo 'Parton PDG option ' $CONFIG_OUTPARTON_PDG
62+
63+
# create workflow
64+
${O2DPG_ROOT}/MC/bin/o2dpg_sim_workflow.py -eCM ${CONFIG_ENERGY} -col pp -gen pythia8 -proc "dirgamma" \
65+
-ptHatMin ${PTHATMIN} -ptHatMax ${PTHATMAX} \
66+
-tf ${NTIMEFRAMES} -ns ${NSIGEVENTS} -e ${SIMENGINE} \
67+
-nb ${NBKGEVENTS} --embedding \
68+
-j ${NWORKERS} -mod "--skipModules ZDC" \
69+
-weightPow ${WEIGHTPOW} \
70+
-ini "\$O2DPG_ROOT/MC/config/PWGGAJE/ini/hook_prompt_gamma.ini"
71+
72+
# run workflow
73+
${O2DPG_ROOT}/MC/bin/o2_dpg_workflow_runner.py -f workflow.json
74+
75+
exit 0

MC/run/PWGGAJE/run_jets.sh

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
#!/usr/bin/env bash
22

3-
# Generate jet-jet events, Pythia8 in a pre-defined pt hard bin.
3+
# Generate jet-jet events, Pythia8 in a pre-defined pt hard bin and weighted.
44
# Execute: ./run_jets.sh
5-
# Set at least before running PTHATBIN with 1 to 21
65

76
#set -x
87

@@ -19,6 +18,11 @@ NWORKERS=${NWORKERS:-8}
1918
MODULES="--skipModules ZDC" #"PIPE ITS TPC EMCAL"
2019
CONFIG_ENERGY=${CONFIG_ENERGY:-13000.0}
2120
SIMENGINE=${SIMENGINE:-TGeant4}
21+
WEIGHTPOW=${WEIGHTPOW:-6.0}
22+
23+
# Default for weighted productions
24+
PTHATMIN=${PTHATMIN:-5.0}
25+
PTHATMAX=${PTHATMAX:-300.0}
2226

2327
# Define the pt hat bin arrays
2428
pthatbin_loweredges=(0 5 7 9 12 16 21 28 36 45 57 70 85 99 115 132 150 169 190 212 235)
@@ -28,18 +32,18 @@ pthatbin_higheredges=( 5 7 9 12 16 21 28 36 45 57 70 85 99 115 132 150 169 190 2
2832
#PTHATBIN=${PTHATBIN:-1}
2933

3034
if [ -z "$PTHATBIN" ]; then
31-
echo "Pt-hat bin (env. var. PTHATBIN) not set, abort."
32-
exit 1
35+
echo "Open Pt-hat range set"
36+
else
37+
PTHATMIN=${pthatbin_loweredges[$PTHATBIN]}
38+
PTHATMAX=${pthatbin_higheredges[$PTHATBIN]}
3339
fi
3440

35-
PTHATMIN=${pthatbin_loweredges[$PTHATBIN]}
36-
PTHATMAX=${pthatbin_higheredges[$PTHATBIN]}
37-
3841
# create workflow
3942
${O2DPG_ROOT}/MC/bin/o2dpg_sim_workflow.py -eCM ${CONFIG_ENERGY} -col pp -gen pythia8 -proc "jets" \
40-
-ptHatMin ${PTHATMIN} -ptHatMax ${PTHATMAX} \
41-
-tf ${NTIMEFRAMES} -ns ${NSIGEVENTS} -e ${SIMENGINE} \
42-
-j ${NWORKERS} -mod "--skipModules ZDC"
43+
-ptHatMin ${PTHATMIN} -ptHatMax ${PTHATMAX} \
44+
-tf ${NTIMEFRAMES} -ns ${NSIGEVENTS} -e ${SIMENGINE} \
45+
-j ${NWORKERS} -mod "--skipModules ZDC" \
46+
-weightPow ${WEIGHTPOW}
4347

4448
# run workflow
4549
${O2DPG_ROOT}/MC/bin/o2_dpg_workflow_runner.py -f workflow.json

0 commit comments

Comments
 (0)