@@ -3171,6 +3171,82 @@ def condition(self, fragment, stepList, key, hasHarvest):
31713171 offset = 0.9921 ,
31723172)
31733173
3174+ class UpgradeWorkflowHybridPU (UpgradeWorkflow ):
3175+ def setup_ (self , step , stepName , stepDict , k , properties ):
3176+ # just copy steps
3177+ stepDict [stepName ][k ] = merge ([stepDict [step ][k ]])
3178+ def setupPU_ (self , step , stepName , stepDict , k , properties ):
3179+ # make new step for S1
3180+ # this gets inserted in relval_upgrade.py
3181+ if "GenSim" in stepName :
3182+ # go back to non-PU step version
3183+ d = merge ([stepDict [self .getStepName (step )][k ]])
3184+ stepNameS1 = stepName .replace ('GenSim' ,'GenSimFS' )
3185+ if not stepNameS1 in stepDict : stepDict [stepNameS1 ] = {}
3186+ stepDict [stepNameS1 ][k ] = merge ([{
3187+ '--fast' : '' ,
3188+ '--era' : stepDict [stepName ][k ]['--era' ]+ '_FastSim' ,
3189+ '--eventcontent' : 'FASTPU' ,
3190+ '--processName' : 'FASTSIM' ,
3191+ }, d ])
3192+ else :
3193+ # include modifier in all subsequent steps in case any of them use PU replay
3194+ if "--procModifiers" in stepDict [stepName ][k ]:
3195+ stepDict [stepName ][k ]["--procModifiers" ] += ",fastSimPU"
3196+ else :
3197+ stepDict [stepName ][k ]["--procModifiers" ] = "fastSimPU"
3198+
3199+ if "Digi" in stepName :
3200+ stepDict [stepName ][k ] = merge ([digiPremixLocalPileup , stepDict [stepName ][k ]])
3201+ elif 'S1S2' in self .suffix :
3202+ # increment inputs for subsequent steps in combined case
3203+ # also reset pileup input
3204+ digiPremixLocalPileupTmp = deepcopy (digiPremixLocalPileup )
3205+ filein = stepDict [stepName ][k ].get ("--filein" ,"" )
3206+ m = re .search ("step(?P<ind>\\ d+)" , filein )
3207+ if m :
3208+ digiPremixLocalPileupTmp ['--filein' ] = filein .replace (m .group (), "step%d" % (int (m .group ("ind" ))+ 1 ))
3209+ else :
3210+ digiPremixLocalPileupTmp .pop ('--filein' )
3211+ stepDict [stepName ][k ] = merge ([digiPremixLocalPileupTmp , stepDict [stepName ][k ]])
3212+ def condition (self , fragment , stepList , key , hasHarvest ):
3213+ return (fragment == 'TTbar_14TeV' and 'PU' in key and key .startswith ('202' ) and not 'FS' in key )
3214+ # stage1 is just FastSim MinBias, no separate workflow needed
3215+ # HybridPU stage2
3216+ upgradeWFs ['HybridPUS2' ] = UpgradeWorkflowHybridPU (
3217+ steps = [],
3218+ PU = [
3219+ 'Digi' ,
3220+ 'DigiTrigger' ,
3221+ ],
3222+ suffix = '_HybridPUS2' ,
3223+ offset = 0.95 ,
3224+ )
3225+ # HybridPU combined stage1+stage2
3226+ upgradeWFs ['HybridPUS1S2' ] = UpgradeWorkflowHybridPU (
3227+ steps = [],
3228+ PU = [
3229+ 'GenSim' ,
3230+ 'GenSimHLBeamSpot' ,
3231+ 'GenSimHLBeamSpot14' ,
3232+ 'Digi' ,
3233+ 'DigiTrigger' ,
3234+ 'RecoLocal' ,
3235+ 'Reco' ,
3236+ 'RecoFakeHLT' ,
3237+ 'RecoGlobal' ,
3238+ 'RecoGlobalFakeHLT' ,
3239+ 'RecoNano' ,
3240+ 'RecoNanoFakeHLT' ,
3241+ 'Nano' ,
3242+ 'HARVESTNano' ,
3243+ 'HARVESTNanoFakeHLT' ,
3244+ 'ALCA' ,
3245+ ],
3246+ suffix = '_HybridPUS1S2' ,
3247+ offset = 0.96 ,
3248+ )
3249+
31743250class UpgradeWorkflow_Run3FStrackingOnly (UpgradeWorkflow ):
31753251 def setup_ (self , step , stepName , stepDict , k , properties ):
31763252 if 'HARVESTFastRun3' in step :
0 commit comments