18 const unsigned int nAlgo=5;
34 double prob[nAlgo] = {0.,0.,0.,0.,0.};
35 bool valid[nAlgo] = {
false,
false,
false,
false,
false};
40 for (
unsigned int i = 0;
i < nAlgo; ++
i)
41 if (refit[
i].
first.isNonnull())
42 if (refit[
i].
first->ptError()/refit[
i].first->pt()<dptmin) dptmin = refit[
i].
first->ptError()/refit[
i].first->pt();
44 if (dptmin>dptcut) dptcut = dptmin+0.15;
47 for (
unsigned int i = 0;
i < nAlgo; ++
i)
48 if (refit[
i].
first.isNonnull()){
50 if (refit[
i].
first->numberOfValidHits() && (refit[
i].first->ptError()/refit[
i].first->pt()<dptcut || dptcut<0))
64 if (prob[4] > 0.) chosen = 4;
65 else if (prob[0] > 0.) chosen = 0;
66 else if (prob[2] > 0.) chosen = 2;
67 else if (prob[1] > 0.) chosen = 1;
69 if (prob[2] > 0.) chosen = 2;
70 else if (prob[1] > 0.) chosen = 1;
71 else if (prob[0] > 0.) chosen = 0;
81 if (prob[4]>0. && prob[3]>0.) {
82 if(refit[3].
first->pt()>0 && refit[4].first->pt()>0 &&
83 (refit[4].first->ptError()/refit[4].first->pt()-refit[3].first->ptError()/refit[3].first->pt())<=0)
87 if (prob[0] > 0. && prob[chosen] > 0. && (prob[chosen] - prob[0]) > tune1)
89 if (prob[2] > 0. && (prob[chosen] - prob[2]) > tune2)
93 if (chosen == 4 && !valid[4] ) chosen = 3;
94 if (chosen == 3 && !valid[3] ) chosen = 2;
95 if (chosen == 2 && !valid[2] ) chosen = 1;
96 if (chosen == 1 && !valid[1] ) chosen = 0;
99 if (valid[chosen] && refit[chosen].
first->pt() < ptThreshold && prob[0] > 0.)
return make_pair(trackerTrack,
reco::Muon::InnerTrack);
100 if (trackerTrack->pt() < ptThreshold && prob[0] > 0.)
return make_pair(trackerTrack,
reco::Muon::InnerTrack);
104 return refit[chosen];
112 int nDOF = (
int)track->ndof();
113 if ( nDOF > 0 && track->chi2()> 0) {
114 return -
log(TMath::Prob(track->chi2(), nDOF));
137 if (combinedTrack->pt() < ptThreshold || trackerTrack->pt() <
ptThreshold)
143 const double delta = fabs(trackerTrack->qoverp() - combinedTrack->qoverp());
144 const double threshold = nSigma * trackerTrack->qoverpError();
157 if (trackerTrack.
isNonnull() && trackerTrack->numberOfValidHits())
159 if (fmsTrack.
isNonnull() && fmsTrack->numberOfValidHits())
162 bool TKok = probTK > 0;
163 bool FMSok = probFMS > 0;
166 if (probFMS - probTK > tune)
bool isNonnull() const
Checks for non-null.
friend struct const_iterator
const_iterator end() const
last iterator over the map (read only)
const_iterator find(const key_type &k) const
find element with specified reference key
reco::Muon::MuonTrackTypePair sigmaSwitch(const reco::TrackRef &combinedTrack, const reco::TrackRef &trackerTrack, const double nSigma=2., const double ptThreshold=200.)
reco::Muon::MuonTrackTypePair tevOptimized(const reco::TrackRef &combinedTrack, const reco::TrackRef &trackerTrack, const reco::TrackRef &tpfmsTrack, const reco::TrackRef &pickyTrack, const reco::TrackRef &dytTrack, const double ptThreshold=200., const double tune1=17., const double tune2=40., const double dptcut=0.25)
reco::Muon::MuonTrackTypePair TMR(const reco::TrackRef &trackerTrack, const reco::TrackRef &fmsTrack, const double tune=4.)
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)
std::pair< TrackRef, Muon::MuonTrackType > MuonTrackTypePair