@@ -2524,17 +2524,38 @@ def setupPU_(self, step, stepName, stepDict, k, properties):
25242524 if "GenSim" in stepName :
25252525 stepNamePmx = stepName .replace ('GenSim' ,'Premix' )
25262526 if not stepNamePmx in stepDict : stepDict [stepNamePmx ] = {}
2527- stepDict [stepNamePmx ][k ] = merge ([
2528- {
2529- '-s' : 'GEN,SIM,DIGI:pdigi_valid' ,
2530- '--datatier' : 'PREMIX' ,
2531- '--eventcontent' : 'PREMIX' ,
2532- '--procModifiers' : 'premix_stage1'
2533- },
2534- stepDict [stepName ][k ]
2535- ])
2536- if "ProdLike" in self .suffix :
2537- stepDict [stepNamePmx ][k ] = merge ([{'-s' : 'GEN,SIM,DIGI' },stepDict [stepNamePmx ][k ]])
2527+ # avoid overwriting fastsim alternative
2528+ if not k in stepDict [stepNamePmx ]:
2529+ stepDict [stepNamePmx ][k ] = merge ([
2530+ {
2531+ '-s' : 'GEN,SIM,DIGI:pdigi_valid' ,
2532+ '--datatier' : 'PREMIX' ,
2533+ '--eventcontent' : 'PREMIX' ,
2534+ '--procModifiers' : 'premix_stage1'
2535+ },
2536+ stepDict [stepName ][k ]
2537+ ])
2538+ if "ProdLike" in self .suffix :
2539+ stepDict [stepNamePmx ][k ] = merge ([{'-s' : 'GEN,SIM,DIGI' },stepDict [stepNamePmx ][k ]])
2540+ # setup for stage 1 fastsim
2541+ elif "Gen" in stepName :
2542+ stepNamePmx = stepName .replace ('Gen' ,'Premix' )
2543+ if not stepNamePmx in stepDict : stepDict [stepNamePmx ] = {}
2544+ # avoid overwriting fullsim alternative
2545+ if not k in stepDict [stepNamePmx ]:
2546+ stepDict [stepNamePmx ][k ] = merge ([
2547+ {
2548+ '-s' : 'GEN,SIM,RECOBEFMIX,DIGI:pdigi_valid' ,
2549+ '--fast' :'' ,
2550+ '--datatier' : 'PREMIX' ,
2551+ '--eventcontent' : 'PREMIX' ,
2552+ '--procModifiers' : 'premix_stage1'
2553+ },
2554+ stepDict [stepName ][k ]
2555+ ])
2556+ if "ProdLike" in self .suffix :
2557+ # todo
2558+ pass
25382559 # setup for stage 2
25392560 elif "Digi" in step or "Reco" in step :
25402561 # go back to non-PU step version
@@ -2560,11 +2581,33 @@ def setupPU_(self, step, stepName, stepDict, k, properties):
25602581 else :
25612582 d ["--procModifiers" ] = "premix_stage2"
25622583 stepDict [stepName ][k ] = d
2563- # Increase the input file step number by one for Nano in combined stage1+stage2
2584+ # setup for stage 2 fastsim
2585+ elif "FastSimRun3" in step :
2586+ # go back to non-PU step version
2587+ d = merge ([stepDict [self .getStepName (step )][k ]])
2588+ if d is None : return
2589+ tmpsteps = []
2590+ for s in d ["-s" ].split ("," ):
2591+ if s == "DIGI" or "DIGI:" in s :
2592+ tmpsteps .extend ([s , "DATAMIX" ])
2593+ else :
2594+ tmpsteps .append (s )
2595+ d = merge ([{"-s" : "," .join (tmpsteps ),
2596+ "--datamix" : "PreMix" },
2597+ d ])
2598+ if "--procModifiers" in d :
2599+ d ["--procModifiers" ] += ",premix_stage2"
2600+ else :
2601+ d ["--procModifiers" ] = "premix_stage2"
2602+ # for combined stage1+stage2
2603+ if "_PMXS1S2" in self .suffix :
2604+ d = merge ([digiPremixLocalPileup , d ])
2605+ stepDict [stepName ][k ] = d
2606+ # separate nano step now only used in ProdLike workflows for Run3/Phase2
25642607 elif "Nano" == step :
25652608 # go back to non-PU step version
25662609 d = merge ([stepDict [self .getStepName (step )][k ]])
2567- if "--filein" in d :
2610+ if "_PMXS1S2" in self . suffix and " --filein" in d :
25682611 filein = d ["--filein" ]
25692612 m = re .search ("step(?P<ind>\\ d+)_" , filein )
25702613 if m :
@@ -2590,6 +2633,7 @@ def workflow_(self, workflows, num, fragment, stepList, key):
25902633 steps = [
25912634 ],
25922635 PU = [
2636+ 'Gen' ,
25932637 'GenSim' ,
25942638 'GenSimHLBeamSpot' ,
25952639 'GenSimHLBeamSpot14' ,
@@ -2610,6 +2654,7 @@ def workflow_(self, workflows, num, fragment, stepList, key):
26102654 'RecoNano' ,
26112655 'RecoNanoFakeHLT' ,
26122656 'Nano' ,
2657+ 'FastSimRun3' ,
26132658 ],
26142659 suffix = '_PMXS2' ,
26152660 offset = 0.98 ,
@@ -2618,6 +2663,7 @@ def workflow_(self, workflows, num, fragment, stepList, key):
26182663upgradeWFs ['PMXS1S2' ] = UpgradeWorkflowPremix (
26192664 steps = [],
26202665 PU = [
2666+ 'Gen' ,
26212667 'GenSim' ,
26222668 'GenSimHLBeamSpot' ,
26232669 'GenSimHLBeamSpot14' ,
@@ -2630,6 +2676,7 @@ def workflow_(self, workflows, num, fragment, stepList, key):
26302676 'RecoNano' ,
26312677 'RecoNanoFakeHLT' ,
26322678 'Nano' ,
2679+ 'FastSimRun3' ,
26332680 ],
26342681 suffix = '_PMXS1S2' ,
26352682 offset = 0.99 ,
0 commit comments