|
32 | 32 |
|
33 | 33 | parser.add_argument('-ns',help='number of signal events / timeframe', default=20) |
34 | 34 | parser.add_argument('-gen',help='generator: pythia8, extgen', default='') |
35 | | -parser.add_argument('-proc',help='process type: dirgamma, jets, ccbar', default='') |
| 35 | +parser.add_argument('-proc',help='process type: inel, dirgamma, jets, ccbar, ...', default='') |
36 | 36 | parser.add_argument('-trigger',help='event selection: particle, external', default='') |
37 | 37 | parser.add_argument('-ini',help='generator init parameters file, for example: ${O2DPG_ROOT}/MC/config/PWGHF/ini/GeneratorHF.ini', default='') |
38 | 38 | parser.add_argument('-confKey',help='generator or trigger configuration key values, for example: GeneratorPythia8.config=pythia8.cfg', default='') |
39 | 39 |
|
40 | 40 | parser.add_argument('-interactionRate',help='Interaction rate, used in digitization', default=-1) |
41 | 41 | parser.add_argument('-eCM',help='CMS energy', default=-1) |
42 | | -parser.add_argument('-eA',help='Beam A energy', default=6499.) #6369 PbPb, 2.510 pp 5 TeV, 4 pPb |
| 42 | +parser.add_argument('-eA',help='Beam A energy', default=-1) #6369 PbPb, 2.510 pp 5 TeV, 4 pPb |
43 | 43 | parser.add_argument('-eB',help='Beam B energy', default=-1) |
44 | 44 | parser.add_argument('-col',help='collision system: pp, PbPb, pPb, Pbp, ..., in case of embedding collision system of signal', default='pp') |
45 | 45 | parser.add_argument('-field',help='L3 field rounded to kGauss, allowed: values +-2,+-5 and 0; +-5U for uniform field', default='-5') |
|
51 | 51 |
|
52 | 52 | parser.add_argument('--embedding',action='store_true', help='With embedding into background') |
53 | 53 | parser.add_argument('-nb',help='number of background events / timeframe', default=20) |
54 | | -parser.add_argument('-genBkg',help='embedding background generator', default='pythia8hi') |
| 54 | +parser.add_argument('-genBkg',help='embedding background generator', default='') #pythia8, not recomended: pythia8hi, pythia8pp |
| 55 | +parser.add_argument('-procBkg',help='process type: inel, ..., do not set it for Pythia8 PbPb', default='none') |
55 | 56 | parser.add_argument('-iniBkg',help='embedding background generator init parameters file', default='${O2DPG_ROOT}/MC/config/common/ini/basic.ini') |
56 | | -parser.add_argument('-confKeyBkg',help='embedding background configuration key values, for example: GeneratorPythia8.config=pythia8.cfg', default='') |
| 57 | +parser.add_argument('-confKeyBkg',help='embedding background configuration key values, for example: GeneratorPythia8.config=pythia8bkg.cfg', default='') |
57 | 58 | parser.add_argument('-colBkg',help='embedding background collision system', default='PbPb') |
58 | 59 |
|
59 | 60 | parser.add_argument('-e',help='simengine', default='TGeant4') |
|
101 | 102 | MODULES=args.mod #"--skipModules ZDC" |
102 | 103 | SIMENGINE=args.e |
103 | 104 | BFIELD=args.field |
| 105 | +RNDSEED=args.seed # 0 means random seed ! Should we set different seed for Bkg and signal? |
104 | 106 |
|
105 | 107 | # add here other possible types |
106 | 108 |
|
@@ -130,14 +132,77 @@ def getDPL_global_options(bigshm=False,nosmallrate=False): |
130 | 132 | print('o2dpg_sim_workflow: Error! embedding background generator name not provided') |
131 | 133 | exit(1) |
132 | 134 |
|
133 | | - INIBKG='' |
134 | | - if args.iniBkg!= '': |
135 | | - INIBKG=' --configFile ' + args.iniBkg |
| 135 | + PROCESSBKG=args.procBkg |
| 136 | + COLTYPEBKG=args.colBkg |
| 137 | + ECMSBKG=float(args.eCM) |
| 138 | + EBEAMABKG=float(args.eA) |
| 139 | + EBEAMBBKG=float(args.eB) |
| 140 | + |
| 141 | + if COLTYPEBKG == 'pp': |
| 142 | + PDGABKG=2212 # proton |
| 143 | + PDGBBKG=2212 # proton |
| 144 | + |
| 145 | + if COLTYPEBKG == 'PbPb': |
| 146 | + PDGABKG=1000822080 # Pb |
| 147 | + PDGBBKG=1000822080 # Pb |
| 148 | + if ECMSBKG < 0: # assign 5.02 TeV to Pb-Pb |
| 149 | + print('o2dpg_sim_workflow: Set BKG CM Energy to PbPb case 5.02 TeV') |
| 150 | + ECMSBKG=5020.0 |
| 151 | + if GENBKG == 'pythia8': |
| 152 | + PROCESSBKG = 'none' |
| 153 | + print('o2dpg_sim_workflow: Process type not considered for Pythia8 PbPb') |
| 154 | + |
| 155 | + if COLTYPEBKG == 'pPb': |
| 156 | + PDGABKG=2212 # proton |
| 157 | + PDGBBKG=1000822080 # Pb |
| 158 | + |
| 159 | + if COLTYPEBKG == 'Pbp': |
| 160 | + PDGABKG=1000822080 # Pb |
| 161 | + PDGBBKG=2212 # proton |
| 162 | + |
| 163 | + # If not set previously, set beam energy B equal to A |
| 164 | + if EBEAMBBKG < 0 and ECMSBKG < 0: |
| 165 | + EBEAMBBKG=EBEAMABKG |
| 166 | + print('o2dpg_sim_workflow: Set beam energy same in A and B beams') |
| 167 | + if COLTYPEBKG=="pPb" or COLTYPEBKG=="Pbp": |
| 168 | + print('o2dpg_sim_workflow: Careful! both beam energies in bkg are the same') |
| 169 | + |
| 170 | + if ECMSBKG > 0: |
| 171 | + if COLTYPEBKG=="pPb" or COLTYPEBKG=="Pbp": |
| 172 | + print('o2dpg_sim_workflow: Careful! bkg ECM set for pPb/Pbp collisions!') |
| 173 | + |
| 174 | + if ECMSBKG < 0 and EBEAMABKG < 0 and EBEAMBBKG < 0: |
| 175 | + print('o2dpg_sim_workflow: Error! bkg ECM or Beam Energy not set!!!') |
| 176 | + exit(1) |
136 | 177 |
|
137 | 178 | CONFKEYBKG='' |
138 | 179 | if args.confKeyBkg!= '': |
139 | 180 | CONFKEYBKG=' --configKeyValues ' + args.CONFKEYBKG |
140 | 181 |
|
| 182 | + # Background PYTHIA configuration |
| 183 | + BKG_CONFIG_task=createTask(name='genbkgconf') |
| 184 | + BKG_CONFIG_task['cmd'] = 'echo "placeholder / dummy task"' |
| 185 | + if GENBKG == 'pythia8': |
| 186 | + BKG_CONFIG_task['cmd'] = '${O2DPG_ROOT}/MC/config/common/pythia8/utils/mkpy8cfg.py \ |
| 187 | + --output=pythia8bkg.cfg \ |
| 188 | + --seed='+str(RNDSEED)+' \ |
| 189 | + --idA='+str(PDGABKG)+' \ |
| 190 | + --idB='+str(PDGBBKG)+' \ |
| 191 | + --eCM='+str(ECMSBKG)+' \ |
| 192 | + --eA='+str(EBEAMABKG)+' \ |
| 193 | + --eB='+str(EBEAMBBKG)+' \ |
| 194 | + --process='+str(PROCESSBKG) |
| 195 | + # if we configure pythia8 here --> we also need to adjust the configuration |
| 196 | + # TODO: we need a proper config container/manager so as to combine these local configs with external configs etc. |
| 197 | + CONFKEYBKG='--configKeyValues "GeneratorPythia8.config=pythia8bkg.cfg"' |
| 198 | + |
| 199 | + workflow['stages'].append(BKG_CONFIG_task) |
| 200 | + |
| 201 | + # background task configuration |
| 202 | + INIBKG='' |
| 203 | + if args.iniBkg!= '': |
| 204 | + INIBKG=' --configFile ' + args.iniBkg |
| 205 | + |
141 | 206 | BKGtask=createTask(name='bkgsim', lab=["GEANT"], cpu=NWORKERS) |
142 | 207 | BKGtask['cmd']='o2-sim -e ' + SIMENGINE + ' -j ' + str(NWORKERS) + ' -n ' + str(NBKGEVENTS) \ |
143 | 208 | + ' -g ' + str(GENBKG) + ' ' + str(MODULES) + ' -o bkg ' + str(INIBKG) \ |
@@ -193,7 +258,6 @@ def getDPL_global_options(bigshm=False,nosmallrate=False): |
193 | 258 | # ---- transport task ------- |
194 | 259 | # function encapsulating the signal sim part |
195 | 260 | # first argument is timeframe id |
196 | | - RNDSEED=args.seed # 0 means random seed ! |
197 | 261 | ECMS=float(args.eCM) |
198 | 262 | EBEAMA=float(args.eA) |
199 | 263 | EBEAMB=float(args.eB) |
@@ -303,13 +367,15 @@ def getDPL_global_options(bigshm=False,nosmallrate=False): |
303 | 367 | if GENERATOR == 'pythia8' and PROCESS!='': |
304 | 368 | SGN_CONFIG_task['cmd'] = '${O2DPG_ROOT}/MC/config/common/pythia8/utils/mkpy8cfg.py \ |
305 | 369 | --output=pythia8.cfg \ |
306 | | - --seed='+str(RNDSEED)+' \ |
307 | | - --idA='+str(PDGA)+' \ |
308 | | - --idB='+str(PDGB)+' \ |
309 | | - --eCM='+str(ECMS)+' \ |
310 | | - --process='+str(PROCESS)+' \ |
311 | | - --ptHatMin=' + str(PTHATMIN) + ' \ |
312 | | - --ptHatMax=' + str(PTHATMAX) |
| 370 | + --seed='+str(RNDSEED)+' \ |
| 371 | + --idA='+str(PDGA)+' \ |
| 372 | + --idB='+str(PDGB)+' \ |
| 373 | + --eCM='+str(ECMS)+' \ |
| 374 | + --eA='+str(EBEAMA)+' \ |
| 375 | + --eB='+str(EBEAMB)+' \ |
| 376 | + --process='+str(PROCESS)+' \ |
| 377 | + --ptHatMin='+str(PTHATMIN)+' \ |
| 378 | + --ptHatMax='+str(PTHATMAX) |
313 | 379 | if WEIGHTPOW > 0: |
314 | 380 | SGN_CONFIG_task['cmd'] = SGN_CONFIG_task['cmd'] + ' --weightPow=' + str(WEIGHTPOW) |
315 | 381 | # if we configure pythia8 here --> we also need to adjust the configuration |
|
0 commit comments