CMS 3D CMS Logo

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