Example #1
0
    def fillGenLeptons(self, event, particle, isTau=False, sourceId=25):
        """Get the gen level light leptons (prompt and/or from tau decays)"""

        for i in xrange( particle.numberOfDaughters() ):
            dau = GenParticle(particle.daughter(i))
            dau.sourceId = sourceId
            dau.isTau = isTau
            id = abs(dau.pdgId())
            if id in [11,13]:
                if isTau: event.gentauleps.append(dau)
                else:     event.genleps.append(dau)
            elif id == 15:
                self.fillGenLeptons(event, dau, True, sourceId)
            elif id in [22,23,24]:
                self.fillGenLeptons(event, dau, False, sourceId)
Example #2
0
    def fillGenLeptons(self, event, particle, isTau=False, sourceId=25):
        """Get the gen level light leptons (prompt and/or from tau decays)"""

        for i in xrange(particle.numberOfDaughters()):
            dau = GenParticle(particle.daughter(i))
            dau.sourceId = sourceId
            dau.isTau = isTau
            id = abs(dau.pdgId())
            if id in [11, 13]:
                if isTau: event.gentauleps.append(dau)
                else: event.genleps.append(dau)
            elif id == 15:
                self.fillGenLeptons(event, dau, True, sourceId)
            elif id in [22, 23, 24]:
                self.fillGenLeptons(event, dau, False, sourceId)