mhtpx, mhtpy = 0., 0. for j,jet in enumerate(goodJets): mhtpx -= jet["pt"]*cos(jet["phi"]) mhtpy -= jet["pt"]*sin(jet["phi"]) if j<4: exec("s.jet"+str(j)+"pt="+str(jet["pt"])) s.mht = sqrt(mhtpx**2 + mhtpy**2) leptonPair = [] if chmode=="doubleMu": leptonPair = getBestLeptonPair(allGoodLeptons["muons"], chmode) if chmode=="doubleEle": leptonPair = getBestLeptonPair(allGoodLeptons["electrons"], chmode) if chmode=="eleMu": leptonPair = getBestLeptonPair(allGoodLeptons["leptons"], chmode) # if len(allGoodLeptons) >=2 and ((mode=="highMET" and allGoodLeptons[0]["pt"]>20.) or (mode=="lowMET" and allGoodLeptons[1]["pt"]>20.))\ if len(leptonPair) >=2 and ((mode=="highMET" and leptonPair[0]["pt"]>20. and leptonPair[1]["pt"]>10.) or (mode=="lowMET" and leptonPair[1]["pt"]>20.)): l1 = leptonPair[0]; l2 = leptonPair[1]; s.nLep = len(allGoodLeptons["leptons"]) s.deltaRLL = deltaR(l1, l2) px1 = l1["pt"]*cos(l1["phi"]); px2 = l2["pt"]*cos(l2["phi"]) py1 = l1["pt"]*sin(l1["phi"]); py2 = l2["pt"]*sin(l2["phi"]) pz1 = l1["pt"]*sinh(l1["eta"]); pz2 = l2["pt"]*sinh(l2["eta"]) px = px1+px2 py = py1+py2 pz = pz1+pz2 s.ptZ = sqrt(px*px + py* py) p1 = sqrt(px1*px1+py1*py1+pz1*pz1) p2 = sqrt(px2*px2+py2*py2+pz2*pz2) p = sqrt(px*px+py*py+pz*pz) s.mLL = sqrt((p1 + p2)*(p1 + p2) - p*p) s.jzb = getVarValue(c, "mht") - s.ptZ s.pdg1 = l1["pdg"] s.pdg2 = l2["pdg"]