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