Skip to content

Commit

Permalink
Merge pull request cms-sw#636 from gkasieczka/dev-divzero
Browse files Browse the repository at this point in the history
do not attempt calib for zeropt subjets
  • Loading branch information
arizzi committed Jan 18, 2017
2 parents c216bee + d97f17d commit 3ceaa72
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
10 changes: 7 additions & 3 deletions VHbbAnalysis/Heppy/python/AdditionalBoost.py
Expand Up @@ -1028,8 +1028,10 @@ def process(self, event):


sj_w1_cal = Jet(sj_w1_uncal).__copy__()
self.jetReCalibratorAK4.correct(sj_w1_cal, rho, addCorr=True,addShifts=True, recalcMet = False)
if sj_w1_cal.pt()>0:
self.jetReCalibratorAK4.correct(sj_w1_cal, rho, addCorr=True,addShifts=True, recalcMet = False)

#print sj_w2.pt(), sj_w2.eta()

# Calibrate the subjets: W2
sj_w2_uncal = Jet(sj_w2)
Expand All @@ -1038,7 +1040,8 @@ def process(self, event):
sj_w2_uncal._rawFactorMultiplier =1.

sj_w2_cal = Jet(sj_w2_uncal).__copy__()
self.jetReCalibratorAK4.correct(sj_w2_cal, rho, addCorr=True,addShifts=True, recalcMet = False)
if sj_w2_cal.pt()>0:
self.jetReCalibratorAK4.correct(sj_w2_cal, rho, addCorr=True,addShifts=True, recalcMet = False)

# Calibrate the subjets: NonW
sj_nonw_uncal = Jet(sj_nonw)
Expand All @@ -1047,7 +1050,8 @@ def process(self, event):
sj_nonw_uncal._rawFactorMultiplier =1.

sj_nonw_cal = Jet(sj_nonw_uncal).__copy__()
self.jetReCalibratorAK4.correct(sj_nonw_cal, rho, addCorr=True,addShifts=True, recalcMet = False)
if sj_nonw_cal.pt()>0:
self.jetReCalibratorAK4.correct(sj_nonw_cal, rho, addCorr=True,addShifts=True, recalcMet = False)

# Do all subjets pass the JetID requirements
event.httCandidates[i].subjetIDPassed = all([passesJetId(x) for x in [sj_w1_cal, sj_w2_cal, sj_nonw_cal]])
Expand Down
6 changes: 3 additions & 3 deletions VHbbAnalysis/Heppy/python/vhbbobj.py
Expand Up @@ -479,7 +479,7 @@
NTupleVariable("sjW1masscal", lambda x : x.sjW1masscal, help = "Leading W Subjet mass (calibrated)"),
NTupleVariable("sjW1mass", lambda x : x.sjW1mass, help = "Leading W Subjet mass"),
NTupleVariable("sjW1btag", lambda x : x.sjW1btag, help = "Leading W Subjet btag"),
NTupleVariable("sjW1corr", lambda x : x.sjW1.corr),
NTupleVariable("sjW1corr", lambda x : x.sjW1.corr if hasattr(x, "corr") else -1. ),
# Second W Subjet (pt)
NTupleVariable("sjW2ptcal", lambda x : x.sjW2ptcal,help = "Second Subjet pT (calibrated)"),
NTupleVariable("sjW2pt", lambda x : x.sjW2pt, help = "Second Subjet pT"),
Expand All @@ -488,7 +488,7 @@
NTupleVariable("sjW2masscal", lambda x : x.sjW2masscal, help = "Second Subjet mass (calibrated)"),
NTupleVariable("sjW2mass", lambda x : x.sjW2mass, help = "Second Subjet mass"),
NTupleVariable("sjW2btag", lambda x : x.sjW2btag, help = "Second Subjet btag"),
NTupleVariable("sjW2corr", lambda x : x.sjW2.corr),
NTupleVariable("sjW2corr", lambda x : x.sjW2.corr if hasattr(x, "corr") else -1.),
# Non-W Subjet
NTupleVariable("sjNonWptcal",lambda x : x.sjNonWptcal,help = "Non-W Subjet pT (calibrated)"),
NTupleVariable("sjNonWpt", lambda x : x.sjNonWpt, help = "Non-W Subjet pT"),
Expand All @@ -497,7 +497,7 @@
NTupleVariable("sjNonWmasscal", lambda x : x.sjNonWmasscal, help = "Non-W Subjet mass (calibrated)"),
NTupleVariable("sjNonWmass", lambda x : x.sjNonWmass, help = "Non-W Subjet mass"),
NTupleVariable("sjNonWbtag", lambda x : x.sjNonWbtag, help = "Non-W Subjet btag"),
NTupleVariable("sjNonWcorr", lambda x : x.sjNonW.corr),
NTupleVariable("sjNonWcorr", lambda x : x.sjNonW.corr if hasattr(x, "corr") else -1.),
])


Expand Down

0 comments on commit 3ceaa72

Please sign in to comment.