def findTriplets(self, jets): out = [] for j1, j2, j3 in itertools.combinations(jets, 3): out.append( DiObject(j3,DiObject(j1, j2)) ) return out
def beta4(self, ebeam): from numpy import array, linalg, dot, add self.rescaledLeptonJets = copy.copy(self.zLeptons) self.rescaledTauJets = copy.copy(self.tauJets) rows = [] for i in range(4): rows.append([]) for jet in self.rescaledLeptonJets: rows[0].append(jet.px() / jet.energy()) rows[1].append(jet.py() / jet.energy()) rows[2].append(jet.pz() / jet.energy()) rows[3].append(jet.energy() / jet.energy()) for jet in self.rescaledTauJets: rows[0].append(jet.px() / jet.energy()) rows[1].append(jet.py() / jet.energy()) rows[2].append(jet.pz() / jet.energy()) rows[3].append(jet.energy() / jet.energy()) constraint = [0., 0., 0., 2. * ebeam] d2 = array(rows) d = array(constraint) #print d2 #print d try: energies = linalg.solve(d2, d) except linalg.linalg.LinAlgError: energies = [-1., -1., -1., -1.] #print energies chi2 = 0. for i, jet in enumerate(self.rescaledLeptonJets): p4 = jet.p4() p4.SetPxPyPzE(jet.px() * energies[i] / jet.energy(), jet.py() * energies[i] / jet.energy(), jet.pz() * energies[i] / jet.energy(), energies[i]) jet.setP4(p4) for i, jet in enumerate(self.rescaledTauJets): p4 = jet.p4() p4.SetPxPyPzE(jet.px() * energies[i + 2] / jet.energy(), jet.py() * energies[i + 2] / jet.energy(), jet.pz() * energies[i + 2] / jet.energy(), energies[i + 2]) jet.setP4(p4) self.llRescaled = DiObject(self.rescaledLeptonJets[0], self.rescaledLeptonJets[1]) self.ttRescaled = DiObject(self.rescaledTauJets[0], self.rescaledTauJets[1])
def findPairs(self, jets): out = [] for j1, j2 in itertools.combinations(jets, 2): out.append( DiObject(j1, j2) ) return out
def findHZ(self, jets, taus): result=False hz = [] hPair = [] zPair = [] deltaZ = 999. dijets = [] ditau = [] ditau = DiObject(taus[0],taus[1]) dijet = DiObject(jets[0], jets[1]) #print "diphoton mass",diphoton.M() #print "dijet mass",dijet.M() hz = [ditau, dijet] if ditau.M() > self.cfg_ana.h_mass and \ dijet.M() > self.cfg_ana.z_mass[0] and \ dijet.M() < self.cfg_ana.z_mass[1] : result=True return result,hz