13 const double ptThreshold,
31 double prob[4] = {0.,0.,0.,0.};
32 bool valid[4] = {0,0,0,0};
37 for (
unsigned int i = 0;
i < 4; ++
i)
38 if (refit[
i].
first.isNonnull())
39 if (refit[
i].
first->ptError()/refit[
i].first->pt()<dptmin) dptmin = refit[
i].
first->ptError()/refit[
i].first->pt();
41 if (dptmin>dptcut) dptcut = dptmin+0.15;
44 for (
unsigned int i = 0;
i < 4; ++
i)
45 if (refit[
i].
first.isNonnull()){
47 if (refit[
i].
first->numberOfValidHits() && (refit[
i].first->ptError()/refit[
i].first->pt()<dptcut || dptcut<0))
61 if (prob[0] > 0.) chosen = 0;
62 else if (prob[2] > 0.) chosen = 2;
63 else if (prob[1] > 0.) chosen = 1;
65 if (prob[2] > 0.) chosen = 2;
66 else if (prob[1] > 0.) chosen = 1;
67 else if (prob[0] > 0.) chosen = 0;
76 if (prob[0] > 0. && prob[3] > 0. && (prob[3] - prob[0]) > tune1)
78 if (prob[2] > 0. && (prob[chosen] - prob[2]) > tune2)
82 if (chosen == 3 && !valid[3] ) chosen = 2;
83 if (chosen == 2 && !valid[2] ) chosen = 1;
84 if (chosen == 1 && !valid[1] ) chosen = 0;
87 if (valid[chosen] && refit[chosen].
first->pt() < ptThreshold && prob[0] > 0.)
return make_pair(trackerTrack,
reco::Muon::InnerTrack);
88 if (trackerTrack->pt() < ptThreshold && prob[0] > 0.)
return make_pair(trackerTrack,
reco::Muon::InnerTrack);
100 int nDOF = (int)track->ndof();
101 if ( nDOF > 0 && track->chi2()> 0) {
102 return -
log(TMath::Prob(track->chi2(), nDOF));
122 const double ptThreshold) {
125 if (combinedTrack->pt() < ptThreshold || trackerTrack->pt() < ptThreshold)
131 const double delta = fabs(trackerTrack->qoverp() - combinedTrack->qoverp());
132 const double threshold = nSigma * trackerTrack->qoverpError();
145 if (trackerTrack.
isNonnull() && trackerTrack->numberOfValidHits())
147 if (fmsTrack.
isNonnull() && fmsTrack->numberOfValidHits())
150 bool TKok = probTK > 0;
151 bool FMSok = probFMS > 0;
154 if (probFMS - probTK > tune)
175 else edm::LogError(
"MuonCocktails|muonBestTrack") <<
"TuneP configuration not known";
184 edm::LogError(
"MuonCocktails|muonBestTrack") <<
"Orphan best track this must not happend!";
reco::Muon::MuonTrackTypePair muonBestTrack(const reco::Muon &muon, reco::TunePType tunePType)
const_iterator end() const
last iterator over the map (read only)
virtual TrackRef innerTrack() const
bool isTrackerMuon() const
const_iterator find(const key_type &k) const
find element with specified reference key
bool isGlobalMuon() const
bool cocktailInputIsOK(const reco::TrackRef &combinedTrack, const reco::TrackRef &trackerTrack, const reco::TrackRef &tpfmsTrack, const reco::TrackRef &pickyTrack)
bool isStandAloneMuon() const
bool isNonnull() const
Checks for non-null.
reco::Muon::MuonTrackTypePair sigmaSwitch(const reco::TrackRef &combinedTrack, const reco::TrackRef &trackerTrack, const double nSigma=2., const double ptThreshold=200.)
reco::Muon::MuonTrackTypePair TMR(const reco::TrackRef &trackerTrack, const reco::TrackRef &fmsTrack, const double tune=4.)
virtual TrackRef outerTrack() const
reference to Track reconstructed in the muon detector only
virtual TrackRef combinedMuon() const
reference to a stand-alone muon Track
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
reco::TrackRef getTevRefitTrack(const reco::TrackRef &combinedTrack, const reco::TrackToTrackMap &map)
double trackProbability(const reco::TrackRef track)
reco::Muon::MuonTrackTypePair tevOptimized(const reco::TrackRef &combinedTrack, const reco::TrackRef &trackerTrack, const reco::TrackRef &tpfmsTrack, const reco::TrackRef &pickyTrack, const double ptThreshold=200., const double tune1=4., const double tune2=6., const double dptcut=-1.)
std::pair< TrackRef, Muon::MuonTrackType > MuonTrackTypePair