53 srcGlobalMuons_cleaned_(cfg.getParameter<edm::InputTag>(
"srcGlobalMuons_cleaned"))
55 for (
typename std::vector<todoListEntryType>::const_iterator todoItem =
todoList_.begin();
56 todoItem !=
todoList_.end(); ++todoItem ) {
57 produces<TrackToTrackMap>(todoItem->srcTracks_.instance());
65 for (
typename TrackToTrackMap::const_iterator entry = trackToTrackMap.begin();
66 entry != trackToTrackMap.end(); ++entry ) {
68 double dR =
reco::deltaR(globalMuonTrack_uncleaned->eta(), globalMuonTrack_uncleaned->phi(), globalMuonTrack_cleaned->eta(), globalMuonTrack_cleaned->phi());
70 std::cout <<
"globalMuon(uncleaned = " << globalMuonTrack_uncleaned.
id() <<
":" << globalMuonTrack_uncleaned.
key() <<
"):"
71 <<
" Pt = " << globalMuonTrack_uncleaned->pt() <<
", eta = " << globalMuonTrack_uncleaned->eta() <<
", phi = " << globalMuonTrack_uncleaned->phi() <<
","
72 <<
" dR = " << dR << std::endl;
74 if ( dR < 1.
e-2 && dR < dRmatch ) {
76 tevMuonTrack_matched = entry->val;
91 <<
" productId = " << globalMuons_cleaned.
id() <<
"): #entries = " << globalMuons_cleaned->size() << std::endl;
94 for (
typename std::vector<todoListEntryType>::const_iterator todoItem =
todoList_.begin();
95 todoItem !=
todoList_.end(); ++todoItem ) {
96 std::auto_ptr<TrackToTrackMap> trackToTrackMap_cleaned(
new TrackToTrackMap());
99 evt.
getByLabel(todoItem->srcTracks_, trackToTrackMap);
101 for (
typename TrackToTrackMap::const_iterator entry = trackToTrackMap->begin();
102 entry != trackToTrackMap->end(); ++entry ) {
103 std::cout <<
"trackToTrackMap[" << entry->key.id() <<
":" << entry->key.key() <<
"] = " << entry->val.id() <<
":" << entry->val.key() << std::endl;
107 size_t numGlobalMuons_cleaned = globalMuons_cleaned->size();
108 for (
size_t iGlobalMuons_cleaned = 0; iGlobalMuons_cleaned < numGlobalMuons_cleaned; ++iGlobalMuons_cleaned ) {
109 reco::TrackRef globalMuonTrack_cleaned(globalMuons_cleaned, iGlobalMuons_cleaned);
111 std::cout <<
" globalMuon(cleaned = " << globalMuonTrack_cleaned.
id() <<
":" << globalMuonTrack_cleaned.
key() <<
"):"
112 <<
" Pt = " << globalMuonTrack_cleaned->pt() <<
", eta = " << globalMuonTrack_cleaned->eta() <<
", phi = " << globalMuonTrack_cleaned->phi() << std::endl;
114 bool isMatched =
false;
116 double dRmatch = 1.e+3;
117 matchMuonTracks(globalMuonTrack_cleaned, *trackToTrackMap, isMatched, tevMuonTrack_matched, dRmatch,
verbosity_);
120 std::cout <<
"--> adding trackToTrackMap[" << globalMuonTrack_cleaned.
id() <<
":" << globalMuonTrack_cleaned.
key() <<
"]"
121 <<
" = " << tevMuonTrack_matched.
id() <<
":" << tevMuonTrack_matched.
key() << std::endl;
123 trackToTrackMap_cleaned->insert(globalMuonTrack_cleaned, tevMuonTrack_matched);
126 <<
"Failed to find Track association for " << globalMuonTrack_cleaned.
id() <<
":" << globalMuonTrack_cleaned.
key() <<
"!!\n";
130 evt.
put(trackToTrackMap_cleaned, todoItem->srcTracks_.instance());
#define DEFINE_FWK_MODULE(type)
double deltaR(const T1 &t1, const T2 &t2)
edm::InputTag srcGlobalMuons_cleaned_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
virtual void produceTrackExtras(edm::Event &, const edm::EventSetup &)
bool isMatched(TrackingRecHit const &hit)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
TeVMuonTrackCleaner(const edm::ParameterSet &)
edm::AssociationMap< edm::OneToOne< reco::TrackCollection, reco::TrackCollection > > TrackToTrackMap
key_type key() const
Accessor for product key.
ProductID id() const
Accessor for product ID.
std::vector< todoListEntryType > todoList_