Skip to content

Commit

Permalink
Merge pull request #10148 from davidlange6/unsch_75x_150711
Browse files Browse the repository at this point in the history
Fix met filters in pat
  • Loading branch information
davidlange6 committed Jul 11, 2015
2 parents 242b413 + a637361 commit 64d7c33
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
8 changes: 8 additions & 0 deletions Configuration/Applications/python/ConfigBuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -2203,6 +2203,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
10 changes: 8 additions & 2 deletions 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 Expand Up @@ -362,6 +367,7 @@ def testWithSchedule(self):
self.assertEqual(process.p2.dumpPython(None),'cms.Path()\n')
self.assertEqual(process.p3.dumpPython(None),'cms.Path(process.f1)\n')
self.assertEqual(process.p4.dumpPython(None),'cms.Path(process.f2+process.f1)\n')
self.assertEqual([p for p in process.schedule],[process.p1,process.p4,process.p2,process.p3])
# there is no longer a schedule.
# self.assertEqual([p for p in process.schedule],[process.p1,process.p4,process.p2,process.p3])

unittest.main()
1 change: 0 additions & 1 deletion PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,6 @@ def miniAOD_customizeCommon(process):
del process.slimmedMETsPuppi.caloMET



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

0 comments on commit 64d7c33

Please sign in to comment.