36 LogTrace(
"Muon|RecoMuon|GlobalMuonProducer") <<
"constructor called" << endl;
41 trajectoryBuilderParameters.
addParameter<
InputTag>(
"TrackerCollectionLabel", trackCollectionTag);
45 staMuonsToken = consumes<reco::TrackCollection>(parameterSet.
getParameter<
InputTag>(
"MuonCollectionLabel"));
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";
92 LogTrace(metname) << endl << endl << endl;
93 LogTrace(metname) <<
"Global Muon Reconstruction started" << endl;
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
bool isNonnull() const
Checks for non-null.
std::pair< const Trajectory *, reco::TrackRef > TrackCand
friend struct const_iterator
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const std::string metname
key_type key() const
Accessor for product key.
void produce(edm::Event &, const edm::EventSetup &) override
reconstruct muons
ParameterSet const & parameterSet(StableProvenance const &provenance, ProcessHistory const &history)
void addParameter(std::string const &name, T const &value)
~GlobalMuonProducer() override
destructor
T getParameter(std::string const &) const
GlobalMuonProducer(const edm::ParameterSet &)
constructor with config
static int position[264][3]