CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
MuonTrackFinder Class Reference

#include <MuonTrackFinder.h>

Public Types

typedef MuonCandidate::CandidateContainer CandidateContainer
 
typedef std::pair< const Trajectory *, reco::TrackRefTrackCand
 
typedef MuonCandidate::TrajectoryContainer TrajectoryContainer
 

Public Member Functions

 MuonTrackFinder (MuonTrajectoryBuilder *ConcreteMuonTrajectoryBuilder, MuonTrackLoader *trackLoader)
 Constructor, with default cleaner. For the STA reconstruction the trackLoader must have the propagator. More...
 
 MuonTrackFinder (MuonTrajectoryBuilder *ConcreteMuonTrajectoryBuilder, MuonTrackLoader *trackLoader, MuonTrajectoryCleaner *cleaner)
 Constructor, with user-defined cleaner. For the STA reconstruction the trackLoader must have the propagator. More...
 
edm::OrphanHandle< reco::TrackCollectionreconstruct (const edm::Handle< edm::View< TrajectorySeed > > &, edm::Event &, const edm::EventSetup &)
 reconstruct standalone tracks starting from a collection of seeds More...
 
void reconstruct (const std::vector< TrackCand > &, edm::Event &, const edm::EventSetup &)
 
virtual ~MuonTrackFinder ()
 destructor More...
 

Private Member Functions

edm::OrphanHandle< reco::TrackCollectionload (const TrajectoryContainer &, edm::Event &, const TrackerTopology &ttopo)
 convert the trajectories into tracks and load them in to the event More...
 
void load (const CandidateContainer &, edm::Event &, const TrackerTopology &ttopo)
 convert the trajectories into tracks and load them in to the event More...
 
void setEvent (const edm::Event &)
 percolate the Event Setup More...
 

Private Attributes

MuonTrackLoadertheTrackLoader
 
MuonTrajectoryBuildertheTrajBuilder
 
MuonTrajectoryCleanertheTrajCleaner
 

Detailed Description

Track finder for the Muon Reco

Author
R. Bellan - INFN Torino

Concrete Track finder for the Muon Reco

Author
R. Bellan - INFN Torino

Definition at line 27 of file MuonTrackFinder.h.

Member Typedef Documentation

Definition at line 32 of file MuonTrackFinder.h.

Definition at line 33 of file MuonTrackFinder.h.

Definition at line 31 of file MuonTrackFinder.h.

Constructor & Destructor Documentation

MuonTrackFinder::MuonTrackFinder ( MuonTrajectoryBuilder ConcreteMuonTrajectoryBuilder,
MuonTrackLoader trackLoader 
)

Constructor, with default cleaner. For the STA reconstruction the trackLoader must have the propagator.

Definition at line 32 of file MuonTrackFinder.cc.

33  :
34  theTrajBuilder(ConcreteMuonTrajectoryBuilder),
36  theTrackLoader(trackLoader) {
37 }
MuonTrackLoader * theTrackLoader
MuonTrajectoryBuilder * theTrajBuilder
MuonTrajectoryCleaner * theTrajCleaner
MuonTrackFinder::MuonTrackFinder ( MuonTrajectoryBuilder ConcreteMuonTrajectoryBuilder,
MuonTrackLoader trackLoader,
MuonTrajectoryCleaner cleaner 
)

Constructor, with user-defined cleaner. For the STA reconstruction the trackLoader must have the propagator.

Definition at line 40 of file MuonTrackFinder.cc.

42  :
43  theTrajBuilder(ConcreteMuonTrajectoryBuilder),
44  theTrajCleaner(cleaner),
45  theTrackLoader(trackLoader) {
46 }
MuonTrackLoader * theTrackLoader
MuonTrajectoryBuilder * theTrajBuilder
MuonTrajectoryCleaner * theTrajCleaner
MuonTrackFinder::~MuonTrackFinder ( )
virtual

destructor

Definition at line 49 of file MuonTrackFinder.cc.

References LogTrace, theTrackLoader, theTrajBuilder, and theTrajCleaner.

