27 goodjet = [
True for j
in jets ]
28 goodlep = [
True for l
in leptons ]
29 for il, l
in enumerate(leptons):
31 for i,j
in enumerate(jets):
32 d2i =
deltaR2(l.eta(),l.phi(), j.eta(),j.phi())
34 choice = arbitration(j,l)
39 elif choice == (j,l)
or choice == (l,j):
45 if not goodlep[il]:
continue 46 if ibest != -1: goodjet[ibest] =
False 47 return ( [ j
for (i ,j)
in enumerate(jets)
if goodjet[i ] ==
True ],
48 [ l
for (il,l)
in enumerate(leptons)
if goodlep[il] ==
True ] )
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
def cleanJetsAndLeptons(jets, leptons, deltaR, arbitration)