Skip to content

Commit

Permalink
extend premix workflows to fastsim (run 3)
Browse files Browse the repository at this point in the history
  • Loading branch information
kpedro88 committed Sep 15, 2024
1 parent 70da587 commit fab4456
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 22 deletions.
4 changes: 2 additions & 2 deletions Configuration/PyReleaseValidation/python/relval_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ def makeStepName(key,frag,step,suffix):
stepList[specialType].append(stepMaker(key,frag[:-4],step.replace('RecoGlobal','HLT75e33'),specialWF.suffix))
# similar hacks for premixing
if 'PMX' in specialType:
if 'GenSim' in step:
s = step.replace('GenSim','Premix')+'PU' # later processing requires to have PU here
if 'GenSim' in step or 'Gen' in step:
s = step.replace('GenSim','Premix').replace('Gen','Premix')+'PU' # later processing requires to have PU here
if step in specialWF.PU:
stepMade = stepMaker(key,'PREMIX',s,specialWF.suffix)
# append for combined
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2346,17 +2346,38 @@ def setupPU_(self, step, stepName, stepDict, k, properties):
if "GenSim" in stepName:
stepNamePmx = stepName.replace('GenSim','Premix')
if not stepNamePmx in stepDict: stepDict[stepNamePmx] = {}
stepDict[stepNamePmx][k] = merge([
{
'-s': 'GEN,SIM,DIGI:pdigi_valid',
'--datatier': 'PREMIX',
'--eventcontent': 'PREMIX',
'--procModifiers': 'premix_stage1'
},
stepDict[stepName][k]
])
if "ProdLike" in self.suffix:
stepDict[stepNamePmx][k] = merge([{'-s': 'GEN,SIM,DIGI'},stepDict[stepNamePmx][k]])
# avoid overwriting fastsim alternative
if not k in stepDict[stepNamePmx]:
stepDict[stepNamePmx][k] = merge([
{
'-s': 'GEN,SIM,DIGI:pdigi_valid',
'--datatier': 'PREMIX',
'--eventcontent': 'PREMIX',
'--procModifiers': 'premix_stage1'
},
stepDict[stepName][k]
])
if "ProdLike" in self.suffix:
stepDict[stepNamePmx][k] = merge([{'-s': 'GEN,SIM,DIGI'},stepDict[stepNamePmx][k]])
# setup for stage 1 fastsim
elif "Gen" in stepName:
stepNamePmx = stepName.replace('Gen','Premix')
if not stepNamePmx in stepDict: stepDict[stepNamePmx] = {}
# avoid overwriting fullsim alternative
if not k in stepDict[stepNamePmx]:
stepDict[stepNamePmx][k] = merge([
{
'-s': 'GEN,SIM,RECOBEFMIX,DIGI:pdigi_valid',
'--fast':'',
'--datatier': 'PREMIX',
'--eventcontent': 'PREMIX',
'--procModifiers': 'premix_stage1'
},
stepDict[stepName][k]
])
if "ProdLike" in self.suffix:
# todo
pass
# setup for stage 2
elif "Digi" in step or "Reco" in step:
# go back to non-PU step version
Expand All @@ -2382,18 +2403,28 @@ def setupPU_(self, step, stepName, stepDict, k, properties):
else:
d["--procModifiers"] = "premix_stage2"
stepDict[stepName][k] = d
# Increase the input file step number by one for Nano in combined stage1+stage2
elif "Nano"==step:
# setup for stage 2 fastsim
elif "FastSimRun3" in step:
# go back to non-PU step version
d = merge([stepDict[self.getStepName(step)][k]])
if "--filein" in d:
filein = d["--filein"]
m = re.search("step(?P<ind>\d+)_", filein)
if m:
d["--filein"] = filein.replace(m.group(), "step%d_"%(int(m.group("ind"))+1))
if d is None: return
tmpsteps = []
for s in d["-s"].split(","):
if s == "DIGI" or "DIGI:" in s:
tmpsteps.extend([s, "DATAMIX"])
else:
tmpsteps.append(s)
d = merge([{"-s" : ",".join(tmpsteps),
"--datamix" : "PreMix"},
d])
if "--procModifiers" in d:
d["--procModifiers"] += ",premix_stage2"
else:
d["--procModifiers"] = "premix_stage2"
# for combined stage1+stage2
if "_PMXS1S2" in self.suffix:
d = merge([digiPremixLocalPileup, d])
stepDict[stepName][k] = d
# run2/3 WFs use Nano (not NanoPU) in PU WF
stepDict[self.getStepName(step)][k] = merge([d])
def condition(self, fragment, stepList, key, hasHarvest):
if not 'PU' in key:
return False
Expand All @@ -2412,6 +2443,7 @@ def workflow_(self, workflows, num, fragment, stepList, key):
steps = [
],
PU = [
'Gen',
'GenSim',
'GenSimHLBeamSpot',
'GenSimHLBeamSpot14',
Expand All @@ -2432,6 +2464,7 @@ def workflow_(self, workflows, num, fragment, stepList, key):
'RecoNano',
'RecoNanoFakeHLT',
'Nano',
'FastSimRun3',
],
suffix = '_PMXS2',
offset = 0.98,
Expand All @@ -2440,6 +2473,7 @@ def workflow_(self, workflows, num, fragment, stepList, key):
upgradeWFs['PMXS1S2'] = UpgradeWorkflowPremix(
steps = [],
PU = [
'Gen',
'GenSim',
'GenSimHLBeamSpot',
'GenSimHLBeamSpot14',
Expand All @@ -2452,6 +2486,7 @@ def workflow_(self, workflows, num, fragment, stepList, key):
'RecoNano',
'RecoNanoFakeHLT',
'Nano',
'FastSimRun3',
],
suffix = '_PMXS1S2',
offset = 0.99,
Expand Down

0 comments on commit fab4456

Please sign in to comment.