37 category_ =
"Muon|RecoMuon|CosmicMuon|CosmicMuonLinksProducer";
43 std::vector<edm::ParameterSet> theMapPSets = iConfig.
getParameter<std::vector<edm::ParameterSet> >(
"Maps");
44 for (std::vector<edm::ParameterSet>::const_iterator iMPS = theMapPSets.begin(); iMPS != theMapPSets.end(); iMPS++) {
50 theTrackLinks.push_back(make_pair(subTrackTag, parentTrackTag));
51 theTrackLinkNames.push_back(make_pair(sTag.
label(), pTag.label()));
53 LogDebug(category_) <<
"preparing map between " << sTag <<
" & " << pTag;
55 produces<reco::TrackToTrackMap>(mapname);
66 LogInfo(category_) <<
"Processing event number: " <<
iEvent.id();
68 theService->update(iSetup);
74 iLink != theTrackLinks.end();
79 labelsForToken(iLink->first, labels_first);
80 labelsForToken(iLink->second, labels_second);
81 LogDebug(category_) <<
"making map between " << labels_first.
module <<
" and " << labels_second.
module;
89 iEvent.getByToken((*iLink).first, subTracks);
90 iEvent.getByToken((*iLink).second, parentTracks);
92 ttmap = mapTracks(subTracks, parentTracks);
93 LogTrace(category_) <<
"Mapped: " << theTrackLinkNames[
counter].first <<
" " << subTracks->size() <<
" and "
94 << theTrackLinkNames[
counter].second <<
" " << parentTracks->size()
95 <<
", results: " << ttmap.
size() << endl;
97 iEvent.put(std::make_unique<reco::TrackToTrackMap>(ttmap), mapname);
106 for (
unsigned int position1 = 0; position1 != subTracks->size(); ++position1) {
107 TrackRef track1(subTracks, position1);
108 for (
unsigned int position2 = 0; position2 != parentTracks->size(); ++position2) {
109 TrackRef track2(parentTracks, position2);
111 LogTrace(category_) <<
"sharedHits " << shared <<
" track1 " << track1->found() <<
" track2 " << track2->found()
114 if (shared > (track1->found()) / 2)
115 map.insert(track1, track2);
126 if (!(*hit1)->isValid())
128 DetId id1 = (*hit1)->geographicalId();
131 LogTrace(category_) <<
"first ID " <<
id1.rawId() <<
" " << (*hit1)->localPosition() << endl;
132 GlobalPoint pos1 = theService->trackingGeometry()->idToDet(
id1)->surface().toGlobal((*hit1)->localPosition());
135 if (!(*hit2)->isValid())
138 DetId id2 = (*hit2)->geographicalId();
144 if (
id2.rawId() !=
id1.rawId())
147 GlobalPoint pos2 = theService->trackingGeometry()->idToDet(
id2)->surface().toGlobal((*hit2)->localPosition());
148 if ((pos1 - pos2).mag() < 10
e-5)