88 def getMT2Hemi(self, event, TMPobjects40jc, met, postFix):
90 if len(TMPobjects40jc)>=2:
92 pxvec = ROOT.std.vector(float)()
93 pyvec = ROOT.std.vector(float)()
94 pzvec = ROOT.std.vector(float)()
95 Evec = ROOT.std.vector(float)()
96 grouping = ROOT.std.vector(int)()
98 for jet
in TMPobjects40jc:
99 pxvec.push_back(jet.px())
100 pyvec.push_back(jet.py())
101 pzvec.push_back(jet.pz())
102 Evec.push_back(jet.energy())
104 hemisphere = Hemisphere(pxvec, pyvec, pzvec, Evec, 2, 3)
105 grouping=hemisphere.getGrouping()
119 for index
in range(0, len(pxvec)):
120 if(grouping[index]==1):
121 pseudoJet1px += pxvec[index]
122 pseudoJet1py += pyvec[index]
123 pseudoJet1pz += pzvec[index]
124 pseudoJet1energy += Evec[index]
126 if(grouping[index]==2):
127 pseudoJet2px += pxvec[index]
128 pseudoJet2py += pyvec[index]
129 pseudoJet2pz += pzvec[index]
130 pseudoJet2energy += Evec[index]
133 pseudoJet1pt2 = pseudoJet1px*pseudoJet1px + pseudoJet1py*pseudoJet1py
134 pseudoJet2pt2 = pseudoJet2px*pseudoJet2px + pseudoJet2py*pseudoJet2py
136 if pseudoJet1pt2 >= pseudoJet2pt2:
137 setattr(event,
"pseudoJet1"+postFix, ROOT.reco.Particle.LorentzVector( pseudoJet1px, pseudoJet1py, pseudoJet1pz, pseudoJet1energy ))
138 setattr(event,
"pseudoJet2"+postFix, ROOT.reco.Particle.LorentzVector( pseudoJet2px, pseudoJet2py, pseudoJet2pz, pseudoJet2energy ))
139 setattr(event,
"multPseudoJet1"+postFix, multPSJ1 )
140 setattr(event,
"multPseudoJet2"+postFix, multPSJ2 )
142 setattr(event,
"pseudoJet2"+postFix, ROOT.reco.Particle.LorentzVector( pseudoJet1px, pseudoJet1py, pseudoJet1pz, pseudoJet1energy ))
143 setattr(event,
"pseudoJet1"+postFix, ROOT.reco.Particle.LorentzVector( pseudoJet2px, pseudoJet2py, pseudoJet2pz, pseudoJet2energy ))
144 setattr(event,
"multPseudoJet1"+postFix, multPSJ2 )
145 setattr(event,
"multPseudoJet2"+postFix, multPSJ1 )
147 return self.
computeMT2(getattr(event,
'pseudoJet1'+postFix), getattr(event,
'pseudoJet2'+postFix), met)