CMS 3D CMS Logo

MuonTrackFinder.cc
Go to the documentation of this file.
1 
11 
16 
21 
24 
25 using namespace std;
26 using namespace edm;
27 
28 // Constructor, with default cleaner. For the STA reconstruction the trackLoader must have the propagator.
29 MuonTrackFinder::MuonTrackFinder(std::unique_ptr<MuonTrajectoryBuilder> ConcreteMuonTrajectoryBuilder,
30  std::unique_ptr<MuonTrackLoader> trackLoader,
32  : MuonTrackFinder(std::move(ConcreteMuonTrajectoryBuilder),
33  std::move(trackLoader),
34  std::make_unique<MuonTrajectoryCleaner>(),
35  iC) {}
36 
37 // Constructor, with user-defined cleaner. For the STA reconstruction the trackLoader must have the propagator.
38 MuonTrackFinder::MuonTrackFinder(std::unique_ptr<MuonTrajectoryBuilder> ConcreteMuonTrajectoryBuilder,
39  std::unique_ptr<MuonTrackLoader> trackLoader,
40  std::unique_ptr<MuonTrajectoryCleaner> cleaner,
42  : theTtopoToken(iC.esConsumes()),
43  theTrajBuilder(std::move(ConcreteMuonTrajectoryBuilder)),
44  theTrajCleaner(std::move(cleaner)),
45  theTrackLoader(std::move(trackLoader)) {}
46 
47 // destructor
49  LogTrace("Muon|RecoMuon|MuonTrackFinder") << "MuonTrackFinder destructor called" << endl;
50 }
51 
52 // percolate the event setup
54 
55 // convert the trajectories into tracks and load them in to the event
58  const TrackerTopology& ttopo) {
59  return theTrackLoader->loadTracks(trajectories, event, ttopo);
60 }
61 
62 // convert the trajectories into tracks and load them in to the event
64  theTrackLoader->loadTracks(muonCands, event, ttopo);
65 }
66 
67 // reconstruct trajectories
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 }
101 
102 // reconstruct trajectories
103 void MuonTrackFinder::reconstruct(const std::vector<TrackCand>& staCandColl, Event& event, const edm::EventSetup& es) {
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
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)
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 }
Propagator.h
Handle.h
Muon.h
MessageLogger.h
MuonTrackFinder::setEvent
void setEvent(const edm::Event &)
percolate the Event Setup
Definition: MuonTrackFinder.cc:53
MuonTrajectoryCleaner.h
edm
HLT enums.
Definition: AlignableModifier.h:19
TrackerTopology
Definition: TrackerTopology.h:16
QuarkoniaTrackSelector_cfi.muonCandidates
muonCandidates
Definition: QuarkoniaTrackSelector_cfi.py:4
MuonTrackFinder::theTrajBuilder
std::unique_ptr< MuonTrajectoryBuilder > theTrajBuilder
Definition: MuonTrackFinder.h:70
FastTrackerRecHitMaskProducer_cfi.trajectories
trajectories
Definition: FastTrackerRecHitMaskProducer_cfi.py:7
MuonTrackFinder::reconstruct
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
Definition: MuonTrackFinder.cc:68
edm::Handle
Definition: AssociativeIterator.h:50
MuonTrackFinder::CandidateContainer
MuonCandidate::CandidateContainer CandidateContainer
Definition: MuonTrackFinder.h:29
fileCollector.seed
seed
Definition: fileCollector.py:127
trigger::size_type
uint16_t size_type
Definition: TriggerTypeDefs.h:18
Track.h
MuonTrackFinder::theTrajCleaner
std::unique_ptr< MuonTrajectoryCleaner > theTrajCleaner
Definition: MuonTrackFinder.h:72
MuonTrackLoader.h
MuonFwd.h
InitialStep_cff.seeds
seeds
Definition: InitialStep_cff.py:230
edm::View
Definition: CaloClusterFwd.h:14
Event.h
MuonTrackFinder::theTtopoToken
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > theTtopoToken
Definition: MuonTrackFinder.h:68
MuonTrackFinder::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 propagato...
Definition: MuonTrackFinder.cc:29
MuonTrajectoryCleaner
Definition: MuonTrajectoryCleaner.h:16
MuonTrackFinder.h
edm::EventSetup
Definition: EventSetup.h:57
TrajectorySeedCollection.h
MuonTrackFinder::theTrackLoader
std::unique_ptr< MuonTrackLoader > theTrackLoader
Definition: MuonTrackFinder.h:74
MuonTrackFinder::~MuonTrackFinder
virtual ~MuonTrackFinder()
destructor
Definition: MuonTrackFinder.cc:48
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:120
Trajectory.h
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
edm::OrphanHandle< reco::TrackCollection >
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:56
EventSetup.h
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:28
MuonTrackFinder
Definition: MuonTrackFinder.h:26
MuonTrajectoryBuilder.h
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:224
event
Definition: event.py:1
edm::Event
Definition: Event.h:73
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
metname
const std::string metname
Definition: MuonSeedOrcaPatternRecognition.cc:40