diff --git a/plugins/HighPtMuonsInfo.cc b/plugins/HighPtMuonsInfo.cc index f350360c90a..164a7aeee06 100644 --- a/plugins/HighPtMuonsInfo.cc +++ b/plugins/HighPtMuonsInfo.cc @@ -40,6 +40,8 @@ class HighPtMuonsInfo : public edm::EDProducer { const std::vector & values, const std::string & label) const ; + reco::Muon::MuonTrackTypePair getMuonTrackTypePair(const reco::Muon & mu) const; + }; HighPtMuonsInfo::HighPtMuonsInfo(const edm::ParameterSet & iConfig) : @@ -69,11 +71,11 @@ HighPtMuonsInfo::produce(edm::Event & iEvent, const edm::EventSetup & iSetup) { const reco::Muon *mu1 = dynamic_cast(&*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(&*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(); @@ -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); diff --git a/python/common_variables_cff.py b/python/common_variables_cff.py index cbf1e6eac8d..1d85d606d31 100644 --- a/python/common_variables_cff.py +++ b/python/common_variables_cff.py @@ -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 && " +