93 def getMT2Hemi(self, event, TMPobjects40jc, met, collectionPostFix, postFix):
95 if len(TMPobjects40jc)>=2:
97 pxvec = ROOT.std.vector(float)()
98 pyvec = ROOT.std.vector(float)()
99 pzvec = ROOT.std.vector(float)()
100 Evec = ROOT.std.vector(float)()
101 grouping = ROOT.std.vector(int)()
103 for jet
in TMPobjects40jc:
104 pxvec.push_back(jet.px())
105 pyvec.push_back(jet.py())
106 pzvec.push_back(jet.pz())
107 Evec.push_back(jet.energy())
109 hemisphere = Hemisphere(pxvec, pyvec, pzvec, Evec, 2, 3)
110 grouping=hemisphere.getGrouping()
124 for index
in range(0, len(pxvec)):
125 if(grouping[index]==1):
126 pseudoJet1px += pxvec[index]
127 pseudoJet1py += pyvec[index]
128 pseudoJet1pz += pzvec[index]
129 pseudoJet1energy += Evec[index]
131 if(grouping[index]==2):
132 pseudoJet2px += pxvec[index]
133 pseudoJet2py += pyvec[index]
134 pseudoJet2pz += pzvec[index]
135 pseudoJet2energy += Evec[index]
138 pseudoJet1pt2 = pseudoJet1px*pseudoJet1px + pseudoJet1py*pseudoJet1py
139 pseudoJet2pt2 = pseudoJet2px*pseudoJet2px + pseudoJet2py*pseudoJet2py
141 if pseudoJet1pt2 >= pseudoJet2pt2:
142 setattr(event,
"pseudoJet1"+collectionPostFix+postFix, ROOT.reco.Particle.LorentzVector( pseudoJet1px, pseudoJet1py, pseudoJet1pz, pseudoJet1energy ))
143 setattr(event,
"pseudoJet2"+collectionPostFix+postFix, ROOT.reco.Particle.LorentzVector( pseudoJet2px, pseudoJet2py, pseudoJet2pz, pseudoJet2energy ))
144 setattr(event,
"multPseudoJet1"+collectionPostFix+postFix, multPSJ1 )
145 setattr(event,
"multPseudoJet2"+collectionPostFix+postFix, multPSJ2 )
147 setattr(event,
"pseudoJet2"+collectionPostFix+postFix, ROOT.reco.Particle.LorentzVector( pseudoJet1px, pseudoJet1py, pseudoJet1pz, pseudoJet1energy ))
148 setattr(event,
"pseudoJet1"+collectionPostFix+postFix, ROOT.reco.Particle.LorentzVector( pseudoJet2px, pseudoJet2py, pseudoJet2pz, pseudoJet2energy ))
149 setattr(event,
"multPseudoJet1"+collectionPostFix+postFix, multPSJ2 )
150 setattr(event,
"multPseudoJet2"+collectionPostFix+postFix, multPSJ1 )
152 setattr(event,
"mt2"+collectionPostFix+postFix, self.
computeMT2(getattr(event,
'pseudoJet1'+collectionPostFix+postFix), getattr(event,
'pseudoJet2'+collectionPostFix+postFix), met) )
153 return self.
computeMT2(getattr(event,
'pseudoJet1'+collectionPostFix+postFix), getattr(event,
'pseudoJet2'+collectionPostFix+postFix), met)