26 goodjet = [
True for j
in jets ]
27 goodlep = [
True for l
in leptons ]
28 for il, l
in enumerate(leptons):
30 for i,j
in enumerate(jets):
31 d2i =
deltaR2(l.eta(),l.phi(), j.eta(),j.phi())
33 choice = arbitration(j,l)
38 elif choice == (j,l)
or choice == (l,j):
44 if not goodlep[il]:
continue 45 if ibest != -1: goodjet[ibest] =
False 46 return ( [ j
for (i ,j)
in enumerate(jets)
if goodjet[i ] ==
True ],
47 [ l
for (il,l)
in enumerate(leptons)
if goodlep[il] ==
True ] )
def cleanJetsAndLeptons(jets, leptons, deltaR, arbitration)
T1 deltaR2(T1 eta1, T2 phi1, T3 eta2, T4 phi2)