File indexing completed on 2024-04-06 12:23:56
0001 import FWCore.ParameterSet.Config as cms
0002
0003 from CommonTools.PileupAlgos.Puppi_cff import *
0004
0005 from PhysicsTools.PatAlgos.tools.helpers import getPatAlgosToolsTask, addToProcessAndTask
0006
0007 def makePuppies( process ):
0008 task = getPatAlgosToolsTask(process)
0009 process.load('CommonTools.PileupAlgos.Puppi_cff')
0010 task.add(process.puppi)
0011 task.add(process.puppiNoLep)
0012
0013 def makePuppiesFromMiniAOD( process, createScheduledSequence=False ):
0014 task = getPatAlgosToolsTask(process)
0015 process.load('CommonTools.PileupAlgos.Puppi_cff')
0016 task.add(process.puppi)
0017 process.puppi.candName = 'packedPFCandidates'
0018 process.puppi.clonePackedCands = True
0019 process.puppi.vertexName = 'offlineSlimmedPrimaryVertices'
0020 process.puppi.useExistingWeights = True
0021 task.add(process.puppiNoLep)
0022 process.puppiNoLep.candName = 'packedPFCandidates'
0023 process.puppiNoLep.clonePackedCands = True
0024 process.puppiNoLep.vertexName = 'offlineSlimmedPrimaryVertices'
0025 process.puppiNoLep.useExistingWeights = True
0026
0027
0028 if createScheduledSequence:
0029 puppiMETTask = cms.Task(process.puppi, process.puppiNoLep)
0030 setattr(process, "puppiMETTask", puppiMETTask)
0031 puppiMETSequence = cms.Sequence(puppiMETTask)
0032 setattr(process, "puppiMETSequence", puppiMETSequence)