def addPFCandidates(process, src, patLabel='PFParticles', cut="", postfix=""): from PhysicsTools.PatAlgos.producersLayer1.pfParticleProducer_cfi import patPFParticles # make modules producer = patPFParticles.clone(pfCandidateSource=src) filter = cms.EDFilter("PATPFParticleSelector", src=cms.InputTag("pat" + patLabel), cut=cms.string(cut)) counter = cms.EDFilter("PATCandViewCountFilter", minNumber=cms.uint32(0), maxNumber=cms.uint32(999999), src=cms.InputTag("pat" + patLabel)) # add modules to process setattr(process, "pat" + patLabel, producer) setattr(process, "selectedPat" + patLabel, filter) setattr(process, "countPat" + patLabel, counter) # insert into sequence getattr(process, "patDefaultSequence" + postfix).replace( applyPostfix(process, "patCandidateSummary", postfix), producer + applyPostfix(process, "patCandidateSummary", postfix)) getattr(process, "patDefaultSequence" + postfix).replace( applyPostfix(process, "selectedPatCandidateSummary", postfix), filter + applyPostfix(process, "selectedPatCandidateSummary", postfix)) index = len( applyPostfix(process, "patDefaultSequence", postfix).moduleNames()) applyPostfix(process, "patDefaultSequence", postfix).insert(index, counter) # summary tables applyPostfix(process, "patCandidateSummary", postfix).candidates.append(cms.InputTag('pat' + patLabel)) applyPostfix(process, "selectedPatCandidateSummary", postfix).candidates.append( cms.InputTag('selectedPat' + patLabel))
def addPFCandidates(process,src,patLabel='PFParticles',cut="",postfix=""): from PhysicsTools.PatAlgos.producersLayer1.pfParticleProducer_cfi import patPFParticles # make modules producer = patPFParticles.clone(pfCandidateSource = src) filter = cms.EDFilter("PATPFParticleSelector", src = cms.InputTag("pat" + patLabel), cut = cms.string(cut)) counter = cms.EDFilter("PATCandViewCountFilter", minNumber = cms.uint32(0), maxNumber = cms.uint32(999999), src = cms.InputTag("pat" + patLabel)) # add modules to process setattr(process, "pat" + patLabel, producer) setattr(process, "selectedPat" + patLabel, filter) setattr(process, "countPat" + patLabel, counter) # insert into sequence getattr(process, "patDefaultSequence"+postfix).replace( applyPostfix(process, "patCandidateSummary", postfix), producer+applyPostfix(process, "patCandidateSummary", postfix) ) getattr(process, "patDefaultSequence"+postfix).replace( applyPostfix(process, "selectedPatCandidateSummary", postfix), filter+applyPostfix(process, "selectedPatCandidateSummary", postfix) ) index = len( applyPostfix( process, "patDefaultSequence", postfix ).moduleNames() ) applyPostfix( process, "patDefaultSequence", postfix ).insert( index, counter ) # summary tables applyPostfix(process, "patCandidateSummary", postfix).candidates.append(cms.InputTag('pat' + patLabel)) applyPostfix(process, "selectedPatCandidateSummary", postfix).candidates.append(cms.InputTag('selectedPat' + patLabel))
def addPFCandidates(process,src,patLabel='PFParticles',cut="",postfix=""): from PhysicsTools.PatAlgos.producersLayer1.pfParticleProducer_cfi import patPFParticles # make modules producer = patPFParticles.clone(pfCandidateSource = src) filter = cms.EDFilter("PATPFParticleSelector", src = cms.InputTag("pat" + patLabel), cut = cms.string(cut)) counter = cms.EDFilter("PATCandViewCountFilter", minNumber = cms.uint32(0), maxNumber = cms.uint32(999999), src = cms.InputTag("pat" + patLabel)) # add modules to process task = getPatAlgosToolsTask(process) addToProcessAndTask("pat" + patLabel, producer, process, task) addToProcessAndTask("selectedPat" + patLabel, filter, process, task) addToProcessAndTask("countPat" + patLabel, counter, process, task) # summary tables applyPostfix(process, "patCandidateSummary", postfix).candidates.append(cms.InputTag('pat' + patLabel)) applyPostfix(process, "selectedPatCandidateSummary", postfix).candidates.append(cms.InputTag('selectedPat' + patLabel))
def addPFCandidates(process,src,patLabel='PFParticles',cut="",postfix=""): from PhysicsTools.PatAlgos.producersLayer1.pfParticleProducer_cfi import patPFParticles # make modules producer = patPFParticles.clone(pfCandidateSource = src) filter = cms.EDFilter("PATPFParticleSelector", src = cms.InputTag("pat" + patLabel), cut = cms.string(cut)) counter = cms.EDFilter("PATCandViewCountFilter", minNumber = cms.uint32(0), maxNumber = cms.uint32(999999), src = cms.InputTag("pat" + patLabel)) # add modules to process task = getPatAlgosToolsTask(process) addToProcessAndTask("pat" + patLabel, producer, process, task) addToProcessAndTask("selectedPat" + patLabel, filter, process, task) addToProcessAndTask("countPat" + patLabel, counter, process, task) # summary tables applyPostfix(process, "patCandidateSummary", postfix).candidates.append(cms.InputTag('pat' + patLabel)) applyPostfix(process, "selectedPatCandidateSummary", postfix).candidates.append(cms.InputTag('selectedPat' + patLabel))