CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MuonCocktails.h
Go to the documentation of this file.
1 #ifndef MuonReco_MuonCocktails_h
2 #define MuonReco_MuonCocktails_h
3 
18 
19 namespace muon {
20 
22  const reco::TrackRef& trackerTrack,
23  const reco::TrackRef& tpfmsTrack,
24  const reco::TrackRef& pickyTrack,
25  const double ptThreshold = 200.,
26  const double tune1 = 4.,
27  const double tune2 = 6.,
28  const double dptcut = -1.);
29 
30  // Version for convenience. (NB: can be used with pat::Muon, even
31  // with embedded tracks, equally conveniently!)
33  const double ptThreshold = 200.,
34  const double tune1 = 4.,
35  const double tune2 = 6.,
36  const double dptcut = -1.) {
37  return tevOptimized(muon.globalTrack(),
38  muon.innerTrack(),
39  muon.tpfmsTrack(),
40  muon.pickyTrack(),
41  ptThreshold,
42  tune1,
43  tune2,
44  dptcut);
45  }
46 
47  reco::TrackRef getTevRefitTrack(const reco::TrackRef& combinedTrack,
48  const reco::TrackToTrackMap& map);
49 
50  // The next two versions of tevOptimized are for backward
51  // compatibility; TrackToTrackMaps are to be removed from the
52  // EventContent, so these versions will go away (along with the
53  // helper getter function) after a deprecation period. Since they
54  // are just for backward compatibility and not for new code, we
55  // don't bother to expose the tune parameters.
56 
58  const reco::TrackRef& trackerTrack,
59  const reco::TrackToTrackMap& tevMap1,
60  const reco::TrackToTrackMap& tevMap2,
61  const reco::TrackToTrackMap& tevMap3,
62  const double ptThreshold = 200.,
63  const double tune1 = 4.,
64  const double tune2 = 6.,
65  const double dptcut = -1.) {
66  return tevOptimized(combinedTrack,
67  trackerTrack,
68  getTevRefitTrack(combinedTrack, tevMap2),
69  getTevRefitTrack(combinedTrack, tevMap3),
70  ptThreshold,
71  tune1,
72  tune2,
73  dptcut);
74  }
75 
77  const reco::TrackToTrackMap& tevMap1,
78  const reco::TrackToTrackMap& tevMap2,
79  const reco::TrackToTrackMap& tevMap3 ) {
80  return tevOptimized(muon.combinedMuon(),
81  muon.track(),
82  getTevRefitTrack(muon.combinedMuon(), tevMap2),
83  getTevRefitTrack(muon.combinedMuon(), tevMap3));
84  }
85 
86  // The cocktail used as the soon-to-be-old default momentum
87  // assignment for the reco::Muon.
89  const reco::TrackRef& trackerTrack,
90  const double nSigma = 2.,
91  const double ptThreshold = 200.);
92 
93  // Convenience version of the above.
95  const double nSigma = 2.,
96  const double ptThreshold = 200.) {
97  return muon::sigmaSwitch(muon.globalTrack(),
98  muon.innerTrack(),
99  nSigma,
100  ptThreshold);
101  }
102 
103  // "Truncated muon reconstructor": the first cocktail, between just
104  // tracker-only and TPFMS. Similar to tevOptimized.
106  const reco::TrackRef& fmsTrack,
107  const double tune=4.);
108 
109  double trackProbability(const reco::TrackRef track);
110 
111  inline bool cocktailInputIsOK(const reco::TrackRef& combinedTrack,
112  const reco::TrackRef& trackerTrack,
113  const reco::TrackRef& tpfmsTrack,
114  const reco::TrackRef& pickyTrack){
115 
116  return combinedTrack.isNonnull() && trackerTrack.isNonnull() && tpfmsTrack.isNonnull() && pickyTrack.isNonnull();
117  }
118 
119  inline bool cocktailInputIsOK(const reco::Muon& muon){
120  return cocktailInputIsOK(muon.globalTrack(),
121  muon.innerTrack(),
122  muon.tpfmsTrack(),
123  muon.pickyTrack());
124  }
125 
127 }
128 #endif
reco::Muon::MuonTrackTypePair muonBestTrack(const reco::Muon &muon, reco::TunePType tunePType)
virtual TrackRef innerTrack() const
Definition: Muon.h:49
virtual TrackRef track() const
reference to a Track
Definition: Muon.h:50
bool cocktailInputIsOK(const reco::TrackRef &combinedTrack, const reco::TrackRef &trackerTrack, const reco::TrackRef &tpfmsTrack, const reco::TrackRef &pickyTrack)
virtual TrackRef tpfmsTrack() const
Definition: Muon.h:58
dictionary map
Definition: Association.py:196
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:250
reco::Muon::MuonTrackTypePair sigmaSwitch(const reco::TrackRef &combinedTrack, const reco::TrackRef &trackerTrack, const double nSigma=2., const double ptThreshold=200.)
virtual TrackRef pickyTrack() const
Definition: Muon.h:59
reco::Muon::MuonTrackTypePair TMR(const reco::TrackRef &trackerTrack, const reco::TrackRef &fmsTrack, const double tune=4.)
virtual TrackRef combinedMuon() const
reference to a stand-alone muon Track
Definition: Muon.h:56
reco::TrackRef getTevRefitTrack(const reco::TrackRef &combinedTrack, const reco::TrackToTrackMap &map)
double trackProbability(const reco::TrackRef track)
reco::Muon::MuonTrackTypePair tevOptimized(const reco::TrackRef &combinedTrack, const reco::TrackRef &trackerTrack, const reco::TrackRef &tpfmsTrack, const reco::TrackRef &pickyTrack, const double ptThreshold=200., const double tune1=4., const double tune2=6., const double dptcut=-1.)
Definition: MuonCocktails.cc:9
std::pair< TrackRef, Muon::MuonTrackType > MuonTrackTypePair
Definition: Muon.h:41
TunePType
Definition: MuonFwd.h:32
virtual TrackRef globalTrack() const
reference to Track reconstructed in both tracked and muon detector
Definition: Muon.h:55