35 LogTrace(
"Muon|RecoMuon|GlobalMuonProducer") <<
"constructor called" << endl;
44 staMuonsToken = consumes<reco::TrackCollection>(parameterSet.
getParameter<
InputTag>(
"MuonCollectionLabel"));
49 updatedStaAssoMapToken =
69 produces<reco::TrackCollection>().setBranchAlias(theAlias +
"Tracks");
70 produces<TrackingRecHitCollection>().setBranchAlias(theAlias +
"RecHits");
71 produces<reco::TrackExtraCollection>().setBranchAlias(theAlias +
"TrackExtras");
72 produces<vector<Trajectory> >().setBranchAlias(theAlias +
"Trajectories");
73 produces<TrajTrackAssociationCollection>().setBranchAlias(theAlias +
"TrajTrackMap");
74 produces<reco::MuonTrackLinksCollection>().setBranchAlias(theAlias +
"s");
81 LogTrace(
"Muon|RecoMuon|GlobalMuonProducer") <<
"destructor called" << endl;
85 delete theTrackFinder;
92 const string metname =
"Muon|RecoMuon|GlobalMuonProducer";
93 LogTrace(metname) << endl << endl << endl;
94 LogTrace(metname) <<
"Global Muon Reconstruction started" << endl;
97 theService->update(eventSetup);
101 event.getByToken(staMuonsToken, staMuons);
105 LogTrace(metname) <<
"Taking " << staMuons->size() <<
" Stand Alone Muons " << endl;
107 vector<MuonTrajectoryBuilder::TrackCand> staTrackCands;
113 if (event.
getByToken(staMuonsTrajToken, staMuonsTraj) &&
event.getByToken(staAssoMapToken, staAssoMap) &&
114 event.getByToken(updatedStaAssoMapToken, updatedStaAssoMap)) {
121 if (theSTACollectionLabel.instance() ==
"UpdatedAtVtx") {
122 iEnd = updatedStaAssoMap->
end();
123 iii = updatedStaAssoMap->
find(it->val);
125 tkUpdated = (*updatedStaAssoMap)[it->val];
129 ((tkUpdated.
isNonnull() && tkRegular.
isNonnull()) && ((tkUpdated->eta() * tkRegular->eta()) < 0)) ? -1 : 1;
135 tkCand.first = &*traj;
136 staTrackCands.push_back(tkCand);
142 staTrackCands.push_back(staCand);
146 theTrackFinder->reconstruct(staTrackCands, event, eventSetup);
149 <<
"================================" << endl
T getParameter(std::string const &) const
bool isNonnull() const
Checks for non-null.
std::pair< const Trajectory *, reco::TrackRef > TrackCand
friend struct const_iterator
const_iterator end() const
last iterator over the map (read only)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const std::string metname
const_iterator find(const key_type &k) const
find element with specified reference key
key_type key() const
Accessor for product key.
void produce(edm::Event &, const edm::EventSetup &) override
reconstruct muons
void addParameter(std::string const &name, T const &value)
~GlobalMuonProducer() override
destructor
GlobalMuonProducer(const edm::ParameterSet &)
constructor with config
static int position[264][3]
const_iterator begin() const
first iterator over the map (read only)
ParameterSet const & parameterSet(Provenance const &provenance)