#include <GlobalMuonTrajectoryBuilder.h>
Public Member Functions | |
GlobalMuonTrajectoryBuilder (const edm::ParameterSet &, const MuonServiceProxy *) | |
constructor with Parameter Set and MuonServiceProxy | |
virtual void | setEvent (const edm::Event &) |
pass the Event to the algo at each event | |
MuonTrajectoryBuilder::CandidateContainer | trajectories (const TrackCand &) |
reconstruct trajectories from standalone and tracker only Tracks | |
~GlobalMuonTrajectoryBuilder () | |
destructor | |
Private Member Functions | |
std::vector< TrackCand > | makeTkCandCollection (const TrackCand &) |
make a TrackCand collection using tracker Track, Trajectory information | |
Private Attributes | |
edm::Handle < reco::TrackCollection > | allTrackerTracks |
edm::InputTag | theTkTrackLabel |
class to build muon trajectory
Definition at line 24 of file GlobalMuonTrajectoryBuilder.h.
GlobalMuonTrajectoryBuilder::GlobalMuonTrajectoryBuilder | ( | const edm::ParameterSet & | par, |
const MuonServiceProxy * | service | ||
) |
constructor with Parameter Set and MuonServiceProxy
Definition at line 58 of file GlobalMuonTrajectoryBuilder.cc.
References edm::ParameterSet::getParameter(), and theTkTrackLabel.
: GlobalTrajectoryBuilderBase(par, service) { theTkTrackLabel = par.getParameter<edm::InputTag>("TrackerCollectionLabel"); }
GlobalMuonTrajectoryBuilder::~GlobalMuonTrajectoryBuilder | ( | ) |
vector< GlobalMuonTrajectoryBuilder::TrackCand > GlobalMuonTrajectoryBuilder::makeTkCandCollection | ( | const TrackCand & | staCand | ) | [private, virtual] |
make a TrackCand collection using tracker Track, Trajectory information
Implements GlobalTrajectoryBuilderBase.
Definition at line 158 of file GlobalMuonTrajectoryBuilder.cc.
References allTrackerTracks, python::rootplot::argparse::category, GlobalTrajectoryBuilderBase::chooseRegionalTrackerTracks(), and position.
Referenced by trajectories().
{ const std::string category = "Muon|RecoMuon|GlobalMuonTrajectoryBuilder|makeTkCandCollection"; vector<TrackCand> tkCandColl; vector<TrackCand> tkTrackCands; for ( unsigned int position = 0; position != allTrackerTracks->size(); ++position ) { reco::TrackRef tkTrackRef(allTrackerTracks,position); TrackCand tkCand = TrackCand((Trajectory*)(0),tkTrackRef); tkTrackCands.push_back(tkCand); } tkCandColl = chooseRegionalTrackerTracks(staCand,tkTrackCands); return tkCandColl; }
void GlobalMuonTrajectoryBuilder::setEvent | ( | const edm::Event & | event | ) | [virtual] |
pass the Event to the algo at each event
Reimplemented from GlobalTrajectoryBuilderBase.
Definition at line 78 of file GlobalMuonTrajectoryBuilder.cc.
References allTrackerTracks, python::rootplot::argparse::category, LogDebug, and theTkTrackLabel.
{ const std::string category = "Muon|RecoMuon|GlobalMuonTrajectoryBuilder|setEvent"; GlobalTrajectoryBuilderBase::setEvent(event); // get tracker TrackCollection from Event event.getByLabel(theTkTrackLabel,allTrackerTracks); LogDebug(category) << " Found " << allTrackerTracks->size() << " tracker Tracks with label "<< theTkTrackLabel; }
MuonCandidate::CandidateContainer GlobalMuonTrajectoryBuilder::trajectories | ( | const TrackCand & | staCandIn | ) | [virtual] |
reconstruct trajectories from standalone and tracker only Tracks
Implements MuonTrajectoryBuilder.
Definition at line 95 of file GlobalMuonTrajectoryBuilder.cc.
References GlobalTrajectoryBuilderBase::build(), python::rootplot::argparse::category, LogTrace, makeTkCandCollection(), GlobalMuonTrackMatcher::match(), query::result, GlobalTrajectoryBuilderBase::thePtCut, and GlobalTrajectoryBuilderBase::trackMatcher().
{ const std::string category = "Muon|RecoMuon|GlobalMuonTrajectoryBuilder|trajectories"; // cut on muons with low momenta LogTrace(category) << " STA pt " << staCandIn.second->pt() << " rho " << staCandIn.second->innerMomentum().Rho() << " R " << staCandIn.second->innerMomentum().R() << " theCut " << thePtCut; // convert the STA track into a Trajectory if Trajectory not already present TrackCand staCand(staCandIn); vector<TrackCand> regionalTkTracks = makeTkCandCollection(staCand); LogTrace(category) << " Found " << regionalTkTracks.size() << " tracks within region of interest"; // match tracker tracks to muon track vector<TrackCand> trackerTracks = trackMatcher()->match(staCand, regionalTkTracks); LogTrace(category) << " Found " << trackerTracks.size() << " matching tracker tracks within region of interest"; if ( trackerTracks.empty() ) { if ( staCandIn.first == 0) delete staCand.first; return CandidateContainer(); } // build a combined tracker-muon MuonCandidate // // turn tkMatchedTracks into MuonCandidates // LogTrace(category) << " Turn tkMatchedTracks into MuonCandidates"; CandidateContainer tkTrajs; for (vector<TrackCand>::const_iterator tkt = trackerTracks.begin(); tkt != trackerTracks.end(); tkt++) { MuonCandidate* muonCand = new MuonCandidate( 0 ,staCand.second,(*tkt).second, 0); tkTrajs.push_back(muonCand); } if ( tkTrajs.empty() ) { LogTrace(category) << " tkTrajs empty"; if ( staCandIn.first == 0) delete staCand.first; return CandidateContainer(); } CandidateContainer result = build(staCand, tkTrajs); LogTrace(category) << " Found "<< result.size() << " GLBMuons from one STACand"; // free memory if ( staCandIn.first == 0) delete staCand.first; for( CandidateContainer::const_iterator it = tkTrajs.begin(); it != tkTrajs.end(); ++it) { if ( (*it)->trajectory() ) delete (*it)->trajectory(); if ( (*it)->trackerTrajectory() ) delete (*it)->trackerTrajectory(); if ( *it ) delete (*it); } tkTrajs.clear(); return result; }
Definition at line 49 of file GlobalMuonTrajectoryBuilder.h.
Referenced by makeTkCandCollection(), and setEvent().
Definition at line 47 of file GlobalMuonTrajectoryBuilder.h.
Referenced by GlobalMuonTrajectoryBuilder(), and setEvent().