CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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::TrackRef
TrackCand
 
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::TrackCollection
reconstruct (const edm::Handle< edm::View< TrajectorySeed > > &, edm::Event &)
 reconstruct standalone tracks starting from a collection of seeds More...
 
void reconstruct (const std::vector< TrackCand > &, edm::Event &)
 
virtual ~MuonTrackFinder ()
 destructor More...
 

Private Member Functions

edm::OrphanHandle
< reco::TrackCollection
load (const TrajectoryContainer &, edm::Event &)
 convert the trajectories into tracks and load them in to the event More...
 
void load (const CandidateContainer &, edm::Event &)
 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 26 of file MuonTrackFinder.h.

Member Typedef Documentation

Definition at line 31 of file MuonTrackFinder.h.

Definition at line 32 of file MuonTrackFinder.h.

Definition at line 30 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 29 of file MuonTrackFinder.cc.

30  :
31  theTrajBuilder(ConcreteMuonTrajectoryBuilder),
33  theTrackLoader(trackLoader) {
34 }
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 37 of file MuonTrackFinder.cc.

39  :
40  theTrajBuilder(ConcreteMuonTrajectoryBuilder),
41  theTrajCleaner(cleaner),
42  theTrackLoader(trackLoader) {
43 }
MuonTrackLoader * theTrackLoader
MuonTrajectoryBuilder * theTrajBuilder
MuonTrajectoryCleaner * theTrajCleaner
MuonTrackFinder::~MuonTrackFinder ( )
virtual

destructor

Definition at line 46 of file MuonTrackFinder.cc.

References LogTrace, theTrackLoader, theTrajBuilder, and theTrajCleaner.

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

Member Function Documentation

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

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

Definition at line 62 of file MuonTrackFinder.cc.

References MuonTrackLoader::loadTracks(), and theTrackLoader.

Referenced by reconstruct().

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

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

Definition at line 69 of file MuonTrackFinder.cc.

References MuonTrackLoader::loadTracks(), and theTrackLoader.

70  {
71 
72  theTrackLoader->loadTracks(muonCands, event);
73 
74 }
MuonTrackLoader * theTrackLoader
edm::OrphanHandle< reco::TrackCollection > loadTracks(const TrajectoryContainer &, edm::Event &, const std::string &="", bool=true)
Convert the trajectories into tracks and load the tracks in the event.
edm::OrphanHandle< reco::TrackCollection > MuonTrackFinder::reconstruct ( const edm::Handle< edm::View< TrajectorySeed > > &  seeds,
edm::Event event 
)

reconstruct standalone tracks starting from a collection of seeds

Definition at line 78 of file MuonTrackFinder.cc.

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

Referenced by GlobalCosmicMuonProducer::produce().

79  {
80 
81  const string metname = "Muon|RecoMuon|MuonTrackFinder";
82  LogTrace(metname)<<"SA Recostruction starting from: "<<seeds->size()<<endl;
83 
84  // Percolate the event
85  setEvent(event);
86 
87  // Trajectory container
88  TrajectoryContainer muonTrajectories;
90  // reconstruct the trajectory
92  for(seed = seeds->begin();
93  seed != seeds->end(); ++seed, ++nSeed){
94  LogTrace(metname)<<"+++ New Seed +++"<<endl;
95  TrajectoryContainer muonTrajs_temp = theTrajBuilder->trajectories(*seed);
96  for(TrajectoryContainer::iterator it = muonTrajs_temp.begin();
97  it != muonTrajs_temp.end(); ++it){
98  (*it)->setSeedRef(seeds->refAt(nSeed));
99  muonTrajectories.push_back(*it);
100  }
101  }
102 
103  // clean the clone traj
104  LogTrace(metname)<<"Clean the trajectories container"<<endl;
105  if(theTrajCleaner) theTrajCleaner->clean(muonTrajectories, event); //used by reference...
106 
107  // convert the trajectories into tracks and load them in to the event
108  LogTrace(metname)
109  <<"Convert the trajectories into tracks and load them in to the event"<<endl;
110  return load(muonTrajectories,event);
111 
112 }
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:81
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
void clean(TrajectoryContainer &muonTrajectories, edm::Event &evt)
Clean the trajectories container, erasing the (worst) clone trajectory.
#define LogTrace(id)
MuonCandidate::TrajectoryContainer TrajectoryContainer
edm::OrphanHandle< reco::TrackCollection > load(const TrajectoryContainer &, edm::Event &)
convert the trajectories into tracks and load them in to the event
MuonTrajectoryBuilder * theTrajBuilder
MuonTrajectoryCleaner * theTrajCleaner
void MuonTrackFinder::reconstruct ( const std::vector< TrackCand > &  staCandColl,
edm::Event event 
)

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 116 of file MuonTrackFinder.cc.

References MuonTrajectoryCleaner::clean(), load(), LogTrace, metname, setEvent(), theTrajBuilder, theTrajCleaner, and MuonTrajectoryBuilder::trajectories().

117  {
118 
119  const string metname = "Muon|RecoMuon|MuonTrackFinder";
120 
121  // percolate the event
122  setEvent(event);
123 
124  // Muon Candidate container
125  CandidateContainer muonCandidates;
126 
127  // reconstruct the muon candidates
128  for (vector<TrackCand>::const_iterator staCand = staCandColl.begin(); staCand != staCandColl.end(); ++staCand) {
129  CandidateContainer muonCands_temp = theTrajBuilder->trajectories(*staCand);
130  muonCandidates.insert(muonCandidates.end(), muonCands_temp.begin(),muonCands_temp.end());
131  }
132 
133  // clean the cloned candidates
134  if(theTrajCleaner) theTrajCleaner->clean(muonCandidates);
135 
136  // convert the trajectories into staTracks and load them into the event
137  LogTrace(metname)<<"Load Muon Candidates into the event"<<endl;
138  load(muonCandidates,event);
139 
140 }
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
void clean(TrajectoryContainer &muonTrajectories, edm::Event &evt)
Clean the trajectories container, erasing the (worst) clone trajectory.
#define LogTrace(id)
edm::OrphanHandle< reco::TrackCollection > load(const TrajectoryContainer &, edm::Event &)
convert the trajectories into tracks and load them in to the event
MuonTrajectoryBuilder * theTrajBuilder
MuonTrajectoryCleaner * theTrajCleaner
MuonCandidate::CandidateContainer CandidateContainer
void MuonTrackFinder::setEvent ( const edm::Event event)
private

percolate the Event Setup

Definition at line 56 of file MuonTrackFinder.cc.

References MuonTrajectoryBuilder::setEvent(), and theTrajBuilder.

Referenced by reconstruct().

56  {
57  theTrajBuilder->setEvent(event);
58 }
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 74 of file MuonTrackFinder.h.

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

MuonTrajectoryBuilder* MuonTrackFinder::theTrajBuilder
private

Definition at line 70 of file MuonTrackFinder.h.

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

MuonTrajectoryCleaner* MuonTrackFinder::theTrajCleaner
private

Definition at line 72 of file MuonTrackFinder.h.

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