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

Date:
2010/03/02 14:04:18
Revision:
1.25
Author
R. Bellan - INFN Torino

Concrete Track finder for the Muon Reco

Date:
2010/03/24 19:50:19
Revision:
1.40
Author
R. Bellan - INFN Torino

Definition at line 28 of file MuonTrackFinder.h.

Member Typedef Documentation

Definition at line 33 of file MuonTrackFinder.h.

Definition at line 34 of file MuonTrackFinder.h.

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

32  :
33  theTrajBuilder(ConcreteMuonTrajectoryBuilder),
35  theTrackLoader(trackLoader) {
36 }
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 39 of file MuonTrackFinder.cc.

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

destructor

Definition at line 48 of file MuonTrackFinder.cc.

References LogTrace, theTrackLoader, theTrajBuilder, and theTrajCleaner.

48  {
49 
50  LogTrace("Muon|RecoMuon|MuonTrackFinder")<<"MuonTrackFinder destructor called"<<endl;
51  delete theTrajBuilder;
52  delete theTrajCleaner;
53  delete theTrackLoader;
54 
55 }
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 64 of file MuonTrackFinder.cc.

References MuonTrackLoader::loadTracks(), and theTrackLoader.

Referenced by reconstruct().

65  {
66 
67  return theTrackLoader->loadTracks(trajectories, event);
68 }
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 71 of file MuonTrackFinder.cc.

References MuonTrackLoader::loadTracks(), and theTrackLoader.

72  {
73 
74  theTrackLoader->loadTracks(muonCands, event);
75 
76 }
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 80 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().

81  {
82 
83  const string metname = "Muon|RecoMuon|MuonTrackFinder";
84  LogTrace(metname)<<"SA Recostruction starting from: "<<seeds->size()<<endl;
85 
86  // Percolate the event
87  setEvent(event);
88 
89  // Trajectory container
90  TrajectoryContainer muonTrajectories;
92  // reconstruct the trajectory
94  for(seed = seeds->begin();
95  seed != seeds->end(); ++seed, ++nSeed){
96  LogTrace(metname)<<"+++ New Seed +++"<<endl;
97  TrajectoryContainer muonTrajs_temp = theTrajBuilder->trajectories(*seed);
98  for(TrajectoryContainer::iterator it = muonTrajs_temp.begin();
99  it != muonTrajs_temp.end(); ++it){
100  (*it)->setSeedRef(seeds->refAt(nSeed));
101  muonTrajectories.push_back(*it);
102  }
103  }
104 
105  // clean the clone traj
106  LogTrace(metname)<<"Clean the trajectories container"<<endl;
107  if(theTrajCleaner) theTrajCleaner->clean(muonTrajectories, event); //used by reference...
108 
109  // convert the trajectories into tracks and load them in to the event
110  LogTrace(metname)
111  <<"Convert the trajectories into tracks and load them in to the event"<<endl;
112  return load(muonTrajectories,event);
113 
114 }
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 118 of file MuonTrackFinder.cc.

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

119  {
120 
121  const string metname = "Muon|RecoMuon|MuonTrackFinder";
122 
123  // percolate the event
124  setEvent(event);
125 
126  // Muon Candidate container
127  CandidateContainer muonCandidates;
128 
129  // reconstruct the muon candidates
130  for (vector<TrackCand>::const_iterator staCand = staCandColl.begin(); staCand != staCandColl.end(); ++staCand) {
131  CandidateContainer muonCands_temp = theTrajBuilder->trajectories(*staCand);
132  muonCandidates.insert(muonCandidates.end(), muonCands_temp.begin(),muonCands_temp.end());
133  }
134 
135  // clean the cloned candidates
136  if(theTrajCleaner) theTrajCleaner->clean(muonCandidates);
137 
138  // convert the trajectories into staTracks and load them into the event
139  LogTrace(metname)<<"Load Muon Candidates into the event"<<endl;
140  load(muonCandidates,event);
141 
142 }
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 58 of file MuonTrackFinder.cc.

References MuonTrajectoryBuilder::setEvent(), and theTrajBuilder.

Referenced by reconstruct().

58  {
59  theTrajBuilder->setEvent(event);
60 }
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().