Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion MC/bin/o2dpg_sim_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
parser.add_argument('-ptHatBin',help='pT hard bin number', default=-1)
parser.add_argument('-ptHatMin',help='pT hard minimum when no bin requested', default=0)
parser.add_argument('-ptHatMax',help='pT hard maximum when no bin requested', default=-1)
parser.add_argument('-weightPow',help='Flatten pT hard spectrum with power', default=-1)

parser.add_argument('-ptTrigMin',help='generated pT trigger minimum', default=0)
parser.add_argument('-ptTrigMax',help='generated pT trigger maximum', default=-1)

Expand Down Expand Up @@ -122,6 +124,9 @@ def getDPL_global_options(bigshm=False,nosmallrate=False):
PTTRIGMIN=float(args.ptTrigMin)
PTTRIGMAX=float(args.ptTrigMax)

## Pt Hat productions
WEIGHTPOW=int(args.weightPow)

# Recover PTHATMIN and PTHATMAX from pre-defined array depending bin number PTHATBIN
# or just the ones passed
PTHATBIN=int(args.ptHatBin)
Expand Down Expand Up @@ -185,14 +190,16 @@ def getDPL_global_options(bigshm=False,nosmallrate=False):
SGN_CONFIG_task=createTask(name='gensgnconf_'+str(tf), tf=tf, cwd=timeframeworkdir)
if GENERATOR == 'pythia8':
SGN_CONFIG_task['cmd'] = '${O2DPG_ROOT}/MC/config/common/pythia8/utils/mkpy8cfg.py \
--output=pythia8_'+ str(tf) +'.cfg \
--output=pythia8.cfg \
--seed='+str(RNDSEED)+' \
--idA='+str(PDGA)+' \
--idB='+str(PDGB)+' \
--eCM='+str(ECMS)+' \
--process='+str(PROCESS)+' \
--ptHatMin=' + str(PTHATMIN) + ' \
--ptHatMax=' + str(PTHATMAX)
if WEIGHTPOW > -1:
SGN_CONFIG_task['cmd'] = SGN_CONFIG_task['cmd'] + ' --weightPow=' + str(WEIGHTPOW)
workflow['stages'].append(SGN_CONFIG_task)
# elif GENERATOR == 'extgen': what do we do if generator is not pythia8?

Expand Down
2 changes: 1 addition & 1 deletion MC/config/PWGGAJE/ini/hook_jets.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[GeneratorPythia8]
config=pythia8_jets.cfg
config=pythia8.cfg
hooksFileName=${O2DPG_ROOT}/MC/config/PWGGAJE/hooks/jets_hook.C
hooksFuncName=pythia8_userhooks_jets()

2 changes: 1 addition & 1 deletion MC/config/PWGGAJE/ini/hook_prompt_gamma.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[GeneratorPythia8]
config=pythia8_dirgamma.cfg
config=pythia8.cfg
hooksFileName=${O2DPG_ROOT}/MC/config/PWGGAJE/hooks/prompt_gamma_hook.C
hooksFuncName=pythia8_userhooks_promptgamma()

2 changes: 1 addition & 1 deletion MC/config/PWGGAJE/ini/trigger_decay_gamma.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[GeneratorPythia8]
config=pythia8_jets.cfg
config=pythia8.cfg

[TriggerExternal]
fileName=${O2DPG_ROOT}/MC/config/PWGGAJE/trigger/decay_gamma_jets.C
Expand Down
2 changes: 1 addition & 1 deletion MC/config/PWGGAJE/ini/trigger_prompt_gamma.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[GeneratorPythia8]
config=pythia8_dirgamma.cfg
config=pythia8.cfg

[TriggerExternal]
fileName=${O2DPG_ROOT}/MC/config/PWGGAJE/trigger/prompt_gamma.C
Expand Down
7 changes: 7 additions & 0 deletions MC/config/common/pythia8/utils/mkpy8cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
parser.add_argument('--ptHatMax', type=float,
help='The maximum invariant pT')

parser.add_argument('--weightPower', type=float,
help='Weight power to pT hard spectrum')

parser.add_argument('--output', default='pythia8.cfg',
help='Where to write the configuration')

Expand Down Expand Up @@ -103,6 +106,10 @@
fout.write('PhaseSpace:pTHatMin = %f \n' % (args.ptHatMin))
if args.ptHatMax is not None :
fout.write('PhaseSpace:pTHatMax = %f \n' % (args.ptHatMax))
if args.weightPower is not None :
fout.write('PhaseSpace:bias2Selection = on \n')
fout.write('PhaseSpace:bias2SelectionPow = %f" \n' % (args.weightPower))

fout.write('\n')

fout.write('### <-- generated by mkpy8cfg.py \n')
Expand Down