1 import FWCore.ParameterSet.Config
as cms
4 from CommonTools.PileupAlgos.PhotonPuppi_cff
import setupPuppiPhoton,setupPuppiPhotonMiniAOD
12 process.load(
'CommonTools.PileupAlgos.Puppi_cff')
13 task.add(process.puppi)
14 process.pfNoLepPUPPI = cms.EDFilter(
"PdgIdCandViewSelector",
15 src = cms.InputTag(
"particleFlow"),
16 pdgId = cms.vint32( 1,2,22,111,130,310,2112,211,-211,321,-321,999211,2212,-2212 )
18 task.add(process.pfNoLepPUPPI)
19 process.pfLeptonsPUPPET = cms.EDFilter(
"PdgIdCandViewSelector",
20 src = cms.InputTag(
"particleFlow"),
21 pdgId = cms.vint32(-11,11,-13,13),
23 task.add(process.pfLeptonsPUPPET)
26 process.puppiNoLep.candName = cms.InputTag(
'pfNoLepPUPPI')
27 process.puppiMerged = cms.EDProducer(
"CandViewMerger",src = cms.VInputTag(
'puppiNoLep',
'pfLeptonsPUPPET'))
28 task.add(process.puppiMerged)
29 process.load(
'CommonTools.PileupAlgos.PhotonPuppi_cff')
30 task.add(process.puppiPhoton)
33 process.puppiForMET.useRefs =
False 35 process.puppiForMET.puppiCandName =
'puppiMerged' 40 process.load(
'CommonTools.PileupAlgos.Puppi_cff')
41 task.add(process.puppi)
42 process.puppi.candName = cms.InputTag(
'packedPFCandidates')
43 process.puppi.clonePackedCands = cms.bool(
True)
44 process.puppi.vertexName = cms.InputTag(
'offlineSlimmedPrimaryVertices')
45 process.puppi.useExistingWeights = cms.bool(
True)
46 process.pfNoLepPUPPI = cms.EDFilter(
"CandPtrSelector", src = cms.InputTag(
"packedPFCandidates"), cut = cms.string(
"abs(pdgId) != 13 && abs(pdgId) != 11 && abs(pdgId) != 15"))
47 task.add(process.pfNoLepPUPPI)
48 process.pfLeptonsPUPPET = cms.EDFilter(
"CandPtrSelector", src = cms.InputTag(
"packedPFCandidates"), cut = cms.string(
"abs(pdgId) == 13 || abs(pdgId) == 11 || abs(pdgId) == 15"))
49 task.add(process.pfLeptonsPUPPET)
51 process.puppiNoLep.candName = cms.InputTag(
'pfNoLepPUPPI')
52 process.puppiNoLep.useWeightsNoLep = cms.bool(
True)
53 process.puppiNoLep.useExistingWeights = cms.bool(
True)
54 process.puppiMerged = cms.EDProducer(
"CandViewMerger",src = cms.VInputTag(
'puppiNoLep',
'pfLeptonsPUPPET'))
55 task.add(process.puppiMerged)
56 process.load(
'CommonTools.PileupAlgos.PhotonPuppi_cff')
57 task.add(process.puppiPhoton)
59 process.puppiForMET.candName = cms.InputTag(
'packedPFCandidates')
60 process.puppiForMET.photonName = cms.InputTag(
'slimmedPhotons')
61 process.puppiForMET.runOnMiniAOD = cms.bool(
True)
63 task.add(process.egmPhotonIDTask)
65 process.puppiForMET.useRefs =
False 67 process.puppiForMET.puppiCandName =
'puppiMerged' 70 if createScheduledSequence:
71 puppiMETSequence = cms.Sequence(process.puppi*process.pfLeptonsPUPPET*process.pfNoLepPUPPI*process.puppiNoLep*process.puppiMerged*process.puppiForMET)
72 setattr(process,
"puppiMETSequence", puppiMETSequence)
def addToProcessAndTask(label, module, process, task)
def setupPuppiPhotonMiniAOD(process)
def getPatAlgosToolsTask(process)