49  {
50 
51  LogTrace("Muon|RecoMuon|MuonTrackFinder")<<"MuonTrackFinder destructor called"<<endl;
52  delete theTrajBuilder;
53  delete theTrajCleaner;
54  delete theTrackLoader;
55 
56 }
MuonTrackLoader * theTrackLoader
#define LogTrace(id)
MuonTrajectoryBuilder * theTrajBuilder
MuonTrajectoryCleaner * theTrajCleaner

Member Function Documentation

edm::OrphanHandle< reco::TrackCollection > MuonTrackFinder::load ( const TrajectoryContainer trajectories,
edm::Event event,
const TrackerTopology ttopo 
)
private

convert the trajectories into tracks and load them in to the event

Definition at line 65 of file MuonTrackFinder.cc.

References MuonTrackLoader::loadTracks(), and theTrackLoader.

Referenced by reconstruct().

67  {
68 
69  return theTrackLoader->loadTracks(trajectories, event, ttopo);
70 }
edm::OrphanHandle< reco::TrackCollection > loadTracks(const TrajectoryContainer &, edm::Event &, const TrackerTopology &ttopo, const std::string &="", bool=true)
Convert the trajectories into tracks and load the tracks in the event.
MuonTrackLoader * theTrackLoader
void MuonTrackFinder::load ( const CandidateContainer muonCands,
edm::Event event,
const TrackerTopology ttopo 
)
private

convert the trajectories into tracks and load them in to the event

Definition at line 73 of file MuonTrackFinder.cc.

References MuonTrackLoader::loadTracks(), and theTrackLoader.

75  {
76 
77  theTrackLoader->loadTracks(muonCands, event, ttopo);
78 
79 }
edm::OrphanHandle< reco::TrackCollection > loadTracks(const TrajectoryContainer &, edm::Event &, const TrackerTopology &ttopo, const std::string &="", bool=true)
Convert the trajectories into tracks and load the tracks in the event.
MuonTrackLoader * theTrackLoader
edm::OrphanHandle< reco::TrackCollection > MuonTrackFinder::reconstruct ( const edm::Handle< edm::View< TrajectorySeed > > &  seeds,
edm::Event event,
const edm::EventSetup es 
)

reconstruct standalone tracks starting from a collection of seeds

Definition at line 83 of file MuonTrackFinder.cc.

References edm::View< T >::begin(), MuonTrajectoryCleaner::clean(), edm::View< T >::end(), edm::EventSetup::get(), load(), LogTrace, metname, SurveyInfoScenario_cff::seed, setEvent(), theTrajBuilder, theTrajCleaner, and MuonTrajectoryBuilder::trajectories().

Referenced by GlobalCosmicMuonProducer::produce().

85  {
86 
87  const string metname = "Muon|RecoMuon|MuonTrackFinder";
88  LogTrace(metname)<<"SA Recostruction starting from: "<<seeds->size()<<endl;
89 
90  // Percolate the event
91  setEvent(event);
92 
94  es.get<TrackerTopologyRcd>().get(httopo);
95 
96  // Trajectory container
97  TrajectoryContainer muonTrajectories;
99  // reconstruct the trajectory
101  for(seed = seeds->begin();
102  seed != seeds->end(); ++seed, ++nSeed){
103  LogTrace(metname)<<"+++ New Seed +++"<<endl;
104  TrajectoryContainer muonTrajs_temp = theTrajBuilder->trajectories(*seed);
105  for(TrajectoryContainer::iterator it = muonTrajs_temp.begin();
106  it != muonTrajs_temp.end(); ++it){
107  (*it)->setSeedRef(seeds->refAt(nSeed));
108  muonTrajectories.push_back(*it);
109  }
110  }
111 
112  // clean the clone traj
113  LogTrace(metname)<<"Clean the trajectories container"<<endl;
114  if(theTrajCleaner) theTrajCleaner->clean(muonTrajectories, event, seeds); //used by reference...
115 
116  // convert the trajectories into tracks and load them in to the event
117  LogTrace(metname)
118  <<"Convert the trajectories into tracks and load them in to the event"<<endl;
119  return load(muonTrajectories,event, *httopo);
120 
121 }
void clean(TrajectoryContainer &muonTrajectories, edm::Event &evt, const edm::Handle< edm::View< TrajectorySeed > > &seeds)
Clean the trajectories container, erasing the (worst) clone trajectory.
const std::string metname
uint16_t size_type
virtual TrajectoryContainer trajectories(const TrajectorySeed &)=0
return a container of the reconstructed trajectories compatible with a given seed ...
void setEvent(const edm::Event &)
percolate the Event Setup
edm::OrphanHandle< reco::TrackCollection > load(const TrajectoryContainer &, edm::Event &, const TrackerTopology &ttopo)
convert the trajectories into tracks and load them in to the event
#define LogTrace(id)
MuonCandidate::TrajectoryContainer TrajectoryContainer
const T & get() const
Definition: EventSetup.h:56
MuonTrajectoryBuilder * theTrajBuilder
MuonTrajectoryCleaner * theTrajCleaner
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:81
void MuonTrackFinder::reconstruct ( const std::vector< TrackCand > &  staCandColl,
edm::Event event,
const edm::EventSetup es 
)

