Skip to content

Commit

Permalink
Merge pull request cms-sw#88 from pandolf/CMG_MiniAOD_Lite_V6_0_from-…
Browse files Browse the repository at this point in the history
…CMSSW_7_0_6

Jet ID related variables (7.0.X)
  • Loading branch information
gpetruc committed Jul 14, 2014
2 parents 2b238d9 + 446f50b commit 1e443ff
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
8 changes: 7 additions & 1 deletion CMGTools/RootTools/python/physicsobjects/Jet.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
}

class Jet(PhysicsObject):
def jetID(self,name):
def jetID(self,name=""):
if not self.isPFJet():
raise RuntimeError, "jetID implemented only for PF Jets"
eta = abs(self.eta());
Expand All @@ -41,6 +41,12 @@ def jetID(self,name):
npr = self.chargedMultiplicity() + self.neutralMultiplicity();
#if npr != self.nConstituents():
# import pdb; pdb.set_trace()
if name == "POG_PFID":
if self.jetID("POG_PFID_Tight") : return 3;
elif self.jetID("POG_PFID_Medium") : return 2;
elif self.jetID("POG_PFID_Loose") : return 1;
else : return 0;

if name == "POG_PFID_Loose": return (npr>1 and phf<0.99 and nhf<0.99) and (eta>2.4 or (elf<0.99 and chf>0 and chm>0));
if name == "POG_PFID_Medium": return (npr>1 and phf<0.95 and nhf<0.95) and (eta>2.4 or (elf<0.99 and chf>0 and chm>0));
if name == "POG_PFID_Tight": return (npr>1 and phf<0.90 and nhf<0.90) and (eta>2.4 or (elf<0.99 and chf>0 and chm>0));
Expand Down
5 changes: 3 additions & 2 deletions CMGTools/TTHAnalysis/python/analyzers/ntupleTypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,12 @@
jetTypeSusy = NTupleObjectType("jetSusy", baseObjectTypes = [ jetType ], variables = [
NTupleVariable("mcMatchId", lambda x : x.mcMatchId, int, mcOnly=True, help="Match to source from hard scatter (25 for H, 6 for t, 23/24 for W/Z)"),
NTupleVariable("mcMatchFlav", lambda x : x.mcMatchFlav, int, mcOnly=True, help="Flavour of associated parton from hard scatter (if any)"),
NTupleVariable("puJetId", lambda x : x.puJetIdPassed, int, mcOnly=False, help="puId (full MVA, loose WP, 5.3.X training on AK5PFchs: the only thing that is available now)"),
NTupleVariable("area", lambda x : x.jetArea(), help="Catchment area of jet"),
NTupleVariable("puId", lambda x : x.puJetIdPassed, int, mcOnly=False, help="puId (full MVA, loose WP, 5.3.X training on AK5PFchs: the only thing that is available now)"),
#NTupleVariable("PuId_full", lambda x : x.puId("full"), int, mcOnly=False, help="puId full: returns an integeger containing 3 bits, one for each working point (loose-bit2, medium-bit1, tight-bit0)"),
#NTupleVariable("PuId_simple", lambda x : x.puId("simple"), int, mcOnly=False, help="puId simple: returns an integeger containing 3 bits, one for each working point (loose-bit2, medium-bit1, tight-bit0)"),
#NTupleVariable("PuId_cut_based", lambda x : x.puId("cut-based"), int, mcOnly=False, help="puId cut-based: returns an integeger containing 3 bits, one for each working point (loose-bit2, medium-bit1, tight-bit0)"),
NTupleVariable("Id", lambda x : x.jetID("POG_PFID_Loose") , int, mcOnly=False,help="POG Loose jet ID"),
NTupleVariable("id", lambda x : x.jetID("POG_PFID") , int, mcOnly=False,help="POG Loose jet ID"),
])


Expand Down

0 comments on commit 1e443ff

Please sign in to comment.