91 def getMT2Hemi(self, event, TMPobjects40jc, met, collectionPostFix, postFix):
93 if len(TMPobjects40jc)>=2:
95 pxvec = ROOT.std.vector(float)()
96 pyvec = ROOT.std.vector(float)()
97 pzvec = ROOT.std.vector(float)()
98 Evec = ROOT.std.vector(float)()
99 grouping = ROOT.std.vector(int)()
101 for jet
in TMPobjects40jc:
102 pxvec.push_back(jet.px())
103 pyvec.push_back(jet.py())
104 pzvec.push_back(jet.pz())
105 Evec.push_back(jet.energy())
107 hemisphere = Hemisphere(pxvec, pyvec, pzvec, Evec, 2, 3)
108 grouping=hemisphere.getGrouping()
122 for index
in range(0, len(pxvec)):
123 if(grouping[index]==1):
124 pseudoJet1px += pxvec[index]
125 pseudoJet1py += pyvec[index]
126 pseudoJet1pz += pzvec[index]
127 pseudoJet1energy += Evec[index]
129 if(grouping[index]==2):
130 pseudoJet2px += pxvec[index]
131 pseudoJet2py += pyvec[index]
132 pseudoJet2pz += pzvec[index]
133 pseudoJet2energy += Evec[index]
136 pseudoJet1pt2 = pseudoJet1px*pseudoJet1px + pseudoJet1py*pseudoJet1py
137 pseudoJet2pt2 = pseudoJet2px*pseudoJet2px + pseudoJet2py*pseudoJet2py
139 if pseudoJet1pt2 >= pseudoJet2pt2:
140 setattr(event,
"pseudoJet1"+collectionPostFix+postFix, ROOT.reco.Particle.LorentzVector( pseudoJet1px, pseudoJet1py, pseudoJet1pz, pseudoJet1energy ))
141 setattr(event,
"pseudoJet2"+collectionPostFix+postFix, ROOT.reco.Particle.LorentzVector( pseudoJet2px, pseudoJet2py, pseudoJet2pz, pseudoJet2energy ))
142 setattr(event,
"multPseudoJet1"+collectionPostFix+postFix, multPSJ1 )
143 setattr(event,
"multPseudoJet2"+collectionPostFix+postFix, multPSJ2 )
145 setattr(event,
"pseudoJet2"+collectionPostFix+postFix, ROOT.reco.Particle.LorentzVector( pseudoJet1px, pseudoJet1py, pseudoJet1pz, pseudoJet1energy ))
146 setattr(event,
"pseudoJet1"+collectionPostFix+postFix, ROOT.reco.Particle.LorentzVector( pseudoJet2px, pseudoJet2py, pseudoJet2pz, pseudoJet2energy ))
147 setattr(event,
"multPseudoJet1"+collectionPostFix+postFix, multPSJ2 )
148 setattr(event,
"multPseudoJet2"+collectionPostFix+postFix, multPSJ1 )
150 setattr(event,
"mt2"+collectionPostFix+postFix, self.
computeMT2(getattr(event,
'pseudoJet1'+collectionPostFix+postFix), getattr(event,
'pseudoJet2'+collectionPostFix+postFix), met) )
151 return self.
computeMT2(getattr(event,
'pseudoJet1'+collectionPostFix+postFix), getattr(event,
'pseudoJet2'+collectionPostFix+postFix), met)
def computeMT2(self, visaVec, visbVec, metVec)
def getMT2Hemi(self, event, TMPobjects40jc, met, collectionPostFix, postFix)