CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 (std::unique_ptr< MuonTrajectoryBuilder > ConcreteMuonTrajectoryBuilder, std::unique_ptr< MuonTrackLoader > trackLoader, edm::ConsumesCollector iC)
 Constructor, with default cleaner. For the STA reconstruction the trackLoader must have the propagator. More...
 
 MuonTrackFinder (std::unique_ptr< MuonTrajectoryBuilder > ConcreteMuonTrajectoryBuilder, std::unique_ptr< MuonTrackLoader > trackLoader, std::unique_ptr< MuonTrajectoryCleaner > cleaner, edm::ConsumesCollector iC)
 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 &, 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::TrackCollection
load (TrajectoryContainer &, edm::Event &, const TrackerTopology &ttopo)
 convert the trajectories into tracks and load them in to the event More...
 
void load (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

std::unique_ptr< MuonTrackLoadertheTrackLoader
 
std::unique_ptr
< MuonTrajectoryBuilder
theTrajBuilder
 
std::unique_ptr
< MuonTrajectoryCleaner
theTrajCleaner
 
const edm::ESGetToken
< TrackerTopology,
TrackerTopologyRcd
theTtopoToken
 

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 29 of file MuonTrackFinder.h.

Definition at line 30 of file MuonTrackFinder.h.

Definition at line 28 of file MuonTrackFinder.h.

Constructor & Destructor Documentation

MuonTrackFinder::MuonTrackFinder ( std::unique_ptr< MuonTrajectoryBuilder ConcreteMuonTrajectoryBuilder,
std::unique_ptr< MuonTrackLoader trackLoader,
edm::ConsumesCollector  iC 
)

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

Definition at line 29 of file MuonTrackFinder.cc.

32  : MuonTrackFinder(std::move(ConcreteMuonTrajectoryBuilder),
33  std::move(trackLoader),
34  std::make_unique<MuonTrajectoryCleaner>(),
35  iC) {}
def move
Definition: eostools.py:511
MuonTrackFinder(std::unique_ptr< MuonTrajectoryBuilder > ConcreteMuonTrajectoryBuilder, std::unique_ptr< MuonTrackLoader > trackLoader, edm::ConsumesCollector iC)
Constructor, with default cleaner. For the STA reconstruction the trackLoader must have the propagato...
MuonTrackFinder::MuonTrackFinder ( std::unique_ptr< MuonTrajectoryBuilder ConcreteMuonTrajectoryBuilder,
std::unique_ptr< MuonTrackLoader trackLoader,
std::unique_ptr< MuonTrajectoryCleaner cleaner,
edm::ConsumesCollector  iC 
)

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

Definition at line 38 of file MuonTrackFinder.cc.

42  : theTtopoToken(iC.esConsumes()),
43  theTrajBuilder(std::move(ConcreteMuonTrajectoryBuilder)),
44  theTrajCleaner(std::move(cleaner)),
45  theTrackLoader(std::move(trackLoader)) {}
std::unique_ptr< MuonTrajectoryCleaner > theTrajCleaner
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > theTtopoToken
def move
Definition: eostools.py:511
std::unique_ptr< MuonTrajectoryBuilder > theTrajBuilder
std::unique_ptr< MuonTrackLoader > theTrackLoader
MuonTrackFinder::~MuonTrackFinder ( )
virtual

destructor

Definition at line 48 of file MuonTrackFinder.cc.

References LogTrace.

48  {
49  LogTrace("Muon|RecoMuon|MuonTrackFinder") << "MuonTrackFinder destructor called" << endl;
50 }
#define LogTrace(id)

Member Function Documentation

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

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

Definition at line 56 of file MuonTrackFinder.cc.

References theTrackLoader.

Referenced by reconstruct().

58  {
59  return theTrackLoader->loadTracks(trajectories, event, ttopo);
60 }
std::unique_ptr< MuonTrackLoader > theTrackLoader
void MuonTrackFinder::load ( CandidateContainer muonCands,
edm::Event event,
const TrackerTopology ttopo 
)
private

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

Definition at line 63 of file MuonTrackFinder.cc.

References theTrackLoader.

63  {
64  theTrackLoader->loadTracks(muonCands, event, ttopo);
65 }
std::unique_ptr< 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 68 of file MuonTrackFinder.cc.

References edm::EventSetup::getData(), load(), LogTrace, metname, eostools::move(), fileCollector::seed, DetachedQuadStep_cff::seeds, setEvent(), theTrajBuilder, theTrajCleaner, and theTtopoToken.

69  {
70  const string metname = "Muon|RecoMuon|MuonTrackFinder";
71  LogTrace(metname) << "SA Recostruction starting from: " << seeds->size() << endl;
72 
73  // Percolate the event
74  setEvent(event);
75 
76  const auto& ttopo = es.getData(theTtopoToken);
77 
78  // Trajectory container
79  TrajectoryContainer muonTrajectories;
81  // reconstruct the trajectory
83  for (seed = seeds->begin(); seed != seeds->end(); ++seed, ++nSeed) {
84  LogTrace(metname) << "+++ New Seed +++" << endl;
85  TrajectoryContainer muonTrajs_temp = theTrajBuilder->trajectories(*seed);
86  for (TrajectoryContainer::iterator it = muonTrajs_temp.begin(); it != muonTrajs_temp.end(); ++it) {
87  (*it)->setSeedRef(seeds->refAt(nSeed));
88  muonTrajectories.push_back(std::move(*it));
89  }
90  }
91 
92  // clean the clone traj
93  LogTrace(metname) << "Clean the trajectories container" << endl;
94  if (theTrajCleaner)
95  theTrajCleaner->clean(muonTrajectories, event, seeds); //used by reference...
96 
97  // convert the trajectories into tracks and load them in to the event
98  LogTrace(metname) << "Convert the trajectories into tracks and load them in to the event" << endl;
99  return load(muonTrajectories, event, ttopo);
100 }
edm::OrphanHandle< reco::TrackCollection > load(TrajectoryContainer &, edm::Event &, const TrackerTopology &ttopo)
convert the trajectories into tracks and load them in to the event
std::unique_ptr< MuonTrajectoryCleaner > theTrajCleaner
const std::string metname
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > theTtopoToken
uint16_t size_type
#define LogTrace(id)
void setEvent(const edm::Event &)
percolate the Event Setup
bool getData(T &iHolder) const
Definition: EventSetup.h:128
def move
Definition: eostools.py:511
MuonCandidate::TrajectoryContainer TrajectoryContainer
std::unique_ptr< MuonTrajectoryBuilder > theTrajBuilder
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:86
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 103 of file MuonTrackFinder.cc.

References edm::EventSetup::getData(), load(), LogTrace, metname, setEvent(), theTrajBuilder, theTrajCleaner, and theTtopoToken.

103  {
104  const string metname = "Muon|RecoMuon|MuonTrackFinder";
105 
106  // percolate the event
107  setEvent(event);
108 
109  const auto& ttopo = es.getData(theTtopoToken);
110 
111  // Muon Candidate container
112  CandidateContainer muonCandidates;
113 
114  // reconstruct the muon candidates
115  for (vector<TrackCand>::const_iterator staCand = staCandColl.begin(); staCand != staCandColl.end(); ++staCand) {
116  CandidateContainer muonCands_temp = theTrajBuilder->trajectories(*staCand);
117  muonCandidates.insert(muonCandidates.end(),
118  std::make_move_iterator(muonCands_temp.begin()),
119  std::make_move_iterator(muonCands_temp.end()));
120  }
121 
122  // clean the cloned candidates
123  if (theTrajCleaner)
124  theTrajCleaner->clean(muonCandidates);
125 
126  // convert the trajectories into staTracks and load them into the event
127  LogTrace(metname) << "Load Muon Candidates into the event" << endl;
128  load(muonCandidates, event, ttopo);
129 }
edm::OrphanHandle< reco::TrackCollection > load(TrajectoryContainer &, edm::Event &, const TrackerTopology &ttopo)
convert the trajectories into tracks and load them in to the event
std::unique_ptr< MuonTrajectoryCleaner > theTrajCleaner
const std::string metname
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > theTtopoToken
#define LogTrace(id)
void setEvent(const edm::Event &)
percolate the Event Setup
bool getData(T &iHolder) const
Definition: EventSetup.h:128
std::unique_ptr< MuonTrajectoryBuilder > theTrajBuilder
MuonCandidate::CandidateContainer CandidateContainer
void MuonTrackFinder::setEvent ( const edm::Event event)
private

percolate the Event Setup

Definition at line 53 of file MuonTrackFinder.cc.

References theTrajBuilder.

Referenced by reconstruct().

53 { theTrajBuilder->setEvent(event); }
std::unique_ptr< MuonTrajectoryBuilder > theTrajBuilder

Member Data Documentation

std::unique_ptr<MuonTrackLoader> MuonTrackFinder::theTrackLoader
private

Definition at line 74 of file MuonTrackFinder.h.

Referenced by load().

std::unique_ptr<MuonTrajectoryBuilder> MuonTrackFinder::theTrajBuilder
private

Definition at line 70 of file MuonTrackFinder.h.

Referenced by reconstruct(), and setEvent().

std::unique_ptr<MuonTrajectoryCleaner> MuonTrackFinder::theTrajCleaner
private

Definition at line 72 of file MuonTrackFinder.h.

Referenced by reconstruct().

const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> MuonTrackFinder::theTtopoToken
private

Definition at line 68 of file MuonTrackFinder.h.

Referenced by reconstruct().