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();
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 ) {
98 evt.
getByLabel(todoItem->srcTracks_, trackToTrackMap);
100 for (
typename TrackToTrackMap::const_iterator
entry = trackToTrackMap->begin();
102 std::cout <<
"trackToTrackMap[" <<
entry->key.id() <<
":" <<
entry->key.key() <<
"] = " <<
entry->val.id() <<
":" <<
entry->val.key() << std::endl;
106 std::auto_ptr<TrackToTrackMap> trackToTrackMap_cleaned(
new TrackToTrackMap(globalMuons_cleaned, trackToTrackMap->refProd().val));
108 size_t numGlobalMuons_cleaned = globalMuons_cleaned->size();
109 for (
size_t iGlobalMuons_cleaned = 0; iGlobalMuons_cleaned < numGlobalMuons_cleaned; ++iGlobalMuons_cleaned ) {
110 reco::TrackRef globalMuonTrack_cleaned(globalMuons_cleaned, iGlobalMuons_cleaned);
112 std::cout <<
" globalMuon(cleaned = " << globalMuonTrack_cleaned.
id() <<
":" << globalMuonTrack_cleaned.
key() <<
"):"
113 <<
" Pt = " << globalMuonTrack_cleaned->pt() <<
", eta = " << globalMuonTrack_cleaned->eta() <<
", phi = " << globalMuonTrack_cleaned->phi() << std::endl;
115 bool isMatched =
false;
117 double dRmatch = 1.e+3;
118 matchMuonTracks(globalMuonTrack_cleaned, *trackToTrackMap, isMatched, tevMuonTrack_matched, dRmatch,
verbosity_);
121 std::cout <<
"--> adding trackToTrackMap[" << globalMuonTrack_cleaned.
id() <<
":" << globalMuonTrack_cleaned.
key() <<
"]"
122 <<
" = " << tevMuonTrack_matched.
id() <<
":" << tevMuonTrack_matched.
key() << std::endl;
124 trackToTrackMap_cleaned->insert(globalMuonTrack_cleaned, tevMuonTrack_matched);
127 <<
"Failed to find Track association for " << globalMuonTrack_cleaned.
id() <<
":" << globalMuonTrack_cleaned.
key() <<
"!!\n";
131 evt.
put(trackToTrackMap_cleaned, todoItem->srcTracks_.instance());
#define DEFINE_FWK_MODULE(type)
key_type key() const
Accessor for product key.
ProductID id() const
Accessor for product ID.
edm::InputTag srcGlobalMuons_cleaned_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
virtual void produceTrackExtras(edm::Event &, const edm::EventSetup &)
auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
bool isMatched(TrackingRecHit const &hit)
edm::AssociationMap< edm::OneToOne< reco::TrackCollection, reco::TrackCollection > > TrackToTrackMap
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
TeVMuonTrackCleaner(const edm::ParameterSet &)
std::vector< todoListEntryType > todoList_