Skip to content

Commit

Permalink
Merge pull request #36350 from kpedro88/Phase2-WF78
Browse files Browse the repository at this point in the history
More Nano step-related fixes for Run3/Phase2 workflows
  • Loading branch information
cmsbuild authored Dec 5, 2021
2 parents ad121a5 + 815a5fe commit ad04da7
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 28 deletions.
3 changes: 2 additions & 1 deletion Configuration/Eras/python/Era_Run3_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from Configuration.Eras.Modifier_ctpps_2018_cff import ctpps_2018
from Configuration.Eras.Modifier_ctpps_2021_cff import ctpps_2021
from Configuration.ProcessModifiers.dd4hep_cff import dd4hep
from Configuration.Eras.Modifier_run3_nanoAOD_devel_cff import run3_nanoAOD_devel

Run3 = cms.ModifierChain(Run2_2018.copyAndExclude([run2_GEM_2017, ctpps_2018]), run3_common, run3_GEM, run3_HB, run3_HFSL, stage2L1Trigger_2021, ctpps_2021, dd4hep)
Run3 = cms.ModifierChain(Run2_2018.copyAndExclude([run2_GEM_2017, ctpps_2018]), run3_common, run3_GEM, run3_HB, run3_HFSL, stage2L1Trigger_2021, ctpps_2021, dd4hep, run3_nanoAOD_devel)

Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ def setup_(self, step, stepName, stepDict, k, properties):
if cust is not None: stepDict[stepName][k]['--customise']=cust
if era is not None:
stepDict[stepName][k]['--era']=era
if 'RecoNano' in stepName: stepDict[stepName][k]['--era'] += ',run3_nanoAOD_devel'
if modifier is not None: stepDict[stepName][k]['--procModifier']=modifier
def condition(self, fragment, stepList, key, hasHarvest):
return True
Expand Down Expand Up @@ -202,19 +201,27 @@ def condition(self, fragment, stepList, key, hasHarvest):

# some commonalities among tracking WFs
class UpgradeWorkflowTracking(UpgradeWorkflow):
# skip the PU argument since PU workflows never used here
def __init__(self, steps, suffix, offset):
# always include some steps that will be skipped
steps = steps + ["ALCA","Nano"]
super().__init__(steps, [], suffix, offset)
def condition(self, fragment, stepList, key, hasHarvest):
result = (fragment=="TTbar_13" or fragment=="TTbar_14TeV") and not 'PU' in key and hasHarvest and self.condition_(fragment, stepList, key, hasHarvest)
if result:
# skip ALCA and Nano
skipList = [s for s in stepList if (("ALCA" in s) or ("Nano" in s))]
for skip in skipList:
stepList.remove(skip)
return result
def condition_(self, fragment, stepList, key, hasHarvest):
return True
def setup_(self, step, stepName, stepDict, k, properties):
# skip ALCA and Nano steps (but not RecoNano or HARVESTNano for Run3)
if 'ALCA' in step or 'Nano'==step:
stepDict[stepName][k] = None
self.setup__(step, stepName, stepDict, k, properties)
# subordinate function for inherited classes
def setup__(self, step, stepName, stepDict, k, properties):
pass

class UpgradeWorkflow_trackingOnly(UpgradeWorkflowTracking):
def setup_(self, step, stepName, stepDict, k, properties):
def setup__(self, step, stepName, stepDict, k, properties):
if 'Reco' in step: stepDict[stepName][k] = merge([self.step3, stepDict[step][k]])
elif 'HARVEST' in step: stepDict[stepName][k] = merge([{'-s': 'HARVESTING:@trackingOnlyValidation+@trackingOnlyDQM'}, stepDict[step][k]])
upgradeWFs['trackingOnly'] = UpgradeWorkflow_trackingOnly(
Expand All @@ -226,7 +233,6 @@ def setup_(self, step, stepName, stepDict, k, properties):
'RecoNano',
'HARVESTNano',
],
PU = [],
suffix = '_trackingOnly',
offset = 0.1,
)
Expand All @@ -239,7 +245,7 @@ def setup_(self, step, stepName, stepDict, k, properties):
step3_trackingOnly = upgradeWFs['trackingOnly'].step3

