Skip to content

Commit c12c033

Browse files
sawenzeljackal1-66claude
committed
Generate TPC loopers only in the background transport when embedding
This avoids the double counting of TPC loopers in embedding productions. - Background and signal both generated loopers covering the whole timeframe. - The signal transport now gets GenTPCLoopers.loopersVeto=true. - GenTPCLoopers settings given with -confKey are applied to the background. - A veto given for either transport switches loopers off in both. - The background loopers now use -colBkg as collision system, not -col. https://its.cern.ch/jira/browse/O2-7272 Co-authored-by: Marco Giacalone <mgiacalo@gmail.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 73f585d commit c12c033

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

‎MC/bin/o2dpg_sim_workflow.py‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,22 @@ def extractVertexArgs(configKeyValuesStr, finalDiamondDict):
528528
COLTYPEBKG=args.colBkg
529529
havePbPb = (COLTYPE == 'PbPb' or (doembedding and COLTYPEBKG == "PbPb"))
530530

531+
# TPC loopers are a background continuous in time: with embedding they are generated
532+
# by the background transport only, otherwise background and signal both cover the timeframe
533+
if doembedding:
534+
def loopersKeys(confkey):
535+
return [kv.strip() for kv in confkey.split(';') if kv.strip().startswith('GenTPCLoopers.')]
536+
def loopersVetoed(confkey):
537+
return any(kv.split('=')[0].strip() == 'GenTPCLoopers.loopersVeto' and kv.split('=')[1].strip().lower() in ('true', '1')
538+
for kv in loopersKeys(confkey))
539+
if loopersVetoed(args.confKey) or loopersVetoed(args.confKeyBkg):
540+
print('o2dpg_sim_workflow: TPC loopers switched off for background and signal')
541+
args.confKeyBkg = args.confKeyBkg + ';GenTPCLoopers.loopersVeto=true'
542+
else:
543+
# loopers settings given for the signal apply to the background; the background's own settings take precedence
544+
args.confKeyBkg = ';'.join(loopersKeys(args.confKey) + ['GenTPCLoopers.colsys=' + COLTYPEBKG, args.confKeyBkg])
545+
args.confKey = args.confKey + ';GenTPCLoopers.loopersVeto=true'
546+
531547
workflow={}
532548
workflow['stages'] = []
533549

0 commit comments

Comments
 (0)