CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Functions
objects.JetAnalyzer Namespace Reference

Classes

class  JetAnalyzer
 

Functions

def cleanNearestJetOnly
 

Function Documentation

def objects.JetAnalyzer.cleanNearestJetOnly (   jets,
  leptons,
  deltaR 
)

Definition at line 11 of file JetAnalyzer.py.

References reco.deltaR2().

Referenced by objects.JetAnalyzer.JetAnalyzer.process().

11 
12 def cleanNearestJetOnly(jets,leptons,deltaR):
13  dr2 = deltaR**2
14  good = [ True for j in jets ]
15  for l in leptons:
16  ibest, d2m = -1, dr2
17  for i,j in enumerate(jets):
18  d2i = deltaR2(l.eta(),l.phi(), j.eta(),j.phi())
19  if d2i < d2m:
20  ibest, d2m = i, d2i
21  if ibest != -1: good[ibest] = False
22  return [ j for (i,j) in enumerate(jets) if good[i] == True ]
23 
double deltaR2(const T1 &t1, const T2 &t2)
Definition: deltaR.h:36