CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
DiObject.DiTau Class Reference
Inheritance diagram for DiObject.DiTau:
DiObject.DiObject DiObject.MuonElectron DiObject.TauElectron DiObject.TauMuon DiObject.TauTau

Public Member Functions

def __init__ (self, diobject)
 
def match (self, genParticles)
 
- Public Member Functions inherited from DiObject.DiObject
def __init__ (self, diobject)
 
def __str__ (self)
 
def sumPt (self)
 

Public Attributes

 leg1DeltaR
 
 leg1Gen
 
 leg2DeltaR
 
 leg2Gen
 
- Public Attributes inherited from DiObject.DiObject
 diobject
 
 leg1DeltaR
 
 leg1Gen
 
 leg2DeltaR
 
 leg2Gen
 

Detailed Description

Definition at line 78 of file DiObject.py.

Constructor & Destructor Documentation

def DiObject.DiTau.__init__ (   self,
  diobject 
)

Definition at line 79 of file DiObject.py.

79  def __init__(self, diobject):
80  super(DiTau, self).__init__(diobject)
81 
def __init__(self, diobject)
Definition: DiObject.py:79

Member Function Documentation

def DiObject.DiTau.match (   self,
  genParticles 
)

Definition at line 82 of file DiObject.py.

References funct.abs(), and cosmictrackingParticleSelector_cfi.pdgId.

82  def match(self, genParticles):
83  #TODO review matching algorithm
84  #TODO move matching stuff even higher?
85  # print self
86  genTaus = []
87  ZorPhotonorHiggs = [22, 23, 25, 35, 36, 37]
88  for gen in genParticles:
89  # print '\t', gen
90  if abs(gen.pdgId())==15 and gen.mother().pdgId() in ZorPhotonorHiggs:
91  genTaus.append( gen )
92  # print 'Gen taus: '
93  # print '\n'.join( map( str, genTaus ) )
94  if len(genTaus)!=2:
95  #COLIN what about WW, ZZ?
96  return (-1, -1)
97  else:
98  dR2leg1Min, self.leg1Gen = ( float('inf'), None)
99  dR2leg2Min, self.leg2Gen = ( float('inf'), None)
100  for genTau in genTaus:
101  dR2leg1 = deltaR2(self.leg1().eta(), self.leg1().phi(),
102  genTau.eta(), genTau.phi() )
103  dR2leg2 = deltaR2(self.leg2().eta(), self.leg2().phi(),
104  genTau.eta(), genTau.phi() )
105  if dR2leg1 < dR2leg1Min:
106  dR2leg1Min, self.leg1Gen = (dR2leg1, genTau)
107  if dR2leg2 < dR2leg2Min:
108  dR2leg2Min, self.leg2Gen = (dR2leg2, genTau)
109  # print dR2leg1Min, dR2leg2Min
110  # print self.leg1Gen
111  # print self.leg2Gen
112  self.leg1DeltaR = math.sqrt( dR2leg1Min )
113  self.leg2DeltaR = math.sqrt( dR2leg2Min )
114  return (self.leg1DeltaR, self.leg2DeltaR)
115 
116 
def match(self, genParticles)
Definition: DiObject.py:82
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
T1 deltaR2(T1 eta1, T2 phi1, T3 eta2, T4 phi2)
Definition: deltaR.h:36

Member Data Documentation

DiObject.DiTau.leg1DeltaR

Definition at line 112 of file DiObject.py.

DiObject.DiTau.leg1Gen

Definition at line 98 of file DiObject.py.

DiObject.DiTau.leg2DeltaR

Definition at line 113 of file DiObject.py.

DiObject.DiTau.leg2Gen

Definition at line 99 of file DiObject.py.