CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
puppiForMET_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
4 
5 from PhysicsTools.PatAlgos.tools.helpers import getPatAlgosToolsTask, addToProcessAndTask
6 
7 def makePuppies( process ):
8  task = getPatAlgosToolsTask(process)
9  process.load('CommonTools.PileupAlgos.Puppi_cff')
10  task.add(process.puppi)
11  task.add(process.puppiNoLep)
12 
13 def makePuppiesFromMiniAOD( process, createScheduledSequence=False ):
14  task = getPatAlgosToolsTask(process)
15  from CommonTools.ParticleFlow.pfCHS_cff import packedPrimaryVertexAssociationJME
16  setattr(process, "packedPrimaryVertexAssociationJME", packedPrimaryVertexAssociationJME.clone())
17  task.add(process.packedPrimaryVertexAssociationJME)
18  process.load('CommonTools.PileupAlgos.Puppi_cff')
19  task.add(process.puppi)
20  process.puppi.candName = 'packedPFCandidates'
21  process.puppi.clonePackedCands = True
22  process.puppi.vertexName = 'offlineSlimmedPrimaryVertices'
23  process.puppi.useExistingWeights = True
24  process.puppi.vertexAssociation = 'packedPrimaryVertexAssociationJME:original'
25  task.add(process.puppiNoLep)
26  process.puppiNoLep.candName = 'packedPFCandidates'
27  process.puppiNoLep.clonePackedCands = True
28  process.puppiNoLep.vertexName = 'offlineSlimmedPrimaryVertices'
29  process.puppiNoLep.useExistingWeights = True
30  process.puppiNoLep.vertexAssociation = 'packedPrimaryVertexAssociationJME:original'
31 
32  #making a sequence for people running the MET tool in scheduled mode
33  if createScheduledSequence:
34  puppiMETTask = cms.Task(process.packedPrimaryVertexAssociationJME, process.puppi, process.puppiNoLep)
35  setattr(process, "puppiMETTask", puppiMETTask)
36  puppiMETSequence = cms.Sequence(puppiMETTask)
37  setattr(process, "puppiMETSequence", puppiMETSequence)
def getPatAlgosToolsTask
Definition: helpers.py:13