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)
57 if (combinedTrack->pt() < ptThreshold || trackerTrack->pt() < ptThreshold)
60 double delta = fabs(trackerTrack->qoverp() - combinedTrack->qoverp());
61 double threshold = nSigma * trackerTrack->qoverpError();
149 fromTrackerTrack(cfg.getParameter<bool>(
"fromTrackerTrack")),
150 fromGlobalTrack(cfg.getParameter<bool>(
"fromGlobalTrack")),
151 tevMuonTracks(cfg.getParameter<std::
string>(
"tevMuonTracks")),
152 fromCocktail(cfg.getParameter<bool>(
"fromCocktail")),
153 fromTMR(cfg.getParameter<bool>(
"fromTMR")),
154 TMRcut(cfg.getParameter<double>(
"TMRcut")),
155 fromSigmaSwitch(cfg.getParameter<bool>(
"fromSigmaSwitch")),
156 nSigmaSwitch(cfg.getParameter<double>(
"nSigmaSwitch")),
157 ptThreshold(cfg.getParameter<double>(
"ptThreshold")) {
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));
225 auto cands = std::make_unique<reco::MuonCollection>();
229 for (muon = muons->begin(); muon != muons->end(); muon++) {
233 if (!muon->isGlobalMuon())
258 if (tevTk.first.isNonnull())
271 if (muon->globalTrack().isTransient())
273 if (muon->innerTrack().isTransient())
275 if (muon->outerTrack().isTransient())
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_
const_iterator end() const
last iterator over the map (read only)
virtual TrackRef innerTrack() const
#define DEFINE_FWK_MODULE(type)
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
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
Muon * clone() const override
create a clone
Log< level::Warning, false > LogWarning
std::pair< TrackRef, Muon::MuonTrackType > MuonTrackTypePair
math::XYZTLorentzVector LorentzVector
Lorentz vector.
void setP4(const LorentzVector &p4) final
set 4-momentum
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