32 if (trackerTrack.
isAvailable() && trackerTrack->numberOfValidHits())
34 if (fmsTrack != fmsMap.
end() && fmsTrack->
val->numberOfValidHits())
37 bool TKok = probTK > 0;
38 bool FMSok = probFMS > 0;
41 if (probFMS - probTK >
cut)
60 double delta = fabs(trackerTrack->qoverp() - combinedTrack->qoverp());
154 TMRcut(
cfg.getParameter<double>(
"TMRcut")),
166 produces<reco::MuonCollection>();
184 static const double muMass = 0.10566;
192 double p = newTrack.first->p();
193 p4.SetXYZT(newTrack.first->px(), newTrack.first->py(), newTrack.first->pz(),
sqrt(
p *
p +
muMass *
muMass));
196 mu->setCharge(newTrack.first->charge());
199 mu->setGlobalTrack(newTrack.first);
200 mu->setInnerTrack(tkTrack);
201 mu->setOuterTrack(muTrack);
202 mu->setBestTrack(newTrack.second);
214 bool ok = !
muons.failedToGet();
225 auto cands = std::make_unique<reco::MuonCollection>();
233 if (!
muon->isGlobalMuon())
258 if (tevTk.first.isNonnull())
271 if (
muon->globalTrack().isTransient())
272 last.setGlobalTrack(
muon->globalTrack());
273 if (
muon->innerTrack().isTransient())
274 last.setInnerTrack(
muon->innerTrack());
275 if (
muon->outerTrack().isTransient())
276 last.setOuterTrack(
muon->outerTrack());
281 <<
" not present in the event; producing empty collection";
reco::Muon::MuonTrackTypePair sigmaSwitch(const reco::Muon &muon, const double nSigma, const double ptThreshold)
edm::EDGetTokenT< reco::TrackToTrackMap > trackMapPickyToken_
#define DEFINE_FWK_MODULE(type)
~MuonsFromRefitTracksProducer() override
static double constexpr muMass
Muon mass [GeV].
edm::EDGetTokenT< reco::TrackToTrackMap > trackMapToken_
edm::Handle< reco::TrackToTrackMap > trackMapDefault
const_iterator find(const key_type &k) const
find element with specified reference key
edm::EDGetTokenT< reco::TrackToTrackMap > trackMapDefaultToken_
std::string tevMuonTracks
const_iterator end() const
last iterator over the map (read only)
edm::Handle< reco::TrackToTrackMap > trackMap
bool storeMatchMaps(const edm::Event &event)
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)
void produce(edm::Event &, const edm::EventSetup &) override
edm::Handle< reco::TrackToTrackMap > trackMapFirstHit
math::XYZPoint Point
point in the space
reco::Muon::MuonTrackTypePair tevOptimizedTMR(const reco::Muon &muon, const reco::TrackToTrackMap &fmsMap, const double cut)
MuonsFromRefitTracksProducer(const edm::ParameterSet &)
edm::Handle< reco::TrackToTrackMap > trackMapPicky
reco::Muon * cloneAndSwitchTrack(const reco::Muon &muon, const reco::Muon::MuonTrackTypePair &newTrack) const
edm::EDGetTokenT< edm::View< reco::Muon > > srcToken_
double trackProbability(const reco::TrackRef track)
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Log< level::Warning, false > LogWarning
std::pair< TrackRef, Muon::MuonTrackType > MuonTrackTypePair
math::XYZTLorentzVector LorentzVector
Lorentz vector.
edm::EDGetTokenT< reco::TrackToTrackMap > trackMapFirstHitToken_