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

◆ __init__()

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, dataset, job_number, job_id, job_name, isDA, isMC, applyBOWS, applyEXTRACOND, extraconditions, runboundary, lumilist, intlumi, maxevents, gt, allFromGT, alignmentDB, alignmentTAG, apeDB, apeTAG, bowDB, bowTAG, vertextype, tracktype, refittertype, ttrhtype, applyruncontrol, ptcut, CMSSW_dir, the_dir)

Member Function Documentation

◆ match()

def DiObject.DiTau.match (   self,
  genParticles 
)

Definition at line 82 of file DiObject.py.

References funct.abs(), and EgammaValidation_cff.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 
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10

Member Data Documentation

◆ leg1DeltaR

DiObject.DiTau.leg1DeltaR

Definition at line 112 of file DiObject.py.

◆ leg1Gen

DiObject.DiTau.leg1Gen

Definition at line 98 of file DiObject.py.

◆ leg2DeltaR

DiObject.DiTau.leg2DeltaR

Definition at line 113 of file DiObject.py.

◆ leg2Gen

DiObject.DiTau.leg2Gen

Definition at line 99 of file DiObject.py.