31 if (trackerTrack.
isAvailable() && trackerTrack->numberOfValidHits())
33 if (fmsTrack != fmsMap.
end() && fmsTrack->
val->numberOfValidHits())
36 bool TKok = probTK > 0;
37 bool FMSok = probFMS > 0;
40 if (probFMS - probTK > cut)
57 if (combinedTrack->pt() < ptThreshold || trackerTrack->pt() <
ptThreshold)
60 double delta = fabs(trackerTrack->qoverp() - combinedTrack->qoverp());
61 double threshold = nSigma * trackerTrack->qoverpError();
153 :
src(cfg.getParameter<
edm::InputTag>(
"src")),
159 TMRcut(cfg.getParameter<double>(
"TMRcut")),
162 ptThreshold(cfg.getParameter<double>(
"ptThreshold"))
176 produces<reco::MuonCollection>();
196 static const double muMass = 0.10566;
204 double p = newTrack.first->p();
205 p4.SetXYZT(newTrack.first->px(), newTrack.first->py(), newTrack.first->pz(),
206 sqrt(p*p + muMass*muMass));
238 auto cands = std::make_unique<reco::MuonCollection>();
242 for (muon = muons->begin(); muon != muons->end(); muon++) {
246 if (!muon->isGlobalMuon())
continue;
271 if (tevTk.first.isNonnull())
285 if (muon->globalTrack().isTransient())
287 if (muon->innerTrack().isTransient())
289 if (muon->outerTrack().isTransient())
297 <<
" 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_
const_iterator end() const
last iterator over the map (read only)
virtual TrackRef innerTrack() const
reco::Muon * cloneAndSwitchTrack(const reco::Muon &muon, const reco::Muon::MuonTrackTypePair &newTrack) const
const_iterator find(const key_type &k) const
find element with specified reference key
~MuonsFromRefitTracksProducer() override
static double constexpr muMass
Muon mass [GeV].
edm::EDGetTokenT< reco::TrackToTrackMap > trackMapToken_
edm::Handle< reco::TrackToTrackMap > trackMapDefault
void setVertex(const Point &vertex) override
set vertex
edm::EDGetTokenT< reco::TrackToTrackMap > trackMapDefaultToken_
std::string tevMuonTracks
edm::Handle< reco::TrackToTrackMap > trackMap
void setCharge(Charge q) final
set electric charge
virtual void setInnerTrack(const TrackRef &t)
set reference to Track
#define DEFINE_FWK_MODULE(type)
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)
std::unique_ptr< ViewBase > clone() const
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)
virtual TrackRef outerTrack() const
reference to Track reconstructed in the muon detector only
MuonsFromRefitTracksProducer(const edm::ParameterSet &)
edm::Handle< reco::TrackToTrackMap > trackMapPicky
edm::EDGetTokenT< edm::View< reco::Muon > > srcToken_
virtual void setOuterTrack(const TrackRef &t)
set reference to Track
double trackProbability(const reco::TrackRef track)
virtual void setBestTrack(MuonTrackType muonType)
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
std::pair< TrackRef, Muon::MuonTrackType > MuonTrackTypePair
math::XYZTLorentzVector LorentzVector
Lorentz vector.
void setP4(const LorentzVector &p4) final
set 4-momentum
Muon * clone() const override
create a clone
virtual void setGlobalTrack(const TrackRef &t)
set reference to Track
edm::EDGetTokenT< reco::TrackToTrackMap > trackMapFirstHitToken_
virtual TrackRef globalTrack() const
reference to Track reconstructed in both tracked and muon detector