|
50 | 50 | parser.add_argument('-weightPow',help='Flatten pT hard spectrum with power', default=-1) |
51 | 51 |
|
52 | 52 | parser.add_argument('--embedding',action='store_true', help='With embedding into background') |
| 53 | +parser.add_argument('--embeddPattern',help='How signal is to be injected into background', default='@0:e1') |
53 | 54 | parser.add_argument('-nb',help='number of background events / timeframe', default=20) |
54 | 55 | parser.add_argument('-genBkg',help='embedding background generator', default='') #pythia8, not recomended: pythia8hi, pythia8pp |
55 | 56 | parser.add_argument('-procBkg',help='process type: inel, ..., do not set it for Pythia8 PbPb', default='heavy_ion') |
@@ -457,10 +458,19 @@ def getDPL_global_options(bigshm=False): |
457 | 458 | simsoption=' --sims ' + ('bkg,'+signalprefix if doembedding else signalprefix) |
458 | 459 |
|
459 | 460 | # This task creates the basic setup for all digitizers! all digitization configKeyValues need to be given here |
460 | | - ContextTask=createTask(name='digicontext_'+str(tf), needs=[SGNtask['name'], LinkGRPFileTask['name']], tf=tf, |
461 | | - cwd=timeframeworkdir, lab=["DIGI"], cpu='1') |
| 461 | + # ContextTask=createTask(name='digicontext_'+str(tf), needs=[SGNtask['name'], LinkGRPFileTask['name']], tf=tf, |
| 462 | + # cwd=timeframeworkdir, lab=["DIGI"], cpu='1') |
| 463 | + # ContextTask['cmd'] = 'o2-sim-digitizer-workflow --only-context --interactionRate ' + str(INTRATE) + ' ' + getDPL_global_options() + ' -n ' + str(args.ns) + simsoption |
| 464 | + # workflow['stages'].append(ContextTask) |
| 465 | + ContextTask = createTask(name='digicontext_'+str(tf), needs=[SGNtask['name'], LinkGRPFileTask['name']], tf=tf, cwd=timeframeworkdir, lab=["DIGI"], cpu='1') |
| 466 | + # this is just to have the digitizer ini file |
462 | 467 | ContextTask['cmd'] = 'o2-sim-digitizer-workflow --only-context --interactionRate ' + str(INTRATE) + ' ' + getDPL_global_options() + ' -n ' + str(args.ns) + simsoption |
463 | | - workflow['stages'].append(ContextTask) |
| 468 | + |
| 469 | + # in case of embedding we engineer the context directly and allow the user to provide an embedding pattern |
| 470 | + # The :r flag means to shuffle the background events randomly |
| 471 | + if doembedding: |
| 472 | + ContextTask['cmd'] += ';o2-steer-colcontexttool -i bkg,' + str(INTRATE) + ',' + str(args.nb) + ':r' + str(args.nb) + ' ' + signalprefix + ',' + args.embeddPattern + ' --show-context' |
| 473 | + workflow['stages'].append(ContextTask) |
464 | 474 |
|
465 | 475 | tpcdigineeds=[ContextTask['name'], LinkGRPFileTask['name']] |
466 | 476 | if usebkgcache: |
|
0 commit comments