92 def getMT2Hemi(self, event, TMPobjects40jc, met, collectionPostFix, postFix):
94 if len(TMPobjects40jc)>=2:
96 pxvec = ROOT.std.vector(float)()
97 pyvec = ROOT.std.vector(float)()
98 pzvec = ROOT.std.vector(float)()
99 Evec = ROOT.std.vector(float)()
100 grouping = ROOT.std.vector(int)()
102 for jet
in TMPobjects40jc:
103 pxvec.push_back(jet.px())
104 pyvec.push_back(jet.py())
105 pzvec.push_back(jet.pz())
106 Evec.push_back(jet.energy())
108 hemisphere = Hemisphere(pxvec, pyvec, pzvec, Evec, 2, 3)
109 grouping=hemisphere.getGrouping()
123 for index
in range(0, len(pxvec)):
124 if(grouping[index]==1):
125 pseudoJet1px += pxvec[index]
126 pseudoJet1py += pyvec[index]
127 pseudoJet1pz += pzvec[index]
128 pseudoJet1energy += Evec[index]
130 if(grouping[index]==2):
131 pseudoJet2px += pxvec[index]
132 pseudoJet2py += pyvec[index]
133 pseudoJet2pz += pzvec[index]
134 pseudoJet2energy += Evec[index]
137 pseudoJet1pt2 = pseudoJet1px*pseudoJet1px + pseudoJet1py*pseudoJet1py
138 pseudoJet2pt2 = pseudoJet2px*pseudoJet2px + pseudoJet2py*pseudoJet2py
140 if pseudoJet1pt2 >= pseudoJet2pt2:
141 setattr(event,
"pseudoJet1"+collectionPostFix+postFix, ROOT.reco.Particle.LorentzVector( pseudoJet1px, pseudoJet1py, pseudoJet1pz, pseudoJet1energy ))
142 setattr(event,
"pseudoJet2"+collectionPostFix+postFix, ROOT.reco.Particle.LorentzVector( pseudoJet2px, pseudoJet2py, pseudoJet2pz, pseudoJet2energy ))
143 setattr(event,
"multPseudoJet1"+collectionPostFix+postFix, multPSJ1 )
144 setattr(event,
"multPseudoJet2"+collectionPostFix+postFix, multPSJ2 )
146 setattr(event,
"pseudoJet2"+collectionPostFix+postFix, ROOT.reco.Particle.LorentzVector( pseudoJet1px, pseudoJet1py, pseudoJet1pz, pseudoJet1energy ))
147 setattr(event,
"pseudoJet1"+collectionPostFix+postFix, ROOT.reco.Particle.LorentzVector( pseudoJet2px, pseudoJet2py, pseudoJet2pz, pseudoJet2energy ))
148 setattr(event,
"multPseudoJet1"+collectionPostFix+postFix, multPSJ2 )
149 setattr(event,
"multPseudoJet2"+collectionPostFix+postFix, multPSJ1 )
151 setattr(event,
"mt2"+collectionPostFix+postFix, self.
computeMT2(getattr(event,
'pseudoJet1'+collectionPostFix+postFix), getattr(event,
'pseudoJet2'+collectionPostFix+postFix), met) )
152 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)