36 LogTrace(
"Muon|RecoMuon|GlobalMuonProducer") <<
"constructor called" << endl;
50 updatedStaAssoMapToken =
64 auto mtl = std::make_unique<MuonTrackLoader>(trackLoaderParameters, iC, theService);
65 auto gmtb = std::make_unique<GlobalMuonTrajectoryBuilder>(trajectoryBuilderParameters, theService, iC);
67 theTrackFinder = std::make_unique<MuonTrackFinder>(
std::move(gmtb),
std::move(mtl), iC);
70 produces<reco::TrackCollection>().setBranchAlias(theAlias +
"Tracks");
71 produces<TrackingRecHitCollection>().setBranchAlias(theAlias +
"RecHits");
72 produces<reco::TrackExtraCollection>().setBranchAlias(theAlias +
"TrackExtras");
73 produces<vector<Trajectory> >().setBranchAlias(theAlias +
"Trajectories");
74 produces<TrajTrackAssociationCollection>().setBranchAlias(theAlias +
"TrajTrackMap");
75 produces<reco::MuonTrackLinksCollection>().setBranchAlias(theAlias +
"s");
82 LogTrace(
"Muon|RecoMuon|GlobalMuonProducer") <<
"destructor called" << endl;
91 const string metname =
"Muon|RecoMuon|GlobalMuonProducer";
96 theService->update(eventSetup);
100 event.getByToken(staMuonsToken, staMuons);
104 LogTrace(
metname) <<
"Taking " << staMuons->size() <<
" Stand Alone Muons " << endl;
106 vector<MuonTrajectoryBuilder::TrackCand> staTrackCands;
112 if (
event.getByToken(staMuonsTrajToken, staMuonsTraj) &&
event.getByToken(staAssoMapToken, staAssoMap) &&
113 event.getByToken(updatedStaAssoMapToken, updatedStaAssoMap)) {
120 if (theSTACollectionLabel.instance() ==
"UpdatedAtVtx") {
121 iEnd = updatedStaAssoMap->
end();
122 iii = updatedStaAssoMap->
find(it->val);
124 tkUpdated = (*updatedStaAssoMap)[it->val];
128 ((tkUpdated.
isNonnull() && tkRegular.
isNonnull()) && ((tkUpdated->eta() * tkRegular->eta()) < 0)) ? -1 : 1;
134 tkCand.first = &*traj;
135 staTrackCands.push_back(tkCand);
141 staTrackCands.push_back(staCand);
145 theTrackFinder->reconstruct(staTrackCands,
event, eventSetup);
148 <<
"================================" << endl