class UpgradeWorkflow_trackingRun2(UpgradeWorkflowTracking):
def setup_(self, step, stepName, stepDict, k, properties):
def setup__(self, step, stepName, stepDict, k, properties):
if 'Reco' in step and stepDict[step][k]['--era']=='Run2_2017':
stepDict[stepName][k] = merge([{'--era': 'Run2_2017_trackingRun2'}, stepDict[step][k]])
def condition_(self, fragment, stepList, key, hasHarvest):
Expand All @@ -248,13 +254,12 @@ def condition_(self, fragment, stepList, key, hasHarvest):
steps = [
'Reco',
],
PU = [],
suffix = '_trackingRun2',
offset = 0.2,
)

class UpgradeWorkflow_trackingOnlyRun2(UpgradeWorkflowTracking):
def setup_(self, step, stepName, stepDict, k, properties):
def setup__(self, step, stepName, stepDict, k, properties):
if 'Reco' in step and stepDict[step][k]['--era']=='Run2_2017':
stepDict[stepName][k] = merge([{'--era': 'Run2_2017_trackingRun2'}, self.step3, stepDict[step][k]])
elif 'HARVEST' in step: stepDict[stepName][k] = merge([{'-s': 'HARVESTING:@trackingOnlyValidation+@trackingOnlyDQM'}, stepDict[step][k]])
Expand All @@ -265,14 +270,13 @@ def condition_(self, fragment, stepList, key, hasHarvest):
'Reco',
'HARVEST',
],
PU = [],
suffix = '_trackingOnlyRun2',
offset = 0.3,
)
upgradeWFs['trackingOnlyRun2'].step3 = upgradeWFs['trackingOnly'].step3

class UpgradeWorkflow_trackingLowPU(UpgradeWorkflowTracking):
def setup_(self, step, stepName, stepDict, k, properties):
def setup__(self, step, stepName, stepDict, k, properties):
if 'Reco' in step and stepDict[step][k]['--era']=='Run2_2017':
stepDict[stepName][k] = merge([{'--era': 'Run2_2017_trackingLowPU'}, stepDict[step][k]])
def condition_(self, fragment, stepList, key, hasHarvest):
Expand All @@ -281,13 +285,12 @@ def condition_(self, fragment, stepList, key, hasHarvest):
steps = [
'Reco',
],
PU = [],
suffix = '_trackingLowPU',
offset = 0.4,
)

class UpgradeWorkflow_pixelTrackingOnly(UpgradeWorkflowTracking):
def setup_(self, step, stepName, stepDict, k, properties):
def setup__(self, step, stepName, stepDict, k, properties):
if 'Reco' in step: stepDict[stepName][k] = merge([self.step3, stepDict[step][k]])
elif 'HARVEST' in step: stepDict[stepName][k] = merge([{'-s': 'HARVESTING:@trackingOnlyValidation+@pixelTrackingOnlyDQM'}, stepDict[step][k]])
def condition_(self, fragment, stepList, key, hasHarvest):
Expand All @@ -301,7 +304,6 @@ def condition_(self, fragment, stepList, key, hasHarvest):
'RecoNano',
'HARVESTNano',
],
PU = [],
suffix = '_pixelTrackingOnly',
offset = 0.5,
)
Expand All @@ -312,7 +314,7 @@ def condition_(self, fragment, stepList, key, hasHarvest):
}

