CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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__
 
def match
 
- Public Member Functions inherited from DiObject.DiObject
def __init__
 
def __str__
 
def sumPt
 

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 
80  def __init__(self, diobject):
81  super(DiTau, self).__init__(diobject)

Member Function Documentation

def DiObject.DiTau.match (   self,
  genParticles 
)

Definition at line 82 of file DiObject.py.

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

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