1 import FWCore.ParameterSet.Config
as cms
4 from PhysicsTools.PatAlgos.slimming.extraJets_MuEGFixMoriond2017
import backupJetsFirstStep, backupJetsSecondStep
14 process.load(
"RecoMET.METFilters.badGlobalMuonTaggersAOD_cff")
15 task.add(process.badGlobalMuonTagger)
16 task.add(process.cloneGlobalMuonTagger)
17 process.Flag_noBadMuons = cms.Path(process.noBadGlobalMuons)
18 process.Flag_badMuons = cms.Path(process.badGlobalMuonTagger)
19 process.Flag_duplicateMuons = cms.Path(process.cloneGlobalMuonTagger)
20 for P
in process.Flag_noBadMuons, process.Flag_badMuons, process.Flag_duplicateMuons:
21 process.schedule.insert(0, P)
27 process.load(
"CommonTools.ParticleFlow.muonsCleaned_cfi")
28 task.add(process.muonsCleaned)
29 process.patMuons.userData.userInts.src = [ cms.InputTag(
"muonsCleaned:oldPF") ]
31 process.load(
"CommonTools.ParticleFlow.pfCandidatesBadMuonsCleaned_cfi")
32 task.add(process.pfCandidatesBadMuonsCleaned)
33 process.muonsCleaned.badmuons = badMuons
34 replaceMuons = MassSearchReplaceAnyInputTagVisitor(
"muons",
"muonsCleaned", verbose=verbose)
35 needOriginalMuons = [ process.muonsCleaned ] + [ getattr(process,l.moduleLabel)
for l
in badMuons ]
36 replacePFCandidates = MassSearchReplaceAnyInputTagVisitor(
"particleFlow",
"pfCandidatesBadMuonsCleaned", verbose=verbose)
37 for everywhere
in [ process.producers, process.filters, process.analyzers, process.psets, process.vpsets ]:
38 for name,obj
in six.iteritems(everywhere):
39 if obj
not in needOriginalMuons:
40 replaceMuons.doIt(obj, name)
41 if obj != process.pfCandidatesBadMuonsCleaned:
42 replacePFCandidates.doIt(obj, name)
44 process.load(
"CommonTools.ParticleFlow.pfEGammaToCandidateRemapper_cfi")
45 task.add(process.pfEGammaToCandidateRemapper)
46 process.pfEGammaToCandidateRemapper.pf2pf = cms.InputTag(
"pfCandidatesBadMuonsCleaned")
47 process.reducedEgamma.gsfElectronsPFValMap = cms.InputTag(
"pfEGammaToCandidateRemapper",
"electrons")
48 process.reducedEgamma.photonsPFValMap = cms.InputTag(
"pfEGammaToCandidateRemapper",
"photons")
49 if hasattr(process,
"gedGsfElectronsFixed"):
52 process.pfEGammaToCandidateRemapperBeforeGSFix = process.pfEGammaToCandidateRemapper.clone()
53 task.add(process.pfEGammaToCandidateRemapperBeforeGSFix)
54 process.reducedEgammaBeforeGSFix.gsfElectronsPFValMap = cms.InputTag(
"pfEGammaToCandidateRemapperBeforeGSFix",
"electrons")
55 process.reducedEgammaBeforeGSFix.photonsPFValMap = cms.InputTag(
"pfEGammaToCandidateRemapperBeforeGSFix",
"photons")
57 process.pfEGammaToCandidateRemapper.electrons = cms.InputTag(
"gedGsfElectronsFixed")
58 process.pfEGammaToCandidateRemapper.photons = cms.InputTag(
"gedPhotonsFixed")
59 process.pfEGammaToCandidateRemapper.electron2pf = cms.InputTag(
"particleBasedIsolationGSFixed",
"gedGsfElectrons")
60 process.pfEGammaToCandidateRemapper.photon2pf = cms.InputTag(
"particleBasedIsolationGSFixed",
"gedPhotons")
62 sys.stderr.write(
"WARNING : attempt to use gain switch corrected electron/photon collection gedGsfElectronsFixed, but the current process does not contain such collection")
68 process.primaryVertexAssociationDiscardedCandidates = process.primaryVertexAssociation.clone(
69 particles = inputCollection,
71 task.add(process.primaryVertexAssociationDiscardedCandidates)
72 process.packedPFCandidatesDiscarded = process.packedPFCandidates.clone(
73 inputCollection = inputCollection,
74 PuppiNoLepSrc = cms.InputTag(
""),
75 PuppiSrc = cms.InputTag(
""),
76 secondaryVerticesForWhiteList = cms.VInputTag(),
77 vertexAssociator = cms.InputTag(
"primaryVertexAssociationDiscardedCandidates",
"original")
79 task.add(process.packedPFCandidatesDiscarded)
81 [
"keep patPackedCandidates_packedPFCandidatesDiscarded_*_*"],
84 from PhysicsTools.PatAlgos.slimming.packedPFCandidateRefMixer_cfi
import packedPFCandidateRefMixer
85 process.oldPFCandToPackedOrDiscarded = packedPFCandidateRefMixer.clone(
86 pf2pf = cms.InputTag(inputCollection.moduleLabel),
87 pf2packed = cms.VInputTag(cms.InputTag(
"packedPFCandidates"), cms.InputTag(
"packedPFCandidatesDiscarded"))
89 task.add(process.oldPFCandToPackedOrDiscarded)
91 process.slimmedMuons.pfCandidates = cms.VInputTag(cms.InputTag(inputCollection.moduleLabel), inputCollection)
92 process.slimmedMuons.packedPFCandidates = cms.VInputTag(cms.InputTag(
"packedPFCandidates"), cms.InputTag(
"packedPFCandidatesDiscarded"))
96 process.slimmedTaus.packedPFCandidates=cms.InputTag(
"packedPFCandidatesBackup")
103 process.ak4PFJetsCHS = RecoJets.Configuration.RecoPFJets_cff.ak4PFJetsCHS.clone()
104 task.add(process.ak4PFJetsCHS)
105 process.ak8PFJetsCHS = RecoJets.Configuration.RecoPFJets_cff.ak8PFJetsCHS.clone()
106 task.add(process.ak8PFJetsCHS)
107 process.load(
"RecoMET.METProducers.PFMET_cfi")
108 task.add(process.pfMet)
109 process.load(
"RecoBTag.ImpactParameter.impactParameter_cff")
110 task.add(process.impactParameterTask)
111 process.load(
"RecoBTag.SecondaryVertex.secondaryVertex_cff")
112 task.add(process.secondaryVertexTask)
113 process.load(
"RecoBTag.SoftLepton.softLepton_cff")
114 task.add(process.softLeptonTask)
115 process.load(
"RecoBTag.Combined.combinedMVA_cff")
116 task.add(process.combinedMVATask)
117 process.load(
"RecoBTag.CTagging.cTagging_cff")
118 task.add(process.cTaggingTask)
119 process.load(
"RecoVertex.AdaptiveVertexFinder.inclusiveVertexing_cff")
120 task.add(process.inclusiveVertexingTask)
121 task.add(process.inclusiveCandidateVertexingTask)
122 task.add(process.inclusiveCandidateVertexingCvsLTask)
133 badMuons = cms.VInputTag( cms.InputTag(
"badGlobalMuonTagger",
"bad"), cms.InputTag(
"cloneGlobalMuonTagger",
"bad") )
143 process.patMuons.embedCaloMETMuonCorrs =
False 145 from PhysicsTools.PatAlgos.slimming.extraSlimmedMETs_MuEGFixMoriond2017
import addExtraMETCollections,addExtraPuppiMETCorrections
150 unCleanPFCandidateCollection=
"particleFlow",
151 cleanElectronCollection=
"slimmedElectrons",
152 cleanPhotonCollection=
"slimmedPhotons",
153 unCleanElectronCollection=
"slimmedElectrons",
154 unCleanPhotonCollection=
"slimmedPhotons")
157 cleanPFCandidateCollection=
"particleFlow",
158 unCleanPFCandidateCollection=
"pfCandidatesBadMuonsCleaned",
159 cleanElectronCollection=
"slimmedElectrons",
160 cleanPhotonCollection=
"slimmedPhotons",
161 unCleanElectronCollection=
"slimmedElectrons",
162 unCleanPhotonCollection=
"slimmedPhotons")
165 "keep *_slimmedMETs_*_*",
166 [
"keep *_slimmedMETsUncorrected_*_*",
167 "keep *_slimmedMETsEGClean_*_*",
168 "keep *_slimmedMETsMuEGClean_*_*"],
171 "keep *_slimmedMETsPuppi_*_*",
172 [
"keep *_puppiMETEGCor_*_*",
173 "keep *_puppiMETMuCor_*_*"],
179 from PhysicsTools.PatAlgos.slimming.miniAOD_tools
import miniAOD_customizeData
def addDiscardedPFCandidates(process, inputCollection, verbose=False)
def addBadMuonFilters(process)
def addKeepStatement(process, oldKeep, newKeeps, verbose=False)
def customizeAll(process, verbose=False)
def loadJetMETBTag(process)
def cleanPFCandidates(process, badMuons, verbose=False)
def getPatAlgosToolsTask(process)