Skip to content

Commit 6c26061

Browse files
authored
Merge pull request #35 from gconesab/master
New pT hard spectra weighting option and make sure pythia8 configuration name is the same
2 parents e541cc4 + 6e76b0f commit 6c26061

File tree

6 files changed

+19
-5
lines changed

6 files changed

+19
-5
lines changed

MC/bin/o2dpg_sim_workflow.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
parser.add_argument('-ptHatBin',help='pT hard bin number', default=-1)
3131
parser.add_argument('-ptHatMin',help='pT hard minimum when no bin requested', default=0)
3232
parser.add_argument('-ptHatMax',help='pT hard maximum when no bin requested', default=-1)
33+
parser.add_argument('-weightPow',help='Flatten pT hard spectrum with power', default=-1)
34+
3335
parser.add_argument('-ptTrigMin',help='generated pT trigger minimum', default=0)
3436
parser.add_argument('-ptTrigMax',help='generated pT trigger maximum', default=-1)
3537

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

127+
## Pt Hat productions
128+
WEIGHTPOW=int(args.weightPow)
129+
125130
# Recover PTHATMIN and PTHATMAX from pre-defined array depending bin number PTHATBIN
126131
# or just the ones passed
127132
PTHATBIN=int(args.ptHatBin)
@@ -185,14 +190,16 @@ def getDPL_global_options(bigshm=False,nosmallrate=False):
185190
SGN_CONFIG_task=createTask(name='gensgnconf_'+str(tf), tf=tf, cwd=timeframeworkdir)
186191
if GENERATOR == 'pythia8':
187192
SGN_CONFIG_task['cmd'] = '${O2DPG_ROOT}/MC/config/common/pythia8/utils/mkpy8cfg.py \
188-
--output=pythia8_'+ str(tf) +'.cfg \
193+
--output=pythia8.cfg \
189194
--seed='+str(RNDSEED)+' \
190195
--idA='+str(PDGA)+' \
191196
--idB='+str(PDGB)+' \
192197
--eCM='+str(ECMS)+' \
193198
--process='+str(PROCESS)+' \
194199
--ptHatMin=' + str(PTHATMIN) + ' \
195200
--ptHatMax=' + str(PTHATMAX)
201+
if WEIGHTPOW > -1:
202+
SGN_CONFIG_task['cmd'] = SGN_CONFIG_task['cmd'] + ' --weightPow=' + str(WEIGHTPOW)
196203
workflow['stages'].append(SGN_CONFIG_task)
197204
# elif GENERATOR == 'extgen': what do we do if generator is not pythia8?
198205

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[GeneratorPythia8]
2-
config=pythia8_jets.cfg
2+
config=pythia8.cfg
33
hooksFileName=${O2DPG_ROOT}/MC/config/PWGGAJE/hooks/jets_hook.C
44
hooksFuncName=pythia8_userhooks_jets()
55

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[GeneratorPythia8]
2-
config=pythia8_dirgamma.cfg
2+
config=pythia8.cfg
33
hooksFileName=${O2DPG_ROOT}/MC/config/PWGGAJE/hooks/prompt_gamma_hook.C
44
hooksFuncName=pythia8_userhooks_promptgamma()
55

MC/config/PWGGAJE/ini/trigger_decay_gamma.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[GeneratorPythia8]
2-
config=pythia8_jets.cfg
2+
config=pythia8.cfg
33

44
[TriggerExternal]
55
fileName=${O2DPG_ROOT}/MC/config/PWGGAJE/trigger/decay_gamma_jets.C

MC/config/PWGGAJE/ini/trigger_prompt_gamma.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[GeneratorPythia8]
2-
config=pythia8_dirgamma.cfg
2+
config=pythia8.cfg
33

44
[TriggerExternal]
55
fileName=${O2DPG_ROOT}/MC/config/PWGGAJE/trigger/prompt_gamma.C

MC/config/common/pythia8/utils/mkpy8cfg.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
parser.add_argument('--ptHatMax', type=float,
3030
help='The maximum invariant pT')
3131

32+
parser.add_argument('--weightPower', type=float,
33+
help='Weight power to pT hard spectrum')
34+
3235
parser.add_argument('--output', default='pythia8.cfg',
3336
help='Where to write the configuration')
3437

@@ -103,6 +106,10 @@
103106
fout.write('PhaseSpace:pTHatMin = %f \n' % (args.ptHatMin))
104107
if args.ptHatMax is not None :
105108
fout.write('PhaseSpace:pTHatMax = %f \n' % (args.ptHatMax))
109+
if args.weightPower is not None :
110+
fout.write('PhaseSpace:bias2Selection = on \n')
111+
fout.write('PhaseSpace:bias2SelectionPow = %f" \n' % (args.weightPower))
112+
106113
fout.write('\n')
107114

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

0 commit comments

Comments
 (0)