Skip to content

Commit

Permalink
Merge pull request #14 from gpetruc/heppy_7_2_2_patch2
Browse files Browse the repository at this point in the history
Hi @gpetruc @arizzi, I will now start testing a bit, before doing the porting the other CMSSW releases and the pull requests for integration in the CMSSW release (72X and 73X). If you need heppy in another release, let me know.
  • Loading branch information
cbernet committed Jan 13, 2015
2 parents c493196 + 060ae79 commit b52430b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
5 changes: 3 additions & 2 deletions PhysicsTools/Heppy/python/analyzers/objects/PhotonAnalyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def process(self, event):
if not self.cfg_comp.isMC:
return True

if hasattr(event, 'genParticles'):
if self.cfg_ana.do_mc_match and hasattr(event, 'genParticles'):
self.matchPhotons(event)

return True
Expand All @@ -179,6 +179,7 @@ def process(self, event):
photons='slimmedPhotons',
ptMin = 20,
etaMax = 2.5,
gammaID = "PhotonCutBasedIDLoose"
gammaID = "PhotonCutBasedIDLoose",
do_mc_match = True,
)
)
1 change: 1 addition & 0 deletions PhysicsTools/Heppy/python/analyzers/objects/autophobj.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
# Extra muon ID working points
NTupleVariable("softMuonId", lambda x : x.muonID("POG_ID_Soft") if abs(x.pdgId())==13 else 1, int, help="Muon POG Soft id"),
NTupleVariable("pfMuonId", lambda x : x.muonID("POG_ID_Loose") if abs(x.pdgId())==13 else 1, int, help="Muon POG Loose id"),
NTupleVariable("mediumMuonId", lambda x : x.muonID("POG_ID_Medium") if abs(x.pdgId())==13 else 1, int, help="Muon POG Medium id"),
# Extra electron ID working points
NTupleVariable("eleCutId2012_full5x5", lambda x : (1*x.electronID("POG_Cuts_ID_2012_full5x5_Veto") + 1*x.electronID("POG_Cuts_ID_2012_full5x5_Loose") + 1*x.electronID("POG_Cuts_ID_2012_full5x5_Medium") + 1*x.electronID("POG_Cuts_ID_2012_full5x5_Tight")) if abs(x.pdgId()) == 11 else -1, int, help="Electron cut-based id (POG 2012, full5x5 shapes): 0=none, 1=veto, 2=loose, 3=medium, 4=tight"),
# Extra tracker-related variables
Expand Down
4 changes: 4 additions & 0 deletions PhysicsTools/Heppy/python/physicsobjects/Muon.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ def muonID(self, name, vertex=None):
self.numberOfMatchedStations()>1 and \
self.innerTrack().hitPattern().numberOfValidPixelHits()>0 and \
self.innerTrack().hitPattern().trackerLayersWithMeasurement() > 5
if name == "POG_ID_Medium":
if not self.looseId(): return False
goodGlb = self.physObj.isGlobalMuon() and self.physObj.globalTrack().normalizedChi2() < 3 and self.physObj.combinedQuality().chi2LocalPosition < 12 and self.physObj.combinedQuality().trkKink < 20;
return self.physObj.innerTrack().validFraction() >= 0.8 and self.physObj.segmentCompatibility() >= (0.303 if goodGlb else 0.451)
return self.physObj.muonID(name)

def mvaId(self):
Expand Down

0 comments on commit b52430b

Please sign in to comment.