1 from __future__
import print_function
2 import FWCore.ParameterSet.Config
as cms
13 process.particleFlowPtrs = RecoParticleFlow.PFProducer.pfLinker_cff.particleFlowPtrs.clone()
14 task.add(process.particleFlowPtrs)
16 process.load(
"CommonTools.ParticleFlow.pfNoPileUpIso_cff")
17 task.add(process.pfNoPileUpIsoTask)
18 process.load(
"CommonTools.ParticleFlow.ParticleSelectors.pfSortByType_cff")
19 task.add(process.pfSortByTypeTask)
22 process.ak4PFJetsCHS = RecoJets.Configuration.RecoPFJets_cff.ak4PFJetsCHS.clone()
23 task.add(process.ak4PFJetsCHS)
25 process.ak4PFJets = RecoJets.Configuration.RecoPFJets_cff.ak4PFJets.clone()
26 task.add(process.ak4PFJets)
27 process.ak8PFJetsCHS = RecoJets.Configuration.RecoPFJets_cff.ak8PFJetsCHS.clone()
28 task.add(process.ak8PFJetsCHS)
30 process.fixedGridRhoAll = RecoJets.Configuration.RecoPFJets_cff.fixedGridRhoAll.clone()
31 process.fixedGridRhoFastjetAll = RecoJets.Configuration.RecoPFJets_cff.fixedGridRhoFastjetAll.clone()
32 process.fixedGridRhoFastjetCentral = RecoJets.Configuration.RecoPFJets_cff.fixedGridRhoFastjetCentral.clone()
33 process.fixedGridRhoFastjetCentralChargedPileUp = RecoJets.Configuration.RecoPFJets_cff.fixedGridRhoFastjetCentralChargedPileUp.clone()
34 process.fixedGridRhoFastjetCentralNeutral = RecoJets.Configuration.RecoPFJets_cff.fixedGridRhoFastjetCentralNeutral.clone()
35 task.add( process.fixedGridRhoAll,
36 process.fixedGridRhoFastjetAll,
37 process.fixedGridRhoFastjetCentral,
38 process.fixedGridRhoFastjetCentralChargedPileUp,
39 process.fixedGridRhoFastjetCentralNeutral )
41 process.load(
"RecoJets.JetAssociationProducers.ak4JTA_cff")
42 task.add(process.ak4JTATask)
44 process.load(
'RecoBTag.Configuration.RecoBTag_cff')
45 task.add(process.btaggingTask)
47 process.load(
"RecoMET.METProducers.pfMet_cfi")
48 task.add(process.pfMet)
55 process.load(
"CommonTools.ParticleFlow.pfCandidateRecalibrator_cfi")
56 task.add(process.pfCandidateRecalibrator)
58 replacePFCandidates = MassSearchReplaceAnyInputTagVisitor(
"particleFlow",
"pfCandidateRecalibrator", verbose=verbose)
59 replacePFTmpPtrs = MassSearchReplaceAnyInputTagVisitor(
"particleFlowTmpPtrs",
"particleFlowPtrs", verbose=verbose)
60 for everywhere
in [ process.producers, process.filters, process.analyzers, process.psets, process.vpsets ]:
61 for name,obj
in six.iteritems(everywhere):
62 if obj != process.pfCandidateRecalibrator:
63 replacePFCandidates.doIt(obj, name)
64 replacePFTmpPtrs.doIt(obj, name)
67 process.load(
"CommonTools.ParticleFlow.pfEGammaToCandidateRemapper_cfi")
68 task.add(process.pfEGammaToCandidateRemapper)
69 process.pfEGammaToCandidateRemapper.pf2pf = cms.InputTag(
"pfCandidateRecalibrator")
70 process.reducedEgamma.gsfElectronsPFValMap = cms.InputTag(
"pfEGammaToCandidateRemapper",
"electrons")
71 process.reducedEgamma.photonsPFValMap = cms.InputTag(
"pfEGammaToCandidateRemapper",
"photons")
78 process.primaryVertexAssociationDiscardedCandidates = process.primaryVertexAssociation.clone(
79 particles = inputCollection,
81 task.add(process.primaryVertexAssociationDiscardedCandidates)
83 process.packedPFCandidatesDiscarded = process.packedPFCandidates.clone(
84 inputCollection = inputCollection,
85 PuppiNoLepSrc = cms.InputTag(
""),
86 PuppiSrc = cms.InputTag(
""),
87 secondaryVerticesForWhiteList = cms.VInputTag(),
88 vertexAssociator = cms.InputTag(
"primaryVertexAssociationDiscardedCandidates",
"original")
90 task.add(process.packedPFCandidatesDiscarded)
93 [
"keep patPackedCandidates_packedPFCandidatesDiscarded_*_*"],
100 print(
"===>>> customizing the process for legacy rereco 2016")