Skip to content
Closed
3 changes: 3 additions & 0 deletions Configuration/ProcessModifiers/python/fastSimPU_cff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import FWCore.ParameterSet.Config as cms

fastSimPU = cms.Modifier()
2 changes: 2 additions & 0 deletions Configuration/PyReleaseValidation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ The offsets currently in use are:
* 0.634: ECAL phase2 Trigger Primitive + component-method based digis
* 0.635: ECAL phase2 Trigger Primitive + component-method based finely-sampled waveforms
* 0.91: Track DNN modifier
* 0.95: Hybrid PU (FullSim signal + FastSim PU) stage2
* 0.96: Hybrid PU (FullSim signal + FastSim PU) stage1+stage2
* 0.97: Premixing stage1
* 0.98: Premixing stage2
* 0.99: Premixing stage1+stage2
Expand Down
8 changes: 5 additions & 3 deletions Configuration/PyReleaseValidation/python/WorkFlowRunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,9 @@ def closeCmd(i,ID):
if self.noRun:
cmd +=' --no_exec'
# in case previous step used DAS query (either filelist of das:)
# not to be applied for premixing stage1 to allow combiend stage1+stage2 workflow
if inFile and not 'premix_stage1' in cmd:
# not to be applied for premixing stage1 to allow combined stage1+stage2 workflow
# & similar for HybridPU combined workflow
if inFile and not 'premix_stage1' in cmd and not 'FASTSIM' in cmd:
cmd += ' --filein '+inFile
inFile=None
if lumiRangeFile: #DAS query can also restrict lumi range
Expand All @@ -189,12 +190,13 @@ def closeCmd(i,ID):
else:
# Disable input for premix stage1 to allow combined stage1+stage2 workflow
# Disable input for premix stage2 in FastSim to allow combined stage1+stage2 workflow (in FS, stage2 does also GEN)
# & similar for HybridPU combined workflow
# Ugly hack but works
extension = '.root'
if '--rntuple_out' in cmd:
extension = '.rntpl'
outputExtensionForStep[istep] = extension
if istep!=1 and not '--filein' in cmd and not 'premix_stage1' in cmd and not ("--fast" in cmd and "premix_stage2" in cmd):
if istep!=1 and not '--filein' in cmd and not 'premix_stage1' in cmd and not ("--fast" in cmd and "premix_stage2" in cmd) and not 'FASTSIM' in cmd:
steps = cmd.split("-s ")[1].split(" ")[0] ## relying on the syntax: cmsDriver -s STEPS --otherFlags
if "ALCA" not in steps:
cmd+=' --filein file:step%s%s '%(istep-1,extension)
Expand Down
8 changes: 8 additions & 0 deletions Configuration/PyReleaseValidation/python/relval_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -5031,6 +5031,14 @@ def gen2024HiMix(fragment,howMuch):
steps[k+'INPUT']={'INPUT':InputInfo(dataSet='/RelVal'+info.dataset+'/%s/GEN-SIM'%(baseDataSetReleaseBetter[s],),location='STD')}
else: #For FastSim to recycle GEN
steps[k+'INPUT']={'INPUT':InputInfo(dataSet='/RelVal'+info.dataset+'/%s/GEN'%(baseDataSetReleaseBetter[s],),location='STD')}
# this condition is checked here to avoid skipping the creation of default steps for other fragments
if 'HybridPU' in step:
# minbias fastsim for PU mixing
if not 'MinBias_14TeV' in frag:
continue
stepKey = 'HYBRID_'+key+'_'+step
howMuch = Kby(100,100)
steps[stepKey]=merge([ {'--evt_type':frag},howMuch,upgradeStepDict[step][key]])
else:
for key in [key for year in upgradeKeys for key in upgradeKeys[year]]:
k=step+'_'+key
Expand Down
8 changes: 8 additions & 0 deletions Configuration/PyReleaseValidation/python/relval_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,14 @@ def notForGenOnly(key,specialType):
if 'S2' in specialType: stepList[specialType].append(stepMade)
# replace for s1
else: stepList[specialType][-1] = stepMade
# similar hack for fastpu
if 'HybridPU' in specialType:
if 'GenSim' in step:
s = step.replace('GenSim','GenSimFS')+'PU' # later processing requires to have PU here
if step in specialWF.PU:
stepMade = stepMaker(key,'HYBRID',s,specialWF.suffix)
# append for combined
if 'S2' in specialType: stepList[specialType].append(stepMade)
else:
stepList[specialType].append(stepMaker(key,frag[:-4],step,''))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2986,6 +2986,82 @@ def condition(self, fragment, stepList, key, hasHarvest):
offset = 0.9921,
)

class UpgradeWorkflowHybridPU(UpgradeWorkflow):
def setup_(self, step, stepName, stepDict, k, properties):
# just copy steps
stepDict[stepName][k] = merge([stepDict[step][k]])
def setupPU_(self, step, stepName, stepDict, k, properties):
# make new step for S1
# this gets inserted in relval_upgrade.py
if "GenSim" in stepName:
# go back to non-PU step version
d = merge([stepDict[self.getStepName(step)][k]])
stepNameS1 = stepName.replace('GenSim','GenSimFS')
if not stepNameS1 in stepDict: stepDict[stepNameS1] = {}
stepDict[stepNameS1][k] = merge([{
'--fast': '',
'--era': stepDict[stepName][k]['--era']+'_FastSim',
'--eventcontent': 'FASTPU',
'--processName': 'FASTSIM',
}, d])
else:
# include modifier in all subsequent steps in case any of them use PU replay
if "--procModifiers" in stepDict[stepName][k]:
stepDict[stepName][k]["--procModifiers"] += ",fastSimPU"
else:
stepDict[stepName][k]["--procModifiers"] = "fastSimPU"

if "Digi" in stepName:
stepDict[stepName][k] = merge([digiPremixLocalPileup, stepDict[stepName][k]])
elif 'S1S2' in self.suffix:
# increment inputs for subsequent steps in combined case
# also reset pileup input
digiPremixLocalPileupTmp = deepcopy(digiPremixLocalPileup)
filein = stepDict[stepName][k].get("--filein","")
m = re.search("step(?P<ind>\\d+)", filein)
if m:
digiPremixLocalPileupTmp['--filein'] = filein.replace(m.group(), "step%d"%(int(m.group("ind"))+1))
else:
digiPremixLocalPileupTmp.pop('--filein')
stepDict[stepName][k] = merge([digiPremixLocalPileupTmp, stepDict[stepName][k]])
def condition(self, fragment, stepList, key, hasHarvest):
return (fragment=='TTbar_14TeV' and 'PU' in key and key.startswith('202') and not 'FS' in key)
# stage1 is just FastSim MinBias, no separate workflow needed
# HybridPU stage2
upgradeWFs['HybridPUS2'] = UpgradeWorkflowHybridPU(
steps = [],
PU = [
'Digi',
'DigiTrigger',
],
suffix = '_HybridPUS2',
offset = 0.95,
)
# HybridPU combined stage1+stage2
upgradeWFs['HybridPUS1S2'] = UpgradeWorkflowHybridPU(
steps = [],
PU = [
'GenSim',
'GenSimHLBeamSpot',
'GenSimHLBeamSpot14',
'Digi',
'DigiTrigger',
'RecoLocal',
'Reco',
'RecoFakeHLT',
'RecoGlobal',
'RecoGlobalFakeHLT',
'RecoNano',
'RecoNanoFakeHLT',
'Nano',
'HARVESTNano',
'HARVESTNanoFakeHLT',
'ALCA',
],
suffix = '_HybridPUS1S2',
offset = 0.96,
)

class UpgradeWorkflow_Run3FStrackingOnly(UpgradeWorkflow):
def setup_(self, step, stepName, stepDict, k, properties):
if 'HARVESTFastRun3' in step:
Expand Down
Loading