Skip to content

Commit 581d16c

Browse files
authored
Adapt to use taskwrapper (#7)
1 parent c584551 commit 581d16c

File tree

4 files changed

+168
-106
lines changed

4 files changed

+168
-106
lines changed

MC/run/PWGGAJE/run_dirgamma.sh

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

33
# Generate gamma-jet events, Pythia8 in a given pt hard bin.
4-
# run_dirgamma.sh n_pthatbin
4+
# Execute: ./run_dirgamma.sh
5+
# Set at least before running PTHATBIN with 1 to 6
56

6-
set -x
7+
#set -x
78

8-
SIGEVENTS=10
9-
NWORKERS=2
10-
MODULES=
11-
RNDSEED=0 # [default = 0] time-based random seed
9+
# ----------- LOAD UTILITY FUNCTIONS --------------------------
10+
. ${O2_ROOT}/share/scripts/jobutils.sh
1211

13-
# generate Pythia8 gamma-jet configuration
12+
# ----------- START ACTUAL JOB -----------------------------
13+
14+
RNDSEED=${RNDSEED:-0} # [default = 0] time-based random seed
15+
16+
NSIGEVENTS=${NSIGEVENTS:-20}
17+
NWORKERS=${NWORKERS:-8}
18+
MODULES="--skipModules ZDC" #"PIPE ITS TPC EMCAL"
19+
CONFIG_ENERGY=${CONFIG_ENERGY:-5020.0}
20+
CONFIG_NUCLEUSA=${CONFIG_NUCLEUSA:-2212}
21+
CONFIG_NUCLEUSB=${CONFIG_NUCLEUSB:-2212}
1422

1523
# Define the pt hat bin arrays
1624
pthatbin_loweredges=(5 11 21 36 57 84)
1725
pthatbin_higheredges=(11 21 36 57 84 -1)
1826

19-
# Define environmental vars for pt binning
20-
PTHATBIN=$1 #set it here or externally? Add protection out of array?
27+
# Recover environmental vars for pt binning
28+
#PTHATBIN=${PTHATBIN:-1}
29+
30+
if [ -z "$PTHATBIN" ]; then
31+
echo "Pt-hat bin (env. var. PTHATBIN) not set, abort."
32+
exit 1
33+
fi
2134

2235
PTHATMIN=${pthatbin_loweredges[$PTHATBIN]}
2336
PTHATMAX=${pthatbin_higheredges[$PTHATBIN]}
2437

38+
# Generate Pythia8 gamma-jet configuration
2539
${O2DPG_ROOT}/MC/config/common/pythia8/utils/mkpy8cfg.py \
26-
--output=pythia8_dirgamma.cfg \
27-
--seed=${RNDSEED} \
28-
--idA=2212 \
29-
--idB=2212 \
30-
--eCM=13000. \
31-
--process=dirgamma \
32-
--ptHatMin=${PTHATMIN} \
33-
--ptHatMax=${PTHATMAX}
34-
35-
# embed signal into background
36-
37-
o2-sim -j ${NWORKERS} -n ${SIGEVENTS} -g pythia8 -m ${MODULES} \
38-
--configKeyValues "GeneratorPythia8.config=pythia8_dirgamma.cfg" \
39-
> log 2>&1
40+
--output=pythia8_dirgamma.cfg \
41+
--seed=${RNDSEED} \
42+
--idA=${CONFIG_NUCLEUSA} \
43+
--idB=${CONFIG_NUCLEUSB} \
44+
--eCM=${CONFIG_ENERGY} \
45+
--process=dirgamma \
46+
--ptHatMin=${PTHATMIN} \
47+
--ptHatMax=${PTHATMAX}
48+
49+
# Generate signal
50+
taskwrapper sgnsim.log o2-sim -j ${NWORKERS} -n ${NSIGEVENTS} \
51+
-g pythia8 -m ${MODULES} \
52+
--configKeyValues "GeneratorPythia8.config=pythia8_dirgamma.cfg" \
53+
-o sgn
54+
55+
# We need to exit for the ALIEN JOB HANDLER!
56+
exit 0
Lines changed: 44 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,62 @@
11
#!/usr/bin/env bash
22

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

6-
set -x
7+
#set -x
78

8-
MODULES="PIPE ITS TPC EMCAL"
9-
BKGEVENTS=5
10-
SIGEVENTS=20
11-
NWORKERS=8
9+
# ----------- LOAD UTILITY FUNCTIONS --------------------------
10+
. ${O2_ROOT}/share/scripts/jobutils.sh
1211

13-
# generate background
12+
# ----------- START ACTUAL JOB -----------------------------
1413

15-
o2-sim -j ${NWORKERS} -n ${BKGEVENTS} -g pythia8hi -m ${MODULES} -o bkg \
16-
--configFile ${O2DPG_ROOT}/MC/config/common/ini/basic.ini \
17-
> logbkg 2>&1
18-
19-
# generate Pythia8 configuration
20-
21-
RNDSEED=0 # [default = 0] time-based random seed
14+
RNDSEED=${RNDSEED:-0} # [default = 0] time-based random seed
15+
NSIGEVENTS=${NSIGEVENTS:-20}
16+
NBKGEVENTS=${NBKGEVENTS:-20}
17+
NWORKERS=${NWORKERS:-8}
18+
MODULES="--skipModules ZDC" #"PIPE ITS TPC EMCAL"
19+
CONFIG_ENERGY=${CONFIG_ENERGY:-5020.0}
20+
CONFIG_NUCLEUSA=${CONFIG_NUCLEUSA:-2212}
21+
CONFIG_NUCLEUSB=${CONFIG_NUCLEUSB:-2212}
2222

2323
# Define the pt hat bin arrays
2424
pthatbin_loweredges=(5 11 21 36 57 84)
2525
pthatbin_higheredges=(11 21 36 57 84 -1)
2626

27-
# Define environmental vars for pt binning
28-
PTHATBIN=$1 #set it here or externally? Add protection out of array?
27+
# Recover environmental vars for pt binning
28+
#PTHATBIN=${PTHATBIN:-1}
29+
30+
if [ -z "$PTHATBIN" ]; then
31+
echo "Pt-hat bin (env. var. PTHATBIN) not set, abort."
32+
exit 1
33+
fi
2934

3035
PTHATMIN=${pthatbin_loweredges[$PTHATBIN]}
3136
PTHATMAX=${pthatbin_higheredges[$PTHATBIN]}
3237

38+
# Generate background
39+
taskwrapper bkgsim.log o2-sim -j ${NWORKERS} -n ${NBKGEVENTS} \
40+
-g pythia8hi -m ${MODULES} -o bkg \
41+
--configFile ${O2DPG_ROOT}/MC/config/common/ini/basic.ini
42+
43+
# Generate Pythia8 gamma-jet configuration
3344
${O2DPG_ROOT}/MC/config/common/pythia8/utils/mkpy8cfg.py \
34-
--output=pythia8_dirgamma.cfg \
35-
--seed=${RNDSEED} \
36-
--idA=2212 \
37-
--idB=2212 \
38-
--eCM=13000. \
39-
--process=dirgamma \
40-
--ptHatMin=${PTHATMIN} \
41-
--ptHatMax=${PTHATMAX}
42-
43-
# embed signal into background
44-
45-
o2-sim -j ${NWORKERS} -n ${SIGEVENTS} -g pythia8 -m ${MODULES} -o sgn \
45+
--output=pythia8_dirgamma.cfg \
46+
--seed=${RNDSEED} \
47+
--idA=${CONFIG_NUCLEUSA} \
48+
--idB=${CONFIG_NUCLEUSB} \
49+
--eCM=${CONFIG_ENERGY} \
50+
--process=dirgamma \
51+
--ptHatMin=${PTHATMIN} \
52+
--ptHatMax=${PTHATMAX}
53+
54+
# Generate and embed signal into background
55+
taskwrapper sgnsim.log o2-sim -j ${NWORKERS} -n ${NSIGEVENTS} \
56+
-g pythia8 -m ${MODULES} \
4657
--configKeyValues "GeneratorPythia8.config=pythia8_dirgamma.cfg" \
47-
--embedIntoFile bkg_Kine.root \
48-
> logsgn 2>&1
58+
--embedIntoFile bkg_Kine.root \
59+
-o sgn
60+
61+
# We need to exit for the ALIEN JOB HANDLER!
62+
exit 0

MC/run/PWGGAJE/run_jets.sh

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

33
# Generate jet-jet events, Pythia8 in a pre-defined pt hard bin.
4-
# run_jets.sh n_pthatbin
4+
# Execute: ./run_jets.sh
5+
# Set at least before running PTHATBIN with 1 to 21
56

6-
set -x
7+
#set -x
78

8-
SIGEVENTS=10
9-
NWORKERS=2
10-
MODULES=
11-
RNDSEED=0 # [default = 0] time-based random seed
9+
# ----------- LOAD UTILITY FUNCTIONS --------------------------
10+
. ${O2_ROOT}/share/scripts/jobutils.sh
1211

13-
# generate Pythia8 jet-jet configuration
12+
# ----------- START ACTUAL JOB -----------------------------
13+
14+
RNDSEED=${RNDSEED:-0} # [default = 0] time-based random seed
15+
16+
NSIGEVENTS=${NSIGEVENTS:-20}
17+
NWORKERS=${NWORKERS:-8}
18+
MODULES="--skipModules ZDC" #"PIPE ITS TPC EMCAL"
19+
CONFIG_ENERGY=${CONFIG_ENERGY:-5020.0}
20+
CONFIG_NUCLEUSA=${CONFIG_NUCLEUSA:-2212}
21+
CONFIG_NUCLEUSB=${CONFIG_NUCLEUSB:-2212}
1422

1523
# Define the pt hat bin arrays
1624
pthatbin_loweredges=(0 5 7 9 12 16 21 28 36 45 57 70 85 99 115 132 150 169 190 212 235)
1725
pthatbin_higheredges=( 5 7 9 12 16 21 28 36 45 57 70 85 99 115 132 150 169 190 212 235 -1)
1826

19-
# Define environmental vars for pt binning
20-
PTHATBIN=$1 #set it here or externally? Add protection out of array?
27+
# Recover environmental vars for pt binning
28+
#PTHATBIN=${PTHATBIN:-1}
29+
30+
if [ -z "$PTHATBIN" ]; then
31+
echo "Pt-hat bin (env. var. PTHATBIN) not set, abort."
32+
exit 1
33+
fi
2134

2235
PTHATMIN=${pthatbin_loweredges[$PTHATBIN]}
2336
PTHATMAX=${pthatbin_higheredges[$PTHATBIN]}
2437

38+
# Generate Pythia8 jet-jet configuration
2539
${O2DPG_ROOT}/MC/config/common/pythia8/utils/mkpy8cfg.py \
26-
--output=pythia8_jets.cfg \
27-
--seed=${RNDSEED} \
28-
--idA=2212 \
29-
--idB=2212 \
30-
--eCM=5020. \
31-
--process=jets \
32-
--ptHatMin=${PTHATMIN} \
33-
--ptHatMax=${PTHATMAX}
34-
35-
# embed signal into background
36-
37-
o2-sim -j ${NWORKERS} -n ${SIGEVENTS} -g pythia8 -m ${MODULES} \
38-
--configKeyValues "GeneratorPythia8.config=pythia8_jets.cfg" \
39-
> log 2>&1
40+
--output=pythia8_jets.cfg \
41+
--seed=${RNDSEED} \
42+
--idA=${CONFIG_NUCLEUSA} \
43+
--idB=${CONFIG_NUCLEUSB} \
44+
--eCM=${CONFIG_ENERGY} \
45+
--process=jets \
46+
--ptHatMin=${PTHATMIN} \
47+
--ptHatMax=${PTHATMAX}
48+
49+
# Generate signal
50+
taskwrapper sgnsim.log o2-sim -j ${NWORKERS} -n ${NSIGEVENTS} \
51+
-g pythia8 -m ${MODULES} \
52+
--configKeyValues "GeneratorPythia8.config=pythia8_jets.cfg" \
53+
-o sgn
54+
55+
# We need to exit for the ALIEN JOB HANDLER!
56+
exit 0
Lines changed: 44 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,62 @@
11
#!/usr/bin/env bash
22

33
# Embed jet-jet events in a pre-defined pT hard bin into HI events, both Pythia8
4-
# run_jets_embedding.sh n_pthatbin
4+
# Execute: ./run_jets_embedding.sh
5+
# Set at least before running PTHATBIN with 1 to 21
56

6-
set -x
7+
#set -x
78

8-
MODULES="PIPE ITS TPC EMCAL"
9-
BKGEVENTS=5
10-
SIGEVENTS=20
11-
NWORKERS=8
9+
# ----------- LOAD UTILITY FUNCTIONS --------------------------
10+
. ${O2_ROOT}/share/scripts/jobutils.sh
1211

13-
# generate background
12+
# ----------- START ACTUAL JOB -----------------------------
1413

15-
o2-sim -j ${NWORKERS} -n ${BKGEVENTS} -g pythia8hi -m ${MODULES} -o bkg \
16-
--configFile ${O2DPG_ROOT}/MC/config/common/ini/basic.ini \
17-
> logbkg 2>&1
18-
19-
# generate Pythia8 configuration
20-
21-
RNDSEED=0 # [default = 0] time-based random seed
14+
RNDSEED=${RNDSEED:-0} # [default = 0] time-based random seed
15+
NSIGEVENTS=${NSIGEVENTS:-20}
16+
NBKGEVENTS=${NBKGEVENTS:-20}
17+
NWORKERS=${NWORKERS:-8}
18+
MODULES="--skipModules ZDC" #"PIPE ITS TPC EMCAL"
19+
CONFIG_ENERGY=${CONFIG_ENERGY:-5020.0}
20+
CONFIG_NUCLEUSA=${CONFIG_NUCLEUSA:-2212}
21+
CONFIG_NUCLEUSB=${CONFIG_NUCLEUSB:-2212}
2222

2323
# Define the pt hat bin arrays
2424
pthatbin_loweredges=(0 5 7 9 12 16 21 28 36 45 57 70 85 99 115 132 150 169 190 212 235)
2525
pthatbin_higheredges=( 5 7 9 12 16 21 28 36 45 57 70 85 99 115 132 150 169 190 212 235 -1)
2626

27-
# Define environmental vars for pt binning
28-
PTHATBIN=$1 #set it here or externally? Add protection out of array?
27+
# Recover environmental vars for pt binning
28+
#PTHATBIN=${PTHATBIN:-1}
29+
30+
if [ -z "$PTHATBIN" ]; then
31+
echo "Pt-hat bin (env. var. PTHATBIN) not set, abort."
32+
exit 1
33+
fi
2934

3035
PTHATMIN=${pthatbin_loweredges[$PTHATBIN]}
3136
PTHATMAX=${pthatbin_higheredges[$PTHATBIN]}
3237

38+
# Generate background
39+
taskwrapper bkgsim.log o2-sim -j ${NWORKERS} -n ${NBKGEVENTS} \
40+
-g pythia8hi -m ${MODULES} -o bkg \
41+
--configFile ${O2DPG_ROOT}/MC/config/common/ini/basic.ini
42+
43+
# Generate Pythia8 jet-jet configuration
3344
${O2DPG_ROOT}/MC/config/common/pythia8/utils/mkpy8cfg.py \
34-
--output=pythia8_jets.cfg \
35-
--seed=${RNDSEED} \
36-
--idA=2212 \
37-
--idB=2212 \
38-
--eCM=5020. \
39-
--process=jets \
40-
--ptHatMin=${PTHATMIN} \
41-
--ptHatMax=${PTHATMAX}
42-
43-
# embed signal into background
44-
45-
o2-sim -j ${NWORKERS} -n ${SIGEVENTS} -g pythia8 -m ${MODULES} -o sgn \
45+
--output=pythia8_jets.cfg \
46+
--seed=${RNDSEED} \
47+
--idA=${CONFIG_NUCLEUSA} \
48+
--idB=${CONFIG_NUCLEUSB} \
49+
--eCM=${CONFIG_ENERGY} \
50+
--process=jets \
51+
--ptHatMin=${PTHATMIN} \
52+
--ptHatMax=${PTHATMAX}
53+
54+
# Generate and embed signal into background
55+
taskwrapper sgnsim.log o2-sim -j ${NWORKERS} -n ${NSIGEVENTS} \
56+
-g pythia8 -m ${MODULES} \
4657
--configKeyValues "GeneratorPythia8.config=pythia8_jets.cfg" \
47-
--embedIntoFile bkg_Kine.root \
48-
> logsgn 2>&1
58+
--embedIntoFile bkg_Kine.root \
59+
-o sgn
60+
61+
# We need to exit for the ALIEN JOB HANDLER!
62+
exit 0

0 commit comments

Comments
 (0)