1 from PhysicsTools.Heppy.physicsobjects.PhysicsObjects
import printOut
2 from PhysicsTools.Heppy.physicsobjects.PhysicsObjects
import GenParticle
5 '''Returns status 1 e and mu among the particle daughters'''
7 for i
in range( particle.numberOfDaughters() ):
8 dau = particle.daughter(i)
10 if abs(dau.pdgId())==11
or abs(dau.pdgId())==13:
20 '''Fills daughters with all the daughters of particle.
21 Recursive function.'''
23 for i
in range( particle.numberOfDaughters() ):
26 daughters.append( dau )
32 bosons =
filter(
lambda x: x.status()==3
and x.pdgId()==bosonType, particles)
39 xDaus =
filter(
lambda x: x.status()==3
and abs(x.pdgId())==xType, daus)
44 if abs(pdgId)
in [11,12,13,14,15,16]:
45 return includeSMLeptons
46 i = (
abs(pdgId) % 1000)
47 return i > 10
and i != 21
and i < 100
49 def isPromptLepton(lepton, beforeFSR, includeMotherless=True, includeTauDecays=False):
50 if abs(lepton.pdgId())
not in [11,13,15]:
52 if lepton.numberOfMothers() == 0:
53 return includeMotherless;
55 if mom.pdgId() == lepton.pdgId():
56 if beforeFSR:
return False
57 return isPromptLepton(mom, beforeFSR, includeMotherless, includeTauDecays)
58 elif abs(mom.pdgId()) == 15:
59 if not includeTauDecays:
return False
60 return isPromptLepton(mom, beforeFSR, includeMotherless, includeTauDecays)
66 for x
in xrange(l.numberOfMothers()):
68 if mom.status() > 2:
return True
70 if id > 1000000:
return True
71 if id > 100:
return False
72 if id < 6:
return False
73 if id == 21:
return False
74 if id
in [11,12,13,14,15,16]:
75 if l.status() > 2:
return True
77 if id >= 22
and id <= 39:
return True
81 """Get the daughters of a particle, going through radiative X -> X' + a
82 decays, either including or excluding the radiation among the daughters
84 X -> X' + a, X' -> b c
85 realGenDaughters(X, excludeRadiation=True) = { b, c }
86 realGenDaughters(X, excludeRadiation=False) = { a, b, c }"""
88 for i
in xrange(gp.numberOfDaughters()):
90 if dau.pdgId() == gp.pdgId():
100 """Get the mothers of a particle X going through intermediate X -> X' chains.
101 e.g. if Y -> X, X -> X' realGenMothers(X') = Y"""
103 for i
in xrange(gp.numberOfMothers()):
105 if mom.pdgId() == gp.pdgId():
113 for i
in xrange(gp.numberOfDaughters()):
114 if gp.daughter(i).
pdgId() == me:
def isNotFromHadronicShower
Abs< T >::type abs(const T &t)