From bc5026965cbb010b9db7318b19e28c3f1e6f9107 Mon Sep 17 00:00:00 2001 From: Gustavo Conesa Date: Tue, 17 Nov 2020 20:03:41 +0100 Subject: [PATCH 1/2] first implementation of jet-jet and gamma-jet configuration and scripts --- MC/config/common/pythia8/utils/mkpy8cfg.py | 8 +++- MC/run/PWGGAJE/run_dirgamma.sh | 38 ++++++++++++++++++ MC/run/PWGGAJE/run_dirgamma_embedding.sh | 46 ++++++++++++++++++++++ MC/run/PWGGAJE/run_jets.sh | 38 ++++++++++++++++++ MC/run/PWGGAJE/run_jets_embedding.sh | 46 ++++++++++++++++++++++ 5 files changed, 174 insertions(+), 2 deletions(-) create mode 100755 MC/run/PWGGAJE/run_dirgamma.sh create mode 100755 MC/run/PWGGAJE/run_dirgamma_embedding.sh create mode 100755 MC/run/PWGGAJE/run_jets.sh create mode 100755 MC/run/PWGGAJE/run_jets_embedding.sh diff --git a/MC/config/common/pythia8/utils/mkpy8cfg.py b/MC/config/common/pythia8/utils/mkpy8cfg.py index 4ab24bdeb..6c1f8dd98 100755 --- a/MC/config/common/pythia8/utils/mkpy8cfg.py +++ b/MC/config/common/pythia8/utils/mkpy8cfg.py @@ -5,7 +5,7 @@ import argparse -parser = argparse.ArgumentParser(description='Make Pythia8 cofiguration', +parser = argparse.ArgumentParser(description='Make Pythia8 configuration', formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument('--seed', type=int, default=None, @@ -20,7 +20,7 @@ parser.add_argument('--eCM', type=float, default='13000.', help='Centre-of-mass energy') -parser.add_argument('--process', default='inel', choices=['none', 'inel', 'ccbar', 'bbbar', 'heavy'], +parser.add_argument('--process', default='inel', choices=['none', 'inel', 'ccbar', 'bbbar', 'heavy', 'jets', 'dirgamma'], help='Process to switch on') parser.add_argument('--ptHatMin', type=float, @@ -84,6 +84,10 @@ fout.write('HardQCD:hardccbar = on \n') if args.process == 'bbbar' or args.process == 'heavy': fout.write('HardQCD:hardbbbar = on \n') +if args.process == 'jets': + fout.write('HardQCD:all = on \n') +if args.process == 'dirgamma': + fout.write('PromptPhoton:all = on \n') fout.write('\n') ### phase space cuts diff --git a/MC/run/PWGGAJE/run_dirgamma.sh b/MC/run/PWGGAJE/run_dirgamma.sh new file mode 100755 index 000000000..8a225f753 --- /dev/null +++ b/MC/run/PWGGAJE/run_dirgamma.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash + +# Generate gamma-jet events, Pythia8 in a given pt hard bin. + +set -x + +SIGEVENTS=10 +NWORKERS=2 +MODULES= +RNDSEED=0 # [default = 0] time-based random seed + +# generate Pythia8 gamma-jet configuration + +# Define the pt hat bin arrays +pthatbin_loweredges=(5 11 21 36 57 84) +pthatbin_higheredges=(11 21 36 57 84 -1) + +# Define environmental vars for pt binning +PTHATBIN=5 #$1 set it here or externally? Add protection out of array? + +PTHATMIN=${pthatbin_loweredges[$PTHATBIN]} +PTHATMAX=${pthatbin_higheredges[$PTHATBIN]} + +${O2DPG_ROOT}/MC/config/common/pythia8/utils/mkpy8cfg.py \ + --output=pythia8_dirgamma.cfg \ + --seed=${RNDSEED} \ + --idA=2212 \ + --idB=2212 \ + --eCM=13000. \ + --process=dirgamma \ + --ptHatMin=${PTHATMIN} \ + --ptHatMax=${PTHATMAX} + +# embed signal into background + +o2-sim -j ${NWORKERS} -n ${SIGEVENTS} -g pythia8 -m ${MODULES} \ + --configKeyValues "GeneratorPythia8.config=pythia8_dirgamma.cfg" \ + > log 2>&1 diff --git a/MC/run/PWGGAJE/run_dirgamma_embedding.sh b/MC/run/PWGGAJE/run_dirgamma_embedding.sh new file mode 100755 index 000000000..cab6d699a --- /dev/null +++ b/MC/run/PWGGAJE/run_dirgamma_embedding.sh @@ -0,0 +1,46 @@ +#!/usr/bin/env bash + +# Embed gamma-jet events in a pre-defined pT hard bin into HI events, both Pythia8 +set -x + +MODULES="PIPE ITS TPC EMCAL" +BKGEVENTS=5 +SIGEVENTS=20 +NWORKERS=8 + +# generate background + +o2-sim -j ${NWORKERS} -n ${BKGEVENTS} -g pythia8hi -m ${MODULES} -o bkg \ + --configFile ${O2DPG_ROOT}/MC/config/common/ini/basic.ini \ + > logbkg 2>&1 + +# generate Pythia8 configuration + +RNDSEED=0 # [default = 0] time-based random seed + +# Define the pt hat bin arrays +pthatbin_loweredges=(5 11 21 36 57 84) +pthatbin_higheredges=(11 21 36 57 84 -1) + +# Define environmental vars for pt binning +PTHATBIN=5 #$1 set it here or externally? Add protection out of array? + +PTHATMIN=${pthatbin_loweredges[$PTHATBIN]} +PTHATMAX=${pthatbin_higheredges[$PTHATBIN]} + +${O2DPG_ROOT}/MC/config/common/pythia8/utils/mkpy8cfg.py \ + --output=pythia8_dirgamma.cfg \ + --seed=${RNDSEED} \ + --idA=2212 \ + --idB=2212 \ + --eCM=13000. \ + --process=dirgamma \ + --ptHatMin=${PTHATMIN} \ + --ptHatMax=${PTHATMAX} + +# embed signal into background + +o2-sim -j ${NWORKERS} -n ${SIGEVENTS} -g pythia8 -m ${MODULES} -o sgn \ + --configKeyValues "GeneratorPythia8.config=pythia8_dirgamma.cfg" \ + --embedIntoFile bkg_Kine.root \ + > logsgn 2>&1 diff --git a/MC/run/PWGGAJE/run_jets.sh b/MC/run/PWGGAJE/run_jets.sh new file mode 100755 index 000000000..d585b797e --- /dev/null +++ b/MC/run/PWGGAJE/run_jets.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash + +# Generate jet-jet events, Pythia8 in a pre-defined pt hard bin. + +set -x + +SIGEVENTS=10 +NWORKERS=2 +MODULES= +RNDSEED=0 # [default = 0] time-based random seed + +# generate Pythia8 jet-jet configuration + +# Define the pt hat bin arrays +pthatbin_loweredges=(0 5 7 9 12 16 21 28 36 45 57 70 85 99 115 132 150 169 190 212 235) +pthatbin_higheredges=( 5 7 9 12 16 21 28 36 45 57 70 85 99 115 132 150 169 190 212 235 -1) + +# Define environmental vars for pt binning +PTHATBIN=5 #$1 set it here or externally? Add protection out of array? + +PTHATMIN=${pthatbin_loweredges[$PTHATBIN]} +PTHATMAX=${pthatbin_higheredges[$PTHATBIN]} + +${O2DPG_ROOT}/MC/config/common/pythia8/utils/mkpy8cfg.py \ + --output=pythia8_jets.cfg \ + --seed=${RNDSEED} \ + --idA=2212 \ + --idB=2212 \ + --eCM=5020. \ + --process=jets \ + --ptHatMin=${PTHATMIN} \ + --ptHatMax=${PTHATMAX} + +# embed signal into background + +o2-sim -j ${NWORKERS} -n ${SIGEVENTS} -g pythia8 -m ${MODULES} \ + --configKeyValues "GeneratorPythia8.config=pythia8_jets.cfg" \ + > log 2>&1 diff --git a/MC/run/PWGGAJE/run_jets_embedding.sh b/MC/run/PWGGAJE/run_jets_embedding.sh new file mode 100755 index 000000000..5413cc2f4 --- /dev/null +++ b/MC/run/PWGGAJE/run_jets_embedding.sh @@ -0,0 +1,46 @@ +#!/usr/bin/env bash + +# Embed jet-jet events in a pre-defined pT hard bin into HI events, both Pythia8 +set -x + +MODULES="PIPE ITS TPC EMCAL" +BKGEVENTS=5 +SIGEVENTS=20 +NWORKERS=8 + +# generate background + +o2-sim -j ${NWORKERS} -n ${BKGEVENTS} -g pythia8hi -m ${MODULES} -o bkg \ + --configFile ${O2DPG_ROOT}/MC/config/common/ini/basic.ini \ + > logbkg 2>&1 + +# generate Pythia8 configuration + +RNDSEED=0 # [default = 0] time-based random seed + +# Define the pt hat bin arrays +pthatbin_loweredges=(0 5 7 9 12 16 21 28 36 45 57 70 85 99 115 132 150 169 190 212 235) +pthatbin_higheredges=( 5 7 9 12 16 21 28 36 45 57 70 85 99 115 132 150 169 190 212 235 -1) + +# Define environmental vars for pt binning +PTHATBIN=5 #$1 set it here or externally? Add protection out of array? + +PTHATMIN=${pthatbin_loweredges[$PTHATBIN]} +PTHATMAX=${pthatbin_higheredges[$PTHATBIN]} + +${O2DPG_ROOT}/MC/config/common/pythia8/utils/mkpy8cfg.py \ + --output=pythia8_jets.cfg \ + --seed=${RNDSEED} \ + --idA=2212 \ + --idB=2212 \ + --eCM=5020. \ + --process=jets \ + --ptHatMin=${PTHATMIN} \ + --ptHatMax=${PTHATMAX} + +# embed signal into background + +o2-sim -j ${NWORKERS} -n ${SIGEVENTS} -g pythia8 -m ${MODULES} -o sgn \ + --configKeyValues "GeneratorPythia8.config=pythia8_jets.cfg" \ + --embedIntoFile bkg_Kine.root \ + > logsgn 2>&1 From 9ba89262c6ad3c2fefb8fb7a2099d81f4dfe66e6 Mon Sep 17 00:00:00 2001 From: Gustavo Conesa Date: Wed, 18 Nov 2020 09:33:40 +0100 Subject: [PATCH 2/2] set bin externally --- MC/run/PWGGAJE/run_dirgamma.sh | 3 ++- MC/run/PWGGAJE/run_dirgamma_embedding.sh | 4 +++- MC/run/PWGGAJE/run_jets.sh | 3 ++- MC/run/PWGGAJE/run_jets_embedding.sh | 4 +++- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/MC/run/PWGGAJE/run_dirgamma.sh b/MC/run/PWGGAJE/run_dirgamma.sh index 8a225f753..488b9d5dd 100755 --- a/MC/run/PWGGAJE/run_dirgamma.sh +++ b/MC/run/PWGGAJE/run_dirgamma.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash # Generate gamma-jet events, Pythia8 in a given pt hard bin. +# run_dirgamma.sh n_pthatbin set -x @@ -16,7 +17,7 @@ pthatbin_loweredges=(5 11 21 36 57 84) pthatbin_higheredges=(11 21 36 57 84 -1) # Define environmental vars for pt binning -PTHATBIN=5 #$1 set it here or externally? Add protection out of array? +PTHATBIN=$1 #set it here or externally? Add protection out of array? PTHATMIN=${pthatbin_loweredges[$PTHATBIN]} PTHATMAX=${pthatbin_higheredges[$PTHATBIN]} diff --git a/MC/run/PWGGAJE/run_dirgamma_embedding.sh b/MC/run/PWGGAJE/run_dirgamma_embedding.sh index cab6d699a..01a2cd32d 100755 --- a/MC/run/PWGGAJE/run_dirgamma_embedding.sh +++ b/MC/run/PWGGAJE/run_dirgamma_embedding.sh @@ -1,6 +1,8 @@ #!/usr/bin/env bash # Embed gamma-jet events in a pre-defined pT hard bin into HI events, both Pythia8 +# run_dirgamma_embedding.sh n_pthatbin + set -x MODULES="PIPE ITS TPC EMCAL" @@ -23,7 +25,7 @@ pthatbin_loweredges=(5 11 21 36 57 84) pthatbin_higheredges=(11 21 36 57 84 -1) # Define environmental vars for pt binning -PTHATBIN=5 #$1 set it here or externally? Add protection out of array? +PTHATBIN=$1 #set it here or externally? Add protection out of array? PTHATMIN=${pthatbin_loweredges[$PTHATBIN]} PTHATMAX=${pthatbin_higheredges[$PTHATBIN]} diff --git a/MC/run/PWGGAJE/run_jets.sh b/MC/run/PWGGAJE/run_jets.sh index d585b797e..0b704b5b3 100755 --- a/MC/run/PWGGAJE/run_jets.sh +++ b/MC/run/PWGGAJE/run_jets.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash # Generate jet-jet events, Pythia8 in a pre-defined pt hard bin. +# run_jets.sh n_pthatbin set -x @@ -16,7 +17,7 @@ pthatbin_loweredges=(0 5 7 9 12 16 21 28 36 45 57 70 85 99 115 132 150 169 190 2 pthatbin_higheredges=( 5 7 9 12 16 21 28 36 45 57 70 85 99 115 132 150 169 190 212 235 -1) # Define environmental vars for pt binning -PTHATBIN=5 #$1 set it here or externally? Add protection out of array? +PTHATBIN=$1 #set it here or externally? Add protection out of array? PTHATMIN=${pthatbin_loweredges[$PTHATBIN]} PTHATMAX=${pthatbin_higheredges[$PTHATBIN]} diff --git a/MC/run/PWGGAJE/run_jets_embedding.sh b/MC/run/PWGGAJE/run_jets_embedding.sh index 5413cc2f4..0b84e2dc3 100755 --- a/MC/run/PWGGAJE/run_jets_embedding.sh +++ b/MC/run/PWGGAJE/run_jets_embedding.sh @@ -1,6 +1,8 @@ #!/usr/bin/env bash # Embed jet-jet events in a pre-defined pT hard bin into HI events, both Pythia8 +# run_jets_embedding.sh n_pthatbin + set -x MODULES="PIPE ITS TPC EMCAL" @@ -23,7 +25,7 @@ pthatbin_loweredges=(0 5 7 9 12 16 21 28 36 45 57 70 85 99 115 132 150 169 190 2 pthatbin_higheredges=( 5 7 9 12 16 21 28 36 45 57 70 85 99 115 132 150 169 190 212 235 -1) # Define environmental vars for pt binning -PTHATBIN=5 #$1 set it here or externally? Add protection out of array? +PTHATBIN=$1 #set it here or externally? Add protection out of array? PTHATMIN=${pthatbin_loweredges[$PTHATBIN]} PTHATMAX=${pthatbin_higheredges[$PTHATBIN]}