Skip to content

Commit

Permalink
add the high pT muon ID
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugues committed Oct 24, 2015
1 parent d4ea3b8 commit e57a905
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
27 changes: 25 additions & 2 deletions plugins/HighPtMuonsInfo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ class HighPtMuonsInfo : public edm::EDProducer {
const std::vector<float> & values,
const std::string & label) const ;

reco::Muon::MuonTrackTypePair getMuonTrackTypePair(const reco::Muon & mu) const;

};

HighPtMuonsInfo::HighPtMuonsInfo(const edm::ParameterSet & iConfig) :
Expand Down Expand Up @@ -69,11 +71,11 @@ HighPtMuonsInfo::produce(edm::Event & iEvent, const edm::EventSetup & iSetup) {

const reco::Muon *mu1 = dynamic_cast<const reco::Muon *>(&*d1.masterClone());
if (mu1 == 0) throw cms::Exception("CorruptData") << "First daughter of candidate is not a ShallowClone of a reco::Muon\n";
reco::Muon::MuonTrackTypePair tuneP1 = muon::tevOptimized(*mu1, 200, 40., 17., 0.25);
reco::Muon::MuonTrackTypePair tuneP1 = getMuonTrackTypePair(*mu1);

const reco::Muon *mu2 = dynamic_cast<const reco::Muon *>(&*d2.masterClone());
if (mu2 == 0) throw cms::Exception("CorruptData") << "Second daughter of candidate is not a ShallowClone of a reco::Muon\n";
reco::Muon::MuonTrackTypePair tuneP2 = muon::tevOptimized(*mu2, 200, 40., 17., 0.25);
reco::Muon::MuonTrackTypePair tuneP2 = getMuonTrackTypePair(*mu2);

// Momentum and relative uncertainty
pt[i] = tuneP2.first->pt();
Expand Down Expand Up @@ -116,6 +118,27 @@ HighPtMuonsInfo::writeValueMap(edm::Event &iEvent,
iEvent.put(valMap, label);
}

reco::Muon::MuonTrackTypePair
HighPtMuonsInfo::getMuonTrackTypePair(const reco::Muon & mu) const
{

reco::Muon::MuonTrackTypePair trackTypePair;

if (mu.tunePMuonBestTrack().isAvailable())
trackTypePair = std::make_pair(mu.tunePMuonBestTrack(),mu.tunePMuonBestTrackType());
else if(mu.innerTrack().isAvailable())
trackTypePair = std::make_pair(mu.innerTrack(),reco::Muon::InnerTrack);
else
trackTypePair = std::make_pair(mu.outerTrack(),reco::Muon::OuterTrack);

return trackTypePair;

}






#include "FWCore/Framework/interface/MakerMacros.h"
DEFINE_FWK_MODULE(HighPtMuonsInfo);
4 changes: 4 additions & 0 deletions python/common_variables_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@
"track.hitPattern.trackerLayersWithMeasurement > 5 && track.hitPattern.numberOfValidPixelHits > 0"),
Loose = cms.string("isLooseMuon()"),
Medium = cms.string("isPFMuon && innerTrack.validFraction >= 0.8 && ( isGlobalMuon && globalTrack.normalizedChi2 < 3 && combinedQuality.chi2LocalPosition < 12 && combinedQuality.trkKink < 20 && segmentCompatibility >= 0.303 || segmentCompatibility >= 0.451 )"),
HighPt = cms.string("isGlobalMuon && isTrackerMuon && globalTrack.hitPattern.numberOfValidMuonHits > 0 && "+
"numberOfMatchedStations > 1 && track.hitPattern.numberOfValidPixelHits > 0 && "+
"track.hitPattern.trackerLayersWithMeasurement > 5 && abs(dB) < 0.2 && "+
"(tunePMuonBestTrack.ptError / tunePMuonBestTrack.pt) < 0.3"),
HWWID = cms.string("( ((isGlobalMuon() && "
" globalTrack.normalizedChi2 <10 &&" +
" globalTrack.hitPattern.numberOfValidMuonHits > 0 && " +
Expand Down

0 comments on commit e57a905

Please sign in to comment.