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 > 100:
return False
71 if id < 6:
return False
72 if id == 21:
return False
74 if id >= 22
and id <= 39:
return True
78 """Get the daughters of a particle, going through radiative X -> X' + a
79 decays, either including or excluding the radiation among the daughters
81 X -> X' + a, X' -> b c
82 realGenDaughters(X, excludeRadiation=True) = { b, c }
83 realGenDaughters(X, excludeRadiation=False) = { a, b, c }"""
85 for i
in xrange(gp.numberOfDaughters()):
87 if dau.pdgId() == gp.pdgId():
97 """Get the mothers of a particle X going through intermediate X -> X' chains.
98 e.g. if Y -> X, X -> X' realGenMothers(X') = Y"""
100 for i
in xrange(gp.numberOfMothers()):
102 if mom.pdgId() == gp.pdgId():
def isNotFromHadronicShower
Abs< T >::type abs(const T &t)