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 (std::unique_ptr< MuonTrajectoryBuilder > ConcreteMuonTrajectoryBuilder, std::unique_ptr< MuonTrackLoader > trackLoader)
 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)
 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

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

Member Typedef Documentation

◆ CandidateContainer

Definition at line 34 of file MuonTrackFinder.h.

◆ TrackCand

Definition at line 35 of file MuonTrackFinder.h.

◆ TrajectoryContainer

Definition at line 33 of file MuonTrackFinder.h.

Constructor & Destructor Documentation

◆ MuonTrackFinder() [1/2]

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

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

Definition at line 32 of file MuonTrackFinder.cc.

34  : theTrajBuilder(std::move(ConcreteMuonTrajectoryBuilder)),
36  theTrackLoader(std::move(trackLoader)) {}

◆ MuonTrackFinder() [2/2]

MuonTrackFinder::MuonTrackFinder ( std::unique_ptr< MuonTrajectoryBuilder ConcreteMuonTrajectoryBuilder,
std::unique_ptr< MuonTrackLoader trackLoader,
std::unique_ptr< 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.

42  : theTrajBuilder(std::move(ConcreteMuonTrajectoryBuilder)),
43  theTrajCleaner(std::move(cleaner)),
44  theTrackLoader(std::move(trackLoader)) {}

◆ ~MuonTrackFinder()

MuonTrackFinder::~MuonTrackFinder ( )
virtual

destructor

Definition at line 47 of file MuonTrackFinder.cc.

47  {
48  LogTrace("Muon|RecoMuon|MuonTrackFinder") << "MuonTrackFinder destructor called" << endl;
49 }

References LogTrace.

Member Function Documentation

◆ load() [1/2]

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

62  {
63  theTrackLoader->loadTracks(muonCands, event, ttopo);
64 }

References theTrackLoader.

◆ load() [2/2]

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

57  {
58  return theTrackLoader->loadTracks(trajectories, event, ttopo);
59 }

References theTrackLoader, and FastTrackerRecHitMaskProducer_cfi::trajectories.

Referenced by reconstruct().

◆ reconstruct() [1/2]

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

68  {
69  const string metname = "Muon|RecoMuon|MuonTrackFinder";
70  LogTrace(metname) << "SA Recostruction starting from: " << seeds->size() << endl;
71 
72  // Percolate the event
73  setEvent(event);
74 
76  es.get<TrackerTopologyRcd>().get(httopo);
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, *httopo);
100 }

References edm::EventSetup::get(), get, load(), LogTrace, metname, eostools::move(), SurveyInfoScenario_cff::seed, InitialStep_cff::seeds, setEvent(), theTrajBuilder, and theTrajCleaner.

◆ reconstruct() [2/2]

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.

103  {
104  const string metname = "Muon|RecoMuon|MuonTrackFinder";
105 
106  // percolate the event
107  setEvent(event);
108 
110  es.get<TrackerTopologyRcd>().get(httopo);
111 
112  // Muon Candidate container
114 
115  // reconstruct the muon candidates
116  for (vector<TrackCand>::const_iterator staCand = staCandColl.begin(); staCand != staCandColl.end(); ++staCand) {
117  CandidateContainer muonCands_temp = theTrajBuilder->trajectories(*staCand);
118  muonCandidates.insert(muonCandidates.end(),
119  std::make_move_iterator(muonCands_temp.begin()),
120  std::make_move_iterator(muonCands_temp.end()));
121  }
122 
123  // clean the cloned candidates
124  if (theTrajCleaner)
126 
127  // convert the trajectories into staTracks and load them into the event
128  LogTrace(metname) << "Load Muon Candidates into the event" << endl;
129  load(muonCandidates, event, *httopo);
130 }

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

◆ setEvent()

void MuonTrackFinder::setEvent ( const edm::Event event)
private

percolate the Event Setup

Definition at line 52 of file MuonTrackFinder.cc.

52 { theTrajBuilder->setEvent(event); }

References theTrajBuilder.

Referenced by reconstruct().

Member Data Documentation

◆ theTrackLoader

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

Definition at line 75 of file MuonTrackFinder.h.

Referenced by load().

◆ theTrajBuilder

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

Definition at line 71 of file MuonTrackFinder.h.

Referenced by reconstruct(), and setEvent().

◆ theTrajCleaner

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

Definition at line 73 of file MuonTrackFinder.h.

Referenced by reconstruct().

MuonTrackFinder::setEvent
void setEvent(const edm::Event &)
percolate the Event Setup
Definition: MuonTrackFinder.cc:52
QuarkoniaTrackSelector_cfi.muonCandidates
muonCandidates
Definition: QuarkoniaTrackSelector_cfi.py:4
MuonTrackFinder::theTrajBuilder
std::unique_ptr< MuonTrajectoryBuilder > theTrajBuilder
Definition: MuonTrackFinder.h:71
FastTrackerRecHitMaskProducer_cfi.trajectories
trajectories
Definition: FastTrackerRecHitMaskProducer_cfi.py:7
MuonTrackFinder::CandidateContainer
MuonCandidate::CandidateContainer CandidateContainer
Definition: MuonTrackFinder.h:34
trigger::size_type
uint16_t size_type
Definition: TriggerTypeDefs.h:18
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
MuonTrackFinder::theTrajCleaner
std::unique_ptr< MuonTrajectoryCleaner > theTrajCleaner
Definition: MuonTrackFinder.h:73
edm::ESHandle< TrackerTopology >
InitialStep_cff.seeds
seeds
Definition: InitialStep_cff.py:232
MuonTrajectoryCleaner
Definition: MuonTrajectoryCleaner.h:16
get
#define get
MuonTrackFinder::theTrackLoader
std::unique_ptr< MuonTrackLoader > theTrackLoader
Definition: MuonTrackFinder.h:75
eostools.move
def move(src, dest)
Definition: eostools.py:511
MuonTrackFinder::load
edm::OrphanHandle< reco::TrackCollection > load(TrajectoryContainer &, edm::Event &, const TrackerTopology &ttopo)
convert the trajectories into tracks and load them in to the event
Definition: MuonTrackFinder.cc:55
edm::View::const_iterator
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:86
MuonTrackFinder::TrajectoryContainer
MuonCandidate::TrajectoryContainer TrajectoryContainer
Definition: MuonTrackFinder.h:33
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:671
TrackerTopologyRcd
Definition: TrackerTopologyRcd.h:10
event
Definition: event.py:1
SurveyInfoScenario_cff.seed
seed
Definition: SurveyInfoScenario_cff.py:295
metname
const std::string metname
Definition: MuonSeedOrcaPatternRecognition.cc:43