36 LogTrace(
"Muon|RecoMuon|GlobalMuonProducer") <<
"constructor called" << endl;
41 trajectoryBuilderParameters.
addParameter<
InputTag>(
"TrackerCollectionLabel", trackCollectionTag);
43 trajectoryBuilderParameters.
addParameter<
InputTag>(
"VertexCollectionLabel", vertexCollectionTag);
44 bool selectHighPurity_ = parameterSet.
getParameter<
bool>(
"selectHighPurity");
45 trajectoryBuilderParameters.
addParameter<
bool>(
"selectHighPurity", selectHighPurity_);
49 staMuonsToken = consumes<reco::TrackCollection>(parameterSet.
getParameter<
InputTag>(
"MuonCollectionLabel"));
54 updatedStaAssoMapToken =
68 auto mtl = std::make_unique<MuonTrackLoader>(trackLoaderParameters, iC, theService);
69 auto gmtb = std::make_unique<GlobalMuonTrajectoryBuilder>(trajectoryBuilderParameters, theService, iC);
71 theTrackFinder = std::make_unique<MuonTrackFinder>(
std::move(gmtb),
std::move(mtl), iC);
74 produces<reco::TrackCollection>().setBranchAlias(theAlias +
"Tracks");
75 produces<TrackingRecHitCollection>().setBranchAlias(theAlias +
"RecHits");
76 produces<reco::TrackExtraCollection>().setBranchAlias(theAlias +
"TrackExtras");
77 produces<vector<Trajectory> >().setBranchAlias(theAlias +
"Trajectories");
78 produces<TrajTrackAssociationCollection>().setBranchAlias(theAlias +
"TrajTrackMap");
79 produces<reco::MuonTrackLinksCollection>().setBranchAlias(theAlias +
"s");
86 LogTrace(
"Muon|RecoMuon|GlobalMuonProducer") <<
"destructor called" << endl;
95 const string metname =
"Muon|RecoMuon|GlobalMuonProducer";
96 LogTrace(metname) << endl << endl << endl;
97 LogTrace(metname) <<
"Global Muon Reconstruction started" << endl;
100 theService->update(eventSetup);
104 event.getByToken(staMuonsToken, staMuons);
108 LogTrace(metname) <<
"Taking " << staMuons->size() <<
" Stand Alone Muons " << endl;
110 vector<MuonTrajectoryBuilder::TrackCand> staTrackCands;
116 if (event.
getByToken(staMuonsTrajToken, staMuonsTraj) &&
event.getByToken(staAssoMapToken, staAssoMap) &&
117 event.getByToken(updatedStaAssoMapToken, updatedStaAssoMap)) {
124 if (theSTACollectionLabel.instance() ==
"UpdatedAtVtx") {
125 iEnd = updatedStaAssoMap->end();
126 iii = updatedStaAssoMap->find(it->val);
128 tkUpdated = (*updatedStaAssoMap)[it->val];
132 ((tkUpdated.
isNonnull() && tkRegular.
isNonnull()) && ((tkUpdated->eta() * tkRegular->eta()) < 0)) ? -1 : 1;
138 tkCand.first = &*traj;
139 staTrackCands.push_back(tkCand);
145 staTrackCands.push_back(staCand);
149 theTrackFinder->reconstruct(staTrackCands, event, eventSetup);
152 <<
"================================" << 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]