Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heppy: jets and photons cleaning and met type1 with chs jets #249

Merged
merged 3 commits into from
Feb 13, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion PhysicsTools/Heppy/python/analyzers/objects/JetAnalyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,11 @@ def process(self, event):
## Clean Jets from photons
photons = []
if hasattr(event, 'selectedPhotons'):
photons = [ g for g in event.selectedPhotons ]
if self.cfg_ana.cleanJetsFromFirstPhoton:
photons = event.selectedPhotons[:1]
else:
photons = [ g for g in event.selectedPhotons ]

event.gamma_cleanJetsAll = cleanNearestJetOnly(event.cleanJetsAll, photons, self.jetGammaDR)
event.gamma_cleanJets = [j for j in event.gamma_cleanJetsAll if abs(j.eta()) < self.cfg_ana.jetEtaCentral ]
event.gamma_cleanJetsFwd = [j for j in event.gamma_cleanJetsAll if abs(j.eta()) >= self.cfg_ana.jetEtaCentral ]
Expand Down Expand Up @@ -329,6 +333,7 @@ def smearJets(self, event, jets):
shiftJEC = 0, # set to +1 or -1 to get +/-1 sigma shifts
smearJets = True,
shiftJER = 0, # set to +1 or -1 to get +/-1 sigma shifts
cleanJetsFromFirstPhoton = False,
cleanJetsFromTaus = False,
cleanJetsFromIsoTracks = False,
jecPath = ""
Expand Down
1 change: 1 addition & 0 deletions PhysicsTools/Heppy/python/analyzers/objects/METAnalyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ def makeMETs(self, event):

###https://github.com/cms-sw/cmssw/blob/CMSSW_7_2_X/DataFormats/PatCandidates/interface/MET.h
event.metraw = event.met.shiftedPt(12, 0)
event.metType1chs = event.met.shiftedPt(12, 1)

if self.cfg_ana.recalibrate and hasattr(event, 'deltaMetFromJetSmearing'):
px,py = event.met.px()+event.deltaMetFromJetSmearing[0], event.met.py()+event.deltaMetFromJetSmearing[1]
Expand Down