Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:26:54

0001 #ifndef RecoMuon_GlobalTrackingTools_GlobalMuonTrackMatcher_H
0002 #define RecoMuon_GlobalTrackingTools_GlobalMuonTrackMatcher_H
0003 
0004 /** \class GlobalMuonTrackMatcher 
0005  *
0006  * Match a standalone muon track with the most compatible tracker tracks
0007  * in a TrackCollection.  GlobalMuonTrackMatcher is used during global
0008  * muon reconstruction to check the compatability of a tracker track
0009  * with a standalone muon track.  The compatability is determined 
0010  * on a chi2 comparison, of the local parameters of the two corresponding
0011  * TrajectoryStates on the surface of the innermost muon measurement for
0012  * momentum below a threshold and above this, with the position and direction 
0013  * parameters on the mentioned surface. 
0014  * If the comparison of local parameters fails to yield any
0015  * matches, then it makes a comparison of the TSOS local direction.
0016  *
0017  *
0018  *
0019  *  \author Edwin Antillon      Purdue University
0020  *  \author Chang Liu           Purdue University
0021  *  \author Adam Everett        Purdue University
0022  *  \author Norbert Neumeister  Purdue University
0023  */
0024 
0025 #include "DataFormats/TrackReco/interface/TrackFwd.h"
0026 
0027 class TrajectoryStateOnSurface;
0028 class MuonServiceProxy;
0029 class Trajectory;
0030 
0031 namespace edm {
0032   class ParameterSet;
0033 }
0034 
0035 //              ---------------------
0036 //              -- Class Interface --
0037 //              ---------------------
0038 
0039 class GlobalMuonTrackMatcher {
0040 public:
0041   typedef std::pair<const Trajectory*, reco::TrackRef> TrackCand;
0042 
0043   /// constructor
0044   GlobalMuonTrackMatcher(const edm::ParameterSet&, const MuonServiceProxy*);
0045 
0046   /// destructor
0047   virtual ~GlobalMuonTrackMatcher();
0048 
0049   /// check if two tracks are compatible (less than Chi2Cut, DeltaDCut, DeltaRCut)
0050   bool matchTight(const TrackCand& sta, const TrackCand& track) const;
0051 
0052   /// check if two tracks are compatible
0053   /// matchOption: 0 = chi2, 1 = distance, 2 = deltaR
0054   /// surfaceOption: 0 = outermost tracker surface, 1 = innermost muon system surface
0055   double match(const TrackCand& sta, const TrackCand& track, int matchOption = 0, int surfaceOption = 1) const;
0056 
0057   /// choose all tracks with a matching-chi2 less than Chi2Cut
0058   std::vector<TrackCand> match(const TrackCand& sta, const std::vector<TrackCand>& tracks) const;
0059 
0060   /// choose the one tracker track which best matches a muon track
0061   std::vector<TrackCand>::const_iterator matchOne(const TrackCand& sta, const std::vector<TrackCand>& tracks) const;
0062 
0063   double match_R_IP(const TrackCand&, const TrackCand&) const;
0064   double match_D(const TrajectoryStateOnSurface&, const TrajectoryStateOnSurface&) const;
0065   double match_d(const TrajectoryStateOnSurface&, const TrajectoryStateOnSurface&) const;
0066   double match_Rmom(const TrajectoryStateOnSurface&, const TrajectoryStateOnSurface&) const;
0067   double match_Rpos(const TrajectoryStateOnSurface&, const TrajectoryStateOnSurface&) const;
0068   double match_Chi2(const TrajectoryStateOnSurface&, const TrajectoryStateOnSurface&) const;
0069   double match_dist(const TrajectoryStateOnSurface&, const TrajectoryStateOnSurface&) const;
0070 
0071   std::pair<TrajectoryStateOnSurface, TrajectoryStateOnSurface> convertToTSOSTk(const TrackCand&,
0072                                                                                 const TrackCand&) const;
0073   std::pair<TrajectoryStateOnSurface, TrajectoryStateOnSurface> convertToTSOSMuHit(const TrackCand&,
0074                                                                                    const TrackCand&) const;
0075   std::pair<TrajectoryStateOnSurface, TrajectoryStateOnSurface> convertToTSOSTkHit(const TrackCand&,
0076                                                                                    const TrackCand&) const;
0077   bool samePlane(const TrajectoryStateOnSurface&, const TrajectoryStateOnSurface&) const;
0078 
0079 private:
0080   double theMinP;
0081   double theMinPt;
0082   double thePt_threshold1;
0083   double thePt_threshold2;
0084   double theEta_threshold;
0085   double theChi2_1;
0086   double theChi2_2;
0087   double theChi2_3;
0088   double theLocChi2;
0089   double theDeltaD_1;
0090   double theDeltaD_2;
0091   double theDeltaD_3;
0092   double theDeltaR_1;
0093   double theDeltaR_2;
0094   double theDeltaR_3;
0095   double theQual_1;
0096   double theQual_2;
0097   double theQual_3;
0098 
0099   const MuonServiceProxy* theService;
0100   std::string theOutPropagatorName;
0101 };
0102 
0103 #endif