37 LogTrace(
"Muon|RecoMuon|GlobalMuonProducer") <<
"constructor called" << endl;
46 staMuonsToken=consumes<reco::TrackCollection>(parameterSet.
getParameter<
InputTag>(
"MuonCollectionLabel"));
48 staAssoMapToken=consumes<TrajTrackAssociationCollection>(parameterSet.
getParameter<
InputTag>(
"MuonCollectionLabel").
label());
49 updatedStaAssoMapToken=consumes<reco::TrackToTrackMap>(parameterSet.
getParameter<
InputTag>(
"MuonCollectionLabel").
label());
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");
84 LogTrace(
"Muon|RecoMuon|GlobalMuonProducer") <<
"destructor called" << endl;
85 if (theService)
delete theService;
86 if (theTrackFinder)
delete theTrackFinder;
95 const string metname =
"Muon|RecoMuon|GlobalMuonProducer";
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) &&
event.getByToken(updatedStaAssoMapToken,updatedStaAssoMap) ) {
124 if ( theSTACollectionLabel.instance() ==
"UpdatedAtVtx") {
125 iEnd = updatedStaAssoMap->
end();
126 iii = updatedStaAssoMap->
find(it->val);
127 if (iii != iEnd ) tkUpdated = (*updatedStaAssoMap)[it->val] ;
130 int etaFlip1 = ((tkUpdated.
isNonnull() && tkRegular.
isNonnull()) && ( (tkUpdated->eta() * tkRegular->eta() ) < 0)) ? -1 : 1;
135 if( traj->isValid() ) tkCand.first = &*traj ;
136 staTrackCands.push_back(tkCand);
142 staTrackCands.push_back(staCand);
146 theTrackFinder->reconstruct(staTrackCands, event, eventSetup);
150 <<
"================================" 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.
virtual void produce(edm::Event &, const edm::EventSetup &) override
reconstruct muons
void addParameter(std::string const &name, T const &value)
virtual ~GlobalMuonProducer()
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)