18 const unsigned int nAlgo = 5;
32 double prob[nAlgo] = {0., 0., 0., 0., 0.};
33 bool valid[nAlgo] = {
false,
false,
false,
false,
false};
38 for (
unsigned int i = 0;
i < nAlgo; ++
i)
39 if (refit[
i].
first.isNonnull())
40 if (refit[
i].
first->ptError() / refit[
i].first->pt() < dptmin)
41 dptmin = refit[
i].
first->ptError() / refit[
i].first->pt();
44 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() &&
51 (refit[
i].first->ptError() / refit[
i].first->pt() < dptcut || dptcut < 0))
65 else if (
prob[0] > 0.)
67 else if (
prob[2] > 0.)
69 else if (
prob[1] > 0.)
74 else if (
prob[1] > 0.)
76 else if (
prob[0] > 0.)
88 if (refit[3].
first->pt() > 0 && refit[4].first->pt() > 0 &&
89 (refit[4].first->ptError() / refit[4].first->pt() - refit[3].first->ptError() / refit[3].first->pt()) <= 0)
99 if (chosen == 4 && !
valid[4])
101 if (chosen == 3 && !
valid[3])
103 if (chosen == 2 && !
valid[2])
105 if (chosen == 1 && !
valid[1])
116 return refit[chosen];
124 if (nDOF > 0 &&
track->chi2() > 0) {
125 return -
log(TMath::Prob(
track->chi2(), nDOF));
151 const double delta = fabs(trackerTrack->qoverp() - combinedTrack->qoverp());
166 if (trackerTrack.
isNonnull() && trackerTrack->numberOfValidHits())
168 if (fmsTrack.
isNonnull() && fmsTrack->numberOfValidHits())
171 bool TKok = probTK > 0;
172 bool FMSok = probFMS > 0;
175 if (probFMS - probTK > tune)
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 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