from itertools import combinations def jetSelection(event, ptcut=20., etacut=2.4): def jetfilter(jet): return jet.PT>ptcut and abs(jet.Eta)