Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:26:16

0001 #ifndef RecoMuon_TrackingTools_MuonTrackFinder_H
0002 #define RecoMuon_TrackingTools_MuonTrackFinder_H
0003 
0004 /** \class MuonTrackFinder
0005  *  Track finder for the Muon Reco
0006  *
0007  *  \author R. Bellan - INFN Torino
0008  */
0009 
0010 #include "DataFormats/TrackReco/interface/TrackFwd.h"
0011 #include "DataFormats/TrackReco/interface/TrackExtraFwd.h"
0012 #include "DataFormats/TrajectorySeed/interface/TrajectorySeedCollection.h"
0013 #include "TrackingTools/PatternTools/interface/Trajectory.h"
0014 #include "RecoMuon/TrackingTools/interface/MuonCandidate.h"
0015 #include "DataFormats/TrackerCommon/interface/TrackerTopology.h"
0016 #include "Geometry/Records/interface/TrackerTopologyRcd.h"
0017 
0018 #include "FWCore/Framework/interface/FrameworkfwdMostUsed.h"
0019 
0020 #include <vector>
0021 
0022 class MuonTrajectoryBuilder;
0023 class MuonTrajectoryCleaner;
0024 class MuonTrackLoader;
0025 
0026 class MuonTrackFinder {
0027 public:
0028   typedef MuonCandidate::TrajectoryContainer TrajectoryContainer;
0029   typedef MuonCandidate::CandidateContainer CandidateContainer;
0030   typedef std::pair<const Trajectory*, reco::TrackRef> TrackCand;
0031 
0032 public:
0033   /// Constructor, with default cleaner. For the STA reconstruction the trackLoader must have the propagator.
0034   MuonTrackFinder(std::unique_ptr<MuonTrajectoryBuilder> ConcreteMuonTrajectoryBuilder,
0035                   std::unique_ptr<MuonTrackLoader> trackLoader,
0036                   edm::ConsumesCollector iC);
0037 
0038   /// Constructor, with user-defined cleaner. For the STA reconstruction the trackLoader must have the propagator.
0039   MuonTrackFinder(std::unique_ptr<MuonTrajectoryBuilder> ConcreteMuonTrajectoryBuilder,
0040                   std::unique_ptr<MuonTrackLoader> trackLoader,
0041                   std::unique_ptr<MuonTrajectoryCleaner> cleaner,
0042                   edm::ConsumesCollector iC);
0043 
0044   /// destructor
0045   virtual ~MuonTrackFinder();
0046 
0047   /// reconstruct standalone tracks starting from a collection of seeds
0048   edm::OrphanHandle<reco::TrackCollection> reconstruct(const edm::Handle<edm::View<TrajectorySeed> >&,
0049                                                        edm::Event&,
0050                                                        const edm::EventSetup&);
0051 
0052   /// reconstruct global tracks starting from a collection of
0053   /// standalone tracks and one of trakectories. If the latter
0054   /// is invalid, trajectories are refitted.
0055   void reconstruct(const std::vector<TrackCand>&, edm::Event&, const edm::EventSetup&);
0056 
0057 private:
0058   /// percolate the Event Setup
0059   void setEvent(const edm::Event&);
0060 
0061   /// convert the trajectories into tracks and load them in to the event
0062   edm::OrphanHandle<reco::TrackCollection> load(TrajectoryContainer&, edm::Event&, const TrackerTopology& ttopo);
0063 
0064   /// convert the trajectories into tracks and load them in to the event
0065   void load(CandidateContainer&, edm::Event&, const TrackerTopology& ttopo);
0066 
0067 private:
0068   const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> theTtopoToken;
0069 
0070   std::unique_ptr<MuonTrajectoryBuilder> theTrajBuilder;
0071 
0072   std::unique_ptr<MuonTrajectoryCleaner> theTrajCleaner;
0073 
0074   std::unique_ptr<MuonTrackLoader> theTrackLoader;
0075 };
0076 #endif