CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_1/src/DataFormats/MuonReco/interface/MuonCocktails.h

Go to the documentation of this file.
00001 #ifndef MuonReco_MuonCocktails_h
00002 #define MuonReco_MuonCocktails_h
00003 
00014 #include "DataFormats/MuonReco/interface/Muon.h"
00015 #include "DataFormats/TrackReco/interface/TrackFwd.h"
00016 #include "DataFormats/TrackReco/interface/TrackToTrackMap.h"
00017 
00018 namespace muon {
00019   
00020   reco::Muon::MuonTrackTypePair tevOptimized(const reco::TrackRef& combinedTrack,
00021                                              const reco::TrackRef& trackerTrack,
00022                                              const reco::TrackRef& tpfmsTrack,
00023                                              const reco::TrackRef& pickyTrack,
00024                                              const double ptThreshold = 200.,
00025                                              const double tune1 = 17.,
00026                                              const double tune2 = 40.,
00027                                              const double dptcut = 0.25);
00028 
00029   // Version for convenience. (NB: can be used with pat::Muon, even
00030   // with embedded tracks, equally conveniently!)
00031   inline reco::Muon::MuonTrackTypePair tevOptimized(const reco::Muon& muon,
00032                                                     const double ptThreshold = 200.,
00033                                                     const double tune1 = 17.,
00034                                                     const double tune2 = 40.,
00035                                                     const double dptcut = 0.25) {
00036     return tevOptimized(muon.globalTrack(),
00037                         muon.innerTrack(),
00038                         muon.tpfmsTrack(),
00039                         muon.pickyTrack(),
00040                         ptThreshold,
00041                         tune1,
00042                         tune2,
00043                         dptcut);  
00044   }
00045 
00046   reco::TrackRef getTevRefitTrack(const reco::TrackRef& combinedTrack,
00047                                   const reco::TrackToTrackMap& map);
00048   
00049   // The next two versions of tevOptimized are for backward
00050   // compatibility; TrackToTrackMaps are to be removed from the
00051   // EventContent, so these versions will go away (along with the
00052   // helper getter function) after a deprecation period. Since they
00053   // are just for backward compatibility and not for new code, we
00054   // don't bother to expose the tune parameters.
00055 
00056   inline reco::Muon::MuonTrackTypePair tevOptimized(const reco::TrackRef& combinedTrack,
00057                                                     const reco::TrackRef& trackerTrack,
00058                                                     const reco::TrackToTrackMap& tevMap1,
00059                                                     const reco::TrackToTrackMap& tevMap2,
00060                                                     const reco::TrackToTrackMap& tevMap3,
00061                                                     const double ptThreshold = 200.,
00062                                                     const double tune1 = 17.,
00063                                                     const double tune2 = 40.,
00064                                                     const double dptcut = 0.25) {
00065     return tevOptimized(combinedTrack,
00066                         trackerTrack,
00067                         getTevRefitTrack(combinedTrack, tevMap2),
00068                         getTevRefitTrack(combinedTrack, tevMap3),
00069                         ptThreshold,
00070                         tune1,
00071                         tune2,
00072                         dptcut);
00073   }
00074   
00075   inline reco::Muon::MuonTrackTypePair tevOptimized(const reco::Muon& muon,
00076                                                     const reco::TrackToTrackMap& tevMap1,
00077                                                     const reco::TrackToTrackMap& tevMap2,
00078                                                     const reco::TrackToTrackMap& tevMap3 ) {
00079     return tevOptimized(muon.combinedMuon(),
00080                         muon.track(),
00081                         getTevRefitTrack(muon.combinedMuon(), tevMap2),
00082                         getTevRefitTrack(muon.combinedMuon(), tevMap3));
00083   }
00084   
00085   // The cocktail used as the soon-to-be-old default momentum
00086   // assignment for the reco::Muon.
00087   reco::Muon::MuonTrackTypePair sigmaSwitch(const reco::TrackRef& combinedTrack,
00088                                             const reco::TrackRef& trackerTrack,
00089                                             const double nSigma = 2.,
00090                                             const double ptThreshold = 200.);
00091   
00092   // Convenience version of the above.
00093   inline reco::Muon::MuonTrackTypePair sigmaSwitch(const reco::Muon& muon,
00094                                                    const double nSigma = 2.,
00095                                                    const double ptThreshold = 200.) {
00096     return muon::sigmaSwitch(muon.globalTrack(),
00097                              muon.innerTrack(),
00098                              nSigma,
00099                              ptThreshold);
00100   }
00101 
00102   // "Truncated muon reconstructor": the first cocktail, between just
00103   // tracker-only and TPFMS. Similar to tevOptimized.
00104   reco::Muon::MuonTrackTypePair TMR(const reco::TrackRef& trackerTrack,
00105                                     const reco::TrackRef& fmsTrack,
00106                                     const double tune=4.);
00107   
00108   double trackProbability(const reco::TrackRef track);
00109 }
00110 
00111 #endif