reconstruct global tracks starting from a collection of standalone tracks and one of trakectories. If the latter is invalid, trajectories are refitted.

Definition at line 125 of file MuonTrackFinder.cc.

References MuonTrajectoryCleaner::clean(), edm::EventSetup::get(), load(), LogTrace, metname, QuarkoniaTrackSelector_cfi::muonCandidates, setEvent(), theTrajBuilder, theTrajCleaner, and MuonTrajectoryBuilder::trajectories().

127  {
128 
129  const string metname = "Muon|RecoMuon|MuonTrackFinder";
130 
131  // percolate the event
132  setEvent(event);
133 
135  es.get<TrackerTopologyRcd>().get(httopo);
136 
137  // Muon Candidate container
139 
140  // reconstruct the muon candidates
141  for (vector<TrackCand>::const_iterator staCand = staCandColl.begin(); staCand != staCandColl.end(); ++staCand) {
142  CandidateContainer muonCands_temp = theTrajBuilder->trajectories(*staCand);
143  muonCandidates.insert(muonCandidates.end(), muonCands_temp.begin(),muonCands_temp.end());
144  }
145 
146  // clean the cloned candidates
147  if(theTrajCleaner) theTrajCleaner->clean(muonCandidates);
148 
149  // convert the trajectories into staTracks and load them into the event
150  LogTrace(metname)<<"Load Muon Candidates into the event"<<endl;
151  load(muonCandidates,event, *httopo);
152 
153 }
void clean(TrajectoryContainer &muonTrajectories, edm::Event &evt, const edm::Handle< edm::View< TrajectorySeed > > &seeds)
Clean the trajectories container, erasing the (worst) clone trajectory.
const std::string metname
virtual TrajectoryContainer trajectories(const TrajectorySeed &)=0
return a container of the reconstructed trajectories compatible with a given seed ...
void setEvent(const edm::Event &)
percolate the Event Setup
edm::OrphanHandle< reco::TrackCollection > load(const TrajectoryContainer &, edm::Event &, const TrackerTopology &ttopo)
convert the trajectories into tracks and load them in to the event
#define LogTrace(id)
const T & get() const
Definition: EventSetup.h:56
MuonTrajectoryBuilder * theTrajBuilder
MuonTrajectoryCleaner * theTrajCleaner
MuonCandidate::CandidateContainer CandidateContainer
void MuonTrackFinder::setEvent ( const edm::Event event)
private

percolate the Event Setup

Definition at line 59 of file MuonTrackFinder.cc.

References MuonTrajectoryBuilder::setEvent(), and theTrajBuilder.

Referenced by reconstruct().

59  {
60  theTrajBuilder->setEvent(event);
61 }
virtual void setEvent(const edm::Event &event)=0
pass the Event to the algo at each event
MuonTrajectoryBuilder * theTrajBuilder

Member Data Documentation

MuonTrackLoader* MuonTrackFinder::theTrackLoader
private

Definition at line 76 of file MuonTrackFinder.h.

Referenced by load(), and ~MuonTrackFinder().

MuonTrajectoryBuilder* MuonTrackFinder::theTrajBuilder
private

Definition at line 72 of file MuonTrackFinder.h.

Referenced by reconstruct(), setEvent(), and ~MuonTrackFinder().

MuonTrajectoryCleaner* MuonTrackFinder::theTrajCleaner
private

Definition at line 74 of file MuonTrackFinder.h.

Referenced by reconstruct(), and ~MuonTrackFinder().