Skip to content

Commit

Permalink
remove schedules from unscheduled and clean any producers in PAT that…
Browse files Browse the repository at this point in the history
… should not be on a path
  • Loading branch information
davidlange6 committed Jul 11, 2015
1 parent 0af49a1 commit eb5307f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 19 deletions.
8 changes: 8 additions & 0 deletions Configuration/Applications/python/ConfigBuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -2191,6 +2191,14 @@ def prepare(self, doChecking = False):
self.process.load(module)
self.pythonCfgCode += ("process.load('"+module+"')\n")

#and clean the unscheduled stuff
self.pythonCfgCode+="from FWCore.ParameterSet.Utilities import cleanUnscheduled\n"
self.pythonCfgCode+="process=cleanUnscheduled(process)\n"

from FWCore.ParameterSet.Utilities import cleanUnscheduled
self.process=cleanUnscheduled(self.process)


self.pythonCfgCode += self.addCustomise(1)


Expand Down
7 changes: 6 additions & 1 deletion FWCore/ParameterSet/python/Utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ def convertToUnscheduled(proc):
proc.options = cms.untracked.PSet()
proc.options.allowUnscheduled = cms.untracked.bool(True)

proc=cleanUnscheduled(proc)
return proc

def cleanUnscheduled(proc):
import FWCore.ParameterSet.Config as cms
l = proc.paths
droppedPaths =[]
#have to get them now since switching them after the
Expand Down Expand Up @@ -218,7 +223,7 @@ def getQualifiedModule(name,proc):
# If there is a schedule then it needs to point at
# the new Path objects
if proc.schedule:
proc.schedule = cms.Schedule([getattr(proc,p) for p in pathNamesInScheduled])
proc._Process__schedule = None
return proc

if __name__ == "__main__":
Expand Down
16 changes: 1 addition & 15 deletions PhysicsTools/PatAlgos/python/slimming/metFilterPaths_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,7 @@
# and the summary
Flag_METFilters = cms.Path(metFilters)


def miniAOD_insertMETFiltersInSchedule(process):
All_METFilters = [ 'Flag_HBHENoiseFilter', 'Flag_CSCTightHaloFilter', 'Flag_hcalLaserEventFilter', 'Flag_EcalDeadCellTriggerPrimitiveFilter', 'Flag_goodVertices', 'Flag_trackingFailureFilter', 'Flag_eeBadScFilter', 'Flag_ecalLaserCorrFilter', 'Flag_trkPOGFilters', 'Flag_trkPOG_manystripclus53X', 'Flag_trkPOG_toomanystripclus53X', 'Flag_trkPOG_logErrorTooManyClusters', 'Flag_METFilters']
if hasattr(process,'schedule'):
found = -1
for i,p in enumerate(process.schedule):
if isinstance(p, cms.EndPath):
found = i
break
for pname in All_METFilters:
path = getattr(process,pname)
if not isinstance(path, cms.Path): raise RuntimeError, "Path %s is not a cms.Path?" % pathname
if found == -1: process.schedule.append(path)
else: process.schedule.insert(found, path)


def miniAOD_customizeMETFiltersFastSim(process):
"""Replace some MET filters that don't work in FastSim with trivial bools"""
for X in 'CSCTightHaloFilter', 'HBHENoiseFilter', 'HBHENoiseFilterResultProducer':
Expand Down
3 changes: 0 additions & 3 deletions PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,6 @@ def miniAOD_customizeCommon(process):
process.slimmedMETsPuppi.type1Uncertainties = cms.InputTag("patPFMetT1") # only central value for now
del process.slimmedMETsPuppi.type1p2Uncertainties # not available

from PhysicsTools.PatAlgos.slimming.metFilterPaths_cff import miniAOD_insertMETFiltersInSchedule
miniAOD_insertMETFiltersInSchedule(process)

def miniAOD_customizeMC(process):
process.muonMatch.matched = "prunedGenParticles"
process.electronMatch.matched = "prunedGenParticles"
Expand Down

0 comments on commit eb5307f

Please sign in to comment.