CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
puppiForMET_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
4 # from CommonTools.PileupAlgos.PhotonPuppi_cff import setupPuppiPhoton
5 
6 def makePuppies( process ):
7 
8  process.load('CommonTools.PileupAlgos.Puppi_cff')
9 
10  process.pfNoLepPUPPI = cms.EDFilter("PdgIdCandViewSelector",
11  src = cms.InputTag("particleFlow"),
12  pdgId = cms.vint32( 1,2,22,111,130,310,2112,211,-211,321,-321,999211,2212,-2212 )
13  )
14  process.pfLeptonsPUPPET = cms.EDFilter("PdgIdCandViewSelector",
15  src = cms.InputTag("particleFlow"),
16  pdgId = cms.vint32(-11,11,-13,13),
17  )
18 
19 
20  process.puppiNoLep = process.puppi.clone()
21  process.puppiNoLep.candName = cms.InputTag('pfNoLepPUPPI')
22 
23  process.puppiMerged = cms.EDProducer("CandViewMerger",src = cms.VInputTag( 'puppiNoLep','pfLeptonsPUPPET'))
24 
25 ## puppi met
26  process.puppiForMET = cms.EDProducer("PuppiPhoton",
27  candName = cms.InputTag('packedPFCandidates'),
28  puppiCandName = cms.InputTag('puppi'),
29  photonName = cms.InputTag('slimmedPhotons'),
30  photonId = cms.InputTag("egmPhotonIDs:cutBasedPhotonID_PHYS14_PU20bx25_V2p1-standalone-loose"),
31  pt = cms.double(10),
32  useRefs = cms.bool(True),
33  dRMatch = cms.vdouble(10,10,10,10),
34  pdgids = cms.vint32 (22,11,211,130),
35  weight = cms.double(1.),
36  useValueMap = cms.bool(False),
37  weightsName = cms.InputTag('puppi'),
38  )
39  process.puppiForMET.puppiCandName = 'puppiMerged'
40 
41 
42 
43 def makePuppiesFromMiniAOD( process ):
44 
45  process.load('CommonTools.PileupAlgos.Puppi_cff')
46 
47  process.puppi.candName = cms.InputTag('packedPFCandidates')
48  process.puppi.vertexName = cms.InputTag('offlineSlimmedPrimaryVertices')
49 # kind of ugly, is there a better way to do this?
50 
51  process.pfNoLepPUPPI = cms.EDFilter("CandPtrSelector", src = cms.InputTag("packedPFCandidates"), cut = cms.string("abs(pdgId) != 13 && abs(pdgId) != 11 && abs(pdgId) != 15"))
52  process.pfLeptonsPUPPET = cms.EDFilter("CandPtrSelector", src = cms.InputTag("packedPFCandidates"), cut = cms.string("abs(pdgId) == 13 || abs(pdgId) == 11 || abs(pdgId) == 15"))
53 
54  process.puppiNoLep = process.puppi.clone()
55  process.puppiNoLep.candName = cms.InputTag('pfNoLepPUPPI')
56 
57  process.puppiMerged = cms.EDProducer("CandViewMerger",src = cms.VInputTag( 'puppiNoLep','pfLeptonsPUPPET'))
58 
59 ## puppi met
60  process.puppiForMET = cms.EDProducer("PuppiPhoton",
61  candName = cms.InputTag('packedPFCandidates'),
62  puppiCandName = cms.InputTag('puppi'),
63  photonName = cms.InputTag('slimmedPhotons'),
64  photonId = cms.InputTag("egmPhotonIDs:cutBasedPhotonID_PHYS14_PU20bx25_V2p1-standalone-loose"),
65  pt = cms.double(10),
66  useRefs = cms.bool(True),
67  dRMatch = cms.vdouble(10,10,10,10),
68  pdgids = cms.vint32 (22,11,211,130),
69  weight = cms.double(1.),
70  useValueMap = cms.bool(False),
71  weightsName = cms.InputTag('puppi'),
72  )
73  process.puppiForMET.puppiCandName = 'puppiMerged'
74