CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
puppiForMET_cff Namespace Reference

Functions

def makePuppies
 
def makePuppiesFromMiniAOD
 

Function Documentation

def puppiForMET_cff.makePuppies (   process)

Definition at line 6 of file puppiForMET_cff.py.

Referenced by miniAOD_tools.miniAOD_customizeCommon().

6 
7 def makePuppies( process ):
8 
9  process.load('CommonTools.PileupAlgos.Puppi_cff')
10 
11  process.pfNoLepPUPPI = cms.EDFilter("PdgIdCandViewSelector",
12  src = cms.InputTag("particleFlow"),
13  pdgId = cms.vint32( 1,2,22,111,130,310,2112,211,-211,321,-321,999211,2212,-2212 )
14  )
15  process.pfLeptonsPUPPET = cms.EDFilter("PdgIdCandViewSelector",
16  src = cms.InputTag("particleFlow"),
17  pdgId = cms.vint32(-11,11,-13,13),
18  )
19 
20  process.puppiNoLep = process.puppi.clone()
21  process.puppiNoLep.candName = cms.InputTag('pfNoLepPUPPI')
22  process.puppiMerged = cms.EDProducer("CandViewMerger",src = cms.VInputTag( 'puppiNoLep','pfLeptonsPUPPET'))
23  process.load('CommonTools.PileupAlgos.PhotonPuppi_cff')
24  process.puppiForMET = process.puppiPhoton.clone()
25  #Line below replaces reference linking wiht delta R matching this is because the reference key in packed candidates differs to PF candidates (must be done when reading Reco)
26  process.puppiForMET.useRefs = False
27  #Line below points puppi MET to puppi no lepton which increases the response
28  process.puppiForMET.puppiCandName = 'puppiMerged'
29 
def puppiForMET_cff.makePuppiesFromMiniAOD (   process)

Definition at line 30 of file puppiForMET_cff.py.

References PhotonPuppi_cff.setupPuppiPhotonMiniAOD().

30 
31 def makePuppiesFromMiniAOD( process ):
32  process.load('CommonTools.PileupAlgos.Puppi_cff')
33  process.puppi.candName = cms.InputTag('packedPFCandidates')
34  process.puppi.vertexName = cms.InputTag('offlineSlimmedPrimaryVertices')
35  process.pfNoLepPUPPI = cms.EDFilter("CandPtrSelector", src = cms.InputTag("packedPFCandidates"), cut = cms.string("abs(pdgId) != 13 && abs(pdgId) != 11 && abs(pdgId) != 15"))
36  process.pfLeptonsPUPPET = cms.EDFilter("CandPtrSelector", src = cms.InputTag("packedPFCandidates"), cut = cms.string("abs(pdgId) == 13 || abs(pdgId) == 11 || abs(pdgId) == 15"))
37  process.puppiNoLep = process.puppi.clone()
38  process.puppiNoLep.candName = cms.InputTag('pfNoLepPUPPI')
39  process.puppiNoLep.useWeightsNoLep = cms.bool(True)
40  process.puppiMerged = cms.EDProducer("CandViewMerger",src = cms.VInputTag( 'puppiNoLep','pfLeptonsPUPPET'))
41  process.load('CommonTools.PileupAlgos.PhotonPuppi_cff')
42  process.puppiForMET = process.puppiPhoton.clone()
44  #Line below doesn't work because of an issue with references in MiniAOD without setting useRefs=>False and using delta R
45  #process.puppiForMET.puppiCandName = 'puppiMerged'
46  #process.puppiForMET.useRefs = False
47