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 because the puppi references after merging are not consistent with those of the original PF collection
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,
  createScheduledSequence = False 
)

Definition at line 30 of file puppiForMET_cff.py.

References PhotonPuppi_cff.setupPuppiPhotonMiniAOD().

30 
31 def makePuppiesFromMiniAOD( process, createScheduledSequence=False ):
32  process.load('CommonTools.PileupAlgos.Puppi_cff')
33  process.puppi.candName = cms.InputTag('packedPFCandidates')
34  process.puppi.clonePackedCands = cms.bool(True)
35  process.puppi.vertexName = cms.InputTag('offlineSlimmedPrimaryVertices')
36  process.puppi.useExistingWeights = cms.bool(True)
37  process.pfNoLepPUPPI = cms.EDFilter("CandPtrSelector", src = cms.InputTag("packedPFCandidates"), cut = cms.string("abs(pdgId) != 13 && abs(pdgId) != 11 && abs(pdgId) != 15"))
38  process.pfLeptonsPUPPET = cms.EDFilter("CandPtrSelector", src = cms.InputTag("packedPFCandidates"), cut = cms.string("abs(pdgId) == 13 || abs(pdgId) == 11 || abs(pdgId) == 15"))
39  process.puppiNoLep = process.puppi.clone()
40  process.puppiNoLep.candName = cms.InputTag('pfNoLepPUPPI')
41  process.puppiNoLep.useWeightsNoLep = cms.bool(True)
42  process.puppiNoLep.useExistingWeights = cms.bool(True)
43  process.puppiMerged = cms.EDProducer("CandViewMerger",src = cms.VInputTag( 'puppiNoLep','pfLeptonsPUPPET'))
44  process.load('CommonTools.PileupAlgos.PhotonPuppi_cff')
45  process.puppiForMET = process.puppiPhoton.clone()
46  process.puppiForMET.candName = cms.InputTag('packedPFCandidates')
47  process.puppiForMET.photonName = cms.InputTag('slimmedPhotons')
48  process.puppiForMET.runOnMiniAOD = cms.bool(True)
50  #Line below replaces reference linking wiht delta R matching because the puppi references after merging are not consistent with those of the original packed candidate collection
51  process.puppiForMET.useRefs = False
52  #Line below points puppi MET to puppi no lepton which increases the response
53  process.puppiForMET.puppiCandName = 'puppiMerged'
54 
55  #making a sequence for people running the MET tool in scheduled mode
56  if createScheduledSequence:
57  puppiMETSequence = cms.Sequence(process.puppi*process.pfLeptonsPUPPET*process.pfNoLepPUPPI*process.puppiNoLep*process.puppiMerged*process.puppiForMET)
58  setattr(process, "puppiMETSequence", puppiMETSequence)