Skip to content

Commit

Permalink
Merge pull request cms-sw#24 from cbernet/heppy_7_2_2_patch2
Browse files Browse the repository at this point in the history
merge to colin head
  • Loading branch information
arizzi committed Mar 2, 2015
2 parents 6eecc00 + dd44e7a commit 0cff1b6
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions PhysicsTools/Heppy/python/analyzers/gen/GeneratorAnalyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class GeneratorAnalyzer( Analyzer ):
event.genHiggsBosons = []
event.genVBosons = []
event.gennus = [] # prompt neutrinos
event.gennusFromTop = [] # Neutrinos from t->W decay
event.genleps = [] # leptons from direct decays
event.gentauleps = [] # leptons from prompt taus
event.gentaus = [] # hadronically-decaying taus (if allGenTaus is False) or all taus (if allGenTaus is True)
Expand Down Expand Up @@ -173,6 +174,7 @@ def makeMCInfo(self, event):
event.genHiggsBosons = []
event.genVBosons = []
event.gennus = []
event.gennusFromTop = []
event.genleps = []
event.gentauleps = []
event.gentaus = []
Expand All @@ -190,6 +192,19 @@ def makeMCInfo(self, event):
event.genVBosons.append(p)
elif id in {12,14,16}:
event.gennus.append(p)

momids = [(m, abs(m.pdgId())) for m in realGenMothers(p)]

#have a look at the lepton mothers
for mom, momid in momids:
#lepton from W
if momid == 24:
wmomids = [abs(m.pdgId()) for m in realGenMothers(mom)]
#W from t
if 6 in wmomids:
#save mu,e from t->W->mu/e
event.gennusFromTop.append(p)

elif id in {11,13}:
#taus to separate vector
if abs(p.motherId) == 15:
Expand Down

0 comments on commit 0cff1b6

Please sign in to comment.