53 srcMuons_(cfg.getParameter<edm::
InputTag>(
"srcMuons"))
55 for (
typename std::vector<todoListEntryType>::const_iterator todoItem =
todoList_.begin();
56 todoItem !=
todoList_.end(); ++todoItem ) {
57 produces<MuonTrackLinksCollection>(todoItem->srcTracks_.instance());
68 for (
typename std::vector<todoListEntryType>::const_iterator todoItem =
todoList_.begin();
69 todoItem !=
todoList_.end(); ++todoItem ) {
72 for ( std::map<reco::TrackRef, reco::TrackRef>::const_iterator cleanedToUncleanedTrackAssociation = todoItem->trackRefMap_.begin();
73 cleanedToUncleanedTrackAssociation != todoItem->trackRefMap_.end(); ++cleanedToUncleanedTrackAssociation ) {
75 double dRmatch = 1.e+3;
76 for ( reco::MuonCollection::const_iterator
muon = muons->begin();
78 if (
muon->globalTrack().isNull() )
continue;
79 if (
muon->globalTrack() == cleanedToUncleanedTrackAssociation->second ) {
80 matchedMuon = &(*muon);
84 double dR =
reco::deltaR(
muon->globalTrack()->eta(),
muon->globalTrack()->phi(), cleanedToUncleanedTrackAssociation->second->eta(), cleanedToUncleanedTrackAssociation->second->phi());
85 if ( dR < 1.
e-2 && dR < dRmatch ) {
86 matchedMuon = &(*muon);
95 trackLink.
setGlobalTrack(cleanedToUncleanedTrackAssociation->first);
97 std::cout <<
"creating new MuonTrackLinks:" << std::endl;
102 trackLinks_cleaned->push_back(trackLink);
106 evt.
put(trackLinks_cleaned, todoItem->srcTracks_.instance());
reco::TrackRef trackerTrack() const
get the tracker's track which match with the stand alone muon tracks
virtual TrackRef innerTrack() const
~GlobalMuonTrackCleaner()
#define DEFINE_FWK_MODULE(type)
reco::TrackRef standAloneTrack() const
get the track built with the muon spectrometer alone
key_type key() const
Accessor for product key.
ProductID id() const
Accessor for product ID.
void setGlobalTrack(reco::TrackRef glb)
set the ref to combined track
void setTrackerTrack(reco::TrackRef tk)
set the ref to tracker's track
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
GlobalMuonTrackCleaner(const edm::ParameterSet &)
auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
std::vector< reco::MuonTrackLinks > MuonTrackLinksCollection
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
virtual TrackRef outerTrack() const
reference to Track reconstructed in the muon detector only
virtual void produceTrackExtras(edm::Event &, const edm::EventSetup &)
void setStandAloneTrack(reco::TrackRef sta)
set the ref to stand alone track
std::vector< todoListEntryType > todoList_
reco::TrackRef globalTrack() const
get the combined track