def getGenTauJets(event): event.genTauJets = [] event.genTauJetConstituents = [] for gentau in event.gentaus: gentau = GenAnalyzer.getFinalTau(gentau) c_genjet = TauGenTreeProducer.finalDaughters(gentau) c_genjet = [ d for d in c_genjet if abs(d.pdgId()) not in [12, 14, 16] ] p4_genjet = sum( (d.p4() for d in c_genjet if abs(d.pdgId()) not in [12, 14, 16]), ROOT.math.XYZTLorentzVectorD()) genjet = GenParticle(gentau) genjet.setP4(p4_genjet) genjet.daughters = c_genjet genjet.decayMode = tauDecayModes.genDecayModeInt(c_genjet) if p4_genjet.pt() > 15.: if any( deltaR(p4_genjet, stored_genjet) < 0.002 for stored_genjet in event.genTauJets): continue # Remove duplicates event.genTauJets.append(genjet) event.genTauJetConstituents.append(c_genjet)
def getGenTauJets(event): event.genTauJets = [] event.genTauJetConstituents = [] for gentau in event.gentaus: gentau = HTTGenAnalyzer.getFinalTau(gentau) c_genjet = TauGenTreeProducer.finalDaughters(gentau) c_genjet = [d for d in c_genjet if abs(d.pdgId()) not in [12, 14, 16]] p4_genjet = sum((d.p4() for d in c_genjet if abs(d.pdgId()) not in [12, 14, 16]), ROOT.math.XYZTLorentzVectorD()) genjet = GenParticle(gentau) genjet.setP4(p4_genjet) if p4_genjet.pt() > 15.: event.genTauJets.append(genjet) event.genTauJetConstituents.append(c_genjet)