class UpgradeWorkflow_trackingMkFit(UpgradeWorkflowTracking):
def setup_(self, step, stepName, stepDict, k, properties):
def setup__(self, step, stepName, stepDict, k, properties):
if 'Digi' in step: stepDict[stepName][k] = merge([self.step2, stepDict[step][k]])
if 'Reco' in step: stepDict[stepName][k] = merge([self.step3, stepDict[step][k]])
def condition_(self, fragment, stepList, key, hasHarvest):
Expand All @@ -325,7 +327,6 @@ def condition_(self, fragment, stepList, key, hasHarvest):
'RecoGlobal',
'RecoNano',
],
PU = [],
suffix = '_trackingMkFit',
offset = 0.7,
)
Expand All @@ -339,14 +340,12 @@ def condition_(self, fragment, stepList, key, hasHarvest):
#DeepCore seeding for JetCore iteration workflow
class UpgradeWorkflow_seedingDeepCore(UpgradeWorkflow):
def setup_(self, step, stepName, stepDict, k, properties):
if 'Reco' in step or 'HARVEST' in step: stepDict[stepName][k] = merge([{'--procModifiers': 'seedingDeepCore'}, stepDict[step][k]])
# skip ALCA and Nano steps (but not RecoNano or HARVESTNano for Run3)
if 'ALCA' in step or 'Nano'==step:
stepDict[stepName][k] = None
elif 'Reco' in step or 'HARVEST' in step: stepDict[stepName][k] = merge([{'--procModifiers': 'seedingDeepCore'}, stepDict[step][k]])
def condition(self, fragment, stepList, key, hasHarvest):
result = (fragment=="QCD_Pt_1800_2400_14" or fragment=="TTbar_14TeV" ) and ('2021' in key or '2024' in key) and hasHarvest
if result:
# skip ALCA and Nano
skipList = [s for s in stepList if (("ALCA" in s) or ("Nano" in s))]
for skip in skipList:
stepList.remove(skip)
return result
upgradeWFs['seedingDeepCore'] = UpgradeWorkflow_seedingDeepCore(
steps = [
Expand All @@ -356,6 +355,8 @@ def condition(self, fragment, stepList, key, hasHarvest):
'HARVESTGlobal',
'RecoNano',
'HARVESTNano',
'Nano',
'ALCA',
],
PU = [],
suffix = '_seedingDeepCore',
Expand Down Expand Up @@ -755,7 +756,7 @@ def setup_(self, step, stepName, stepDict, k, properties):
elif 'ALCA' in step or 'HARVEST' in step:
# remove step
stepDict[stepName][k] = None
elif 'Nano' in step:
elif 'Nano'==step:
stepDict[stepName][k] = merge([{'--filein':'file:step4.root','-s':'NANO','--datatier':'NANOAODSIM','--eventcontent':'NANOEDMAODSIM'}, stepDict[step][k]])
def condition(self, fragment, stepList, key, hasHarvest):
return fragment=="TTbar_14TeV" and ('2026' in key or '2021' in key)
Expand Down Expand Up @@ -1019,7 +1020,7 @@ def setupPU_(self, step, stepName, stepDict, k, properties):
d["--procModifiers"] = "premix_stage2"
stepDict[stepName][k] = d
# Increase the input file step number by one for Nano in combined stage1+stage2
elif "Nano" in step:
elif "Nano"==step:
# go back to non-PU step version
d = merge([stepDict[self.getStepName(step)][k]])
if "--filein" in d:
Expand Down Expand Up @@ -1135,7 +1136,7 @@ def setup_(self, step, stepName, stepDict, k, properties):
"--eventcontent": "PREMIXRAW"},
d])
stepDict[stepName][k] = d
if 'Nano' in step:
if 'Nano'==step:
stepDict[stepName][k] = merge([{'--filein':'file:step5.root','-s':'NANO','--datatier':'NANOAODSIM','--eventcontent':'NANOEDMAODSIM'}, stepDict[step][k]])
def condition(self, fragment, stepList, key, hasHarvest):
# use both conditions
Expand Down

0 comments on commit ad04da7

Please sign in to comment.