CMS 3D CMS Logo

MuonSelectors.h
Go to the documentation of this file.
1 #ifndef MuonReco_MuonSelectors_h
2 #define MuonReco_MuonSelectors_h
3 //
4 // Package: MuonReco
5 //
6 //
7 // Original Author: Jake Ribnik, Dmytro Kovalskyi
8 
10 #include <string>
11 
12 namespace reco {
13  class Vertex;
14 }
15 
16 namespace muon {
19  All = 0, // dummy options - always true
20  AllGlobalMuons = 1, // checks isGlobalMuon flag
21  AllStandAloneMuons = 2, // checks isStandAloneMuon flag
22  AllTrackerMuons = 3, // checks isTrackerMuon flag
23  TrackerMuonArbitrated = 4, // resolve ambiguity of sharing segments
24  AllArbitrated = 5, // all muons with the tracker muon arbitrated
25  GlobalMuonPromptTight = 6, // global muons with tighter fit requirements
26  TMLastStationLoose = 7, // penetration depth loose selector
27  TMLastStationTight = 8, // penetration depth tight selector
28  TM2DCompatibilityLoose = 9, // likelihood based loose selector
29  TM2DCompatibilityTight = 10, // likelihood based tight selector
30  TMOneStationLoose = 11, // require one well matched segment
31  TMOneStationTight = 12, // require one well matched segment
32  TMLastStationOptimizedLowPtLoose = 13, // combination of TMLastStation and TMOneStation
33  TMLastStationOptimizedLowPtTight = 14, // combination of TMLastStation and TMOneStation
34  GMTkChiCompatibility = 15, // require tk stub have good chi2 relative to glb track
35  GMStaChiCompatibility = 16, // require sta stub have good chi2 compatibility relative to glb track
36  GMTkKinkTight = 17, // require a small kink value in the tracker stub
37  TMLastStationAngLoose = 18, // TMLastStationLoose with additional angular cuts
38  TMLastStationAngTight = 19, // TMLastStationTight with additional angular cuts
39  TMOneStationAngLoose = 20, // TMOneStationLoose with additional angular cuts
40  TMOneStationAngTight = 21, // TMOneStationTight with additional angular cuts
41  // The two algorithms that follow are identical to what were known as
42  // TMLastStationOptimizedLowPt* (sans the Barrel) as late as revision
43  // 1.7 of this file. The names were changed because indeed the low pt
44  // optimization applies only to the barrel region, whereas the sel-
45  // ectors above are more efficient at low pt in the endcaps, which is
46  // what we feel is more suggestive of the algorithm name. This will be
47  // less confusing for future generations of CMS members, I hope...
48  // combination of TMLastStation and TMOneStation but with low pT optimization in barrel only
50  // combination of TMLastStation and TMOneStation but with low pT optimization in barrel only
52  RPCMuLoose = 24, // checks isRPCMuon flag (require two well matched hits in different RPC layers)
58  };
59 
62  const char* label;
64  };
65 
67  {"All", All},
68  {"AllGlobalMuons", AllGlobalMuons},
69  {"AllStandAloneMuons", AllStandAloneMuons},
70  {"AllTrackerMuons", AllTrackerMuons},
71  {"TrackerMuonArbitrated", TrackerMuonArbitrated},
72  {"AllArbitrated", AllArbitrated},
73  {"GlobalMuonPromptTight", GlobalMuonPromptTight},
74  {"TMLastStationLoose", TMLastStationLoose},
75  {"TMLastStationTight", TMLastStationTight},
76  {"TM2DCompatibilityLoose", TM2DCompatibilityLoose},
77  {"TM2DCompatibilityTight", TM2DCompatibilityTight},
78  {"TMOneStationLoose", TMOneStationLoose},
79  {"TMOneStationTight", TMOneStationTight},
80  {"TMLastStationOptimizedLowPtLoose", TMLastStationOptimizedLowPtLoose},
81  {"TMLastStationOptimizedLowPtTight", TMLastStationOptimizedLowPtTight},
82  {"GMTkChiCompatibility", GMTkChiCompatibility},
83  {"GMStaChiCompatibility", GMStaChiCompatibility},
84  {"GMTkKinkTight", GMTkKinkTight},
85  {"TMLastStationAngLoose", TMLastStationAngLoose},
86  {"TMLastStationAngTight", TMLastStationAngTight},
87  {"TMOneStationAngLoose", TMOneStationAngLoose},
88  {"TMOneStationAngTight", TMOneStationAngTight},
89  {"TMLastStationOptimizedBarrelLowPtLoose", TMLastStationOptimizedBarrelLowPtLoose},
90  {"TMLastStationOptimizedBarrelLowPtTight", TMLastStationOptimizedBarrelLowPtTight},
91  {"RPCMuLoose", RPCMuLoose},
92  {"AllME0Muons", AllME0Muons},
93  {"ME0MuonArbitrated", ME0MuonArbitrated},
94  {"AllGEMMuons", AllGEMMuons},
95  {"GEMMuonArbitrated", GEMMuonArbitrated},
96  {"TriggerIdLoose", TriggerIdLoose},
97  {nullptr, (SelectionType)-1}};
98 
100 
101  // a map for string label to reco::Muon::Selector enum
103  const char* label;
105  };
106 
108  {"CutBasedIdLoose", reco::Muon::CutBasedIdLoose},
109  {"CutBasedIdMedium", reco::Muon::CutBasedIdMedium},
110  {"CutBasedIdMediumPrompt", reco::Muon::CutBasedIdMediumPrompt},
111  {"CutBasedIdTight", reco::Muon::CutBasedIdTight},
112  {"CutBasedIdGlobalHighPt", reco::Muon::CutBasedIdGlobalHighPt},
113  {"CutBasedIdTrkHighPt", reco::Muon::CutBasedIdTrkHighPt},
114  {"PFIsoVeryLoose", reco::Muon::PFIsoVeryLoose},
115  {"PFIsoLoose", reco::Muon::PFIsoLoose},
116  {"PFIsoMedium", reco::Muon::PFIsoMedium},
117  {"PFIsoTight", reco::Muon::PFIsoTight},
118  {"PFIsoVeryTight", reco::Muon::PFIsoVeryTight},
119  {"TkIsoLoose", reco::Muon::TkIsoLoose},
120  {"TkIsoTight", reco::Muon::TkIsoTight},
121  {"SoftCutBasedId", reco::Muon::SoftCutBasedId},
122  {"SoftMvaId", reco::Muon::SoftMvaId},
123  {"MvaLoose", reco::Muon::MvaLoose},
124  {"MvaMedium", reco::Muon::MvaMedium},
125  {"MvaTight", reco::Muon::MvaTight},
126  {"MiniIsoLoose", reco::Muon::MiniIsoLoose},
127  {"MiniIsoMedium", reco::Muon::MiniIsoMedium},
128  {"MiniIsoTight", reco::Muon::MiniIsoTight},
129  {"MiniIsoVeryTight", reco::Muon::MiniIsoVeryTight},
130  {"TriggerIdLoose", reco::Muon::TriggerIdLoose},
131  {"InTimeMuon", reco::Muon::InTimeMuon},
132  {"PFIsoVeryVeryTight", reco::Muon::PFIsoVeryVeryTight},
133  {"MultiIsoLoose", reco::Muon::MultiIsoLoose},
134  {"MultiIsoMedium", reco::Muon::MultiIsoMedium},
135  {"PuppiIsoLoose", reco::Muon::PuppiIsoLoose},
136  {"PuppiIsoMedium", reco::Muon::PuppiIsoMedium},
137  {"PuppiIsoTight", reco::Muon::PuppiIsoTight},
138  {"MvaVTight", reco::Muon::MvaVTight},
139  {"MvaVVTight", reco::Muon::MvaVVTight},
140  {"LowPtMvaLoose", reco::Muon::LowPtMvaLoose},
141  {"LowPtMvaMedium", reco::Muon::LowPtMvaMedium},
142  {nullptr, (reco::Muon::Selector)-1}};
143 
145 
147  bool isGoodMuon(const reco::Muon& muon,
150 
151  // ===========================================================================
152  // Support functions
153  //
155 
156  // specialized GoodMuon functions called from main wrapper
157  bool isGoodMuon(const reco::Muon& muon,
159  double minCompatibility,
160  reco::Muon::ArbitrationType arbitrationType);
161 
162  bool isGoodMuon(const reco::Muon& muon,
164  int minNumberOfMatches,
165  double maxAbsDx,
166  double maxAbsPullX,
167  double maxAbsDy,
168  double maxAbsPullY,
169  double maxChamberDist,
170  double maxChamberDistPull,
171  reco::Muon::ArbitrationType arbitrationType,
172  bool syncMinNMatchesNRequiredStationsInBarrelOnly = true, //this is what we had originally
173  bool applyAlsoAngularCuts = false);
174 
175  bool isTightMuon(const reco::Muon&, const reco::Vertex&);
176  bool isLooseMuon(const reco::Muon&);
177  bool isMediumMuon(const reco::Muon&, bool run2016_hip_mitigation = false);
178  bool isSoftMuon(const reco::Muon&, const reco::Vertex&, bool run2016_hip_mitigation = false);
179  bool isHighPtMuon(const reco::Muon&, const reco::Vertex&);
180  bool isTrackerHighPtMuon(const reco::Muon&, const reco::Vertex&);
181  bool isLooseTriggerMuon(const reco::Muon&);
182 
183  // determine if station was crossed well withing active volume
184  unsigned int RequiredStationMask(const reco::Muon& muon,
185  double maxChamberDist,
186  double maxChamberDistPull,
187  reco::Muon::ArbitrationType arbitrationType);
188 
189  // ------------ method to return the calo compatibility for a track with matched muon info ------------
190  float caloCompatibility(const reco::Muon& muon);
191 
192  // ------------ method to calculate the segment compatibility for a track with matched muon info ------------
193  float segmentCompatibility(const reco::Muon& muon,
195 
196  // Check if two muon trajectory overlap
197  // The overlap is performed by comparing distance between two muon
198  // trajectories if they cross the same muon chamber. Trajectories
199  // overlap if distance/uncertainty is smaller than allowed pullX
200  // and pullY
201  bool overlap(const reco::Muon& muon1,
202  const reco::Muon& muon2,
203  double pullX = 1.0,
204  double pullY = 1.0,
205  bool checkAdjacentChambers = false);
206 
209  int sharedSegments(const reco::Muon& muon1,
210  const reco::Muon& muon2,
211  unsigned int segmentArbitrationMask = reco::MuonSegmentMatch::BestInChamberByDR);
212 
214  reco::Vertex const* vertex = nullptr,
215  bool run2016_hip_mitigation = false);
216 } // namespace muon
217 #endif
muon::TMOneStation
Definition: MuonSelectors.h:154
muon::SelectorStringToEnum::value
reco::Muon::Selector value
Definition: MuonSelectors.h:104
reco::Muon::MvaVTight
Definition: Muon.h:232
muon::GEMMu
Definition: MuonSelectors.h:154
Muon.h
muon::isSoftMuon
bool isSoftMuon(const reco::Muon &, const reco::Vertex &, bool run2016_hip_mitigation=false)
Definition: MuonSelectors.cc:916
reco::Muon::SegmentAndTrackArbitration
Definition: Muon.h:190
reco::Muon::CutBasedIdTrkHighPt
Definition: Muon.h:207
reco::Muon::MiniIsoVeryTight
Definition: Muon.h:223
muon
Definition: MuonCocktails.h:17
muon::segmentCompatibility
float segmentCompatibility(const reco::Muon &muon, reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration)
Definition: MuonSelectors.cc:61
muon::SelectorStringToEnum
Definition: MuonSelectors.h:102
muon::TMLastStation
Definition: MuonSelectors.h:154
reco::Muon::Selector
Selector
Definition: Muon.h:201
reco::Muon::PuppiIsoLoose
Definition: Muon.h:229
reco::Muon::SoftMvaId
Definition: Muon.h:216
HLT_FULL_cff.maxAbsPullX
maxAbsPullX
Definition: HLT_FULL_cff.py:11666
muon::GlobalMuonPromptTight
Definition: MuonSelectors.h:25
muon::TMLastStationTight
Definition: MuonSelectors.h:27
reco::Muon::MultiIsoLoose
Definition: Muon.h:227
muon::TrackerMuonArbitrated
Definition: MuonSelectors.h:23
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:46
reco::Muon::TkIsoLoose
Definition: Muon.h:213
muon::isLooseTriggerMuon
bool isLooseTriggerMuon(const reco::Muon &)
Definition: MuonSelectors.cc:866
reco::Muon::CutBasedIdLoose
Definition: Muon.h:202
reco::Muon::TkIsoTight
Definition: Muon.h:214
muon::RPCMuLoose
Definition: MuonSelectors.h:52
muon::AllGEMMuons
Definition: MuonSelectors.h:55
HLT_FULL_cff.maxAbsPullY
maxAbsPullY
Definition: HLT_FULL_cff.py:11677
muon::GMTkChiCompatibility
Definition: MuonSelectors.h:34
reco::Muon
Definition: Muon.h:27
muon::ME0Mu
Definition: MuonSelectors.h:154
reco::Muon::PuppiIsoTight
Definition: Muon.h:231
reco::Muon::CutBasedIdMedium
Definition: Muon.h:203
muon::isGoodMuon
bool isGoodMuon(const reco::Muon &muon, SelectionType type, reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration)
main GoodMuon wrapper call
Definition: MuonSelectors.cc:649
muon::isLooseMuon
bool isLooseMuon(const reco::Muon &)
Definition: MuonSelectors.cc:895
reco::Muon::PuppiIsoMedium
Definition: Muon.h:230
muon::SelectionTypeStringToEnum::value
SelectionType value
Definition: MuonSelectors.h:63
muon::isTrackerHighPtMuon
bool isTrackerHighPtMuon(const reco::Muon &, const reco::Vertex &)
Definition: MuonSelectors.cc:962
muon::selectionTypeFromString
SelectionType selectionTypeFromString(const std::string &label)
Definition: MuonSelectors.cc:9
reco::Muon::PFIsoLoose
Definition: Muon.h:209
muon::SelectionType
SelectionType
Selector type.
Definition: MuonSelectors.h:18
reco::Muon::PFIsoVeryLoose
Definition: Muon.h:208
reco::Muon::MvaLoose
Definition: Muon.h:217
muon::caloCompatibility
float caloCompatibility(const reco::Muon &muon)
Definition: MuonSelectors.cc:58
muon::TMLastStationOptimizedLowPtLoose
Definition: MuonSelectors.h:32
HLT_FULL_cff.maxAbsDy
maxAbsDy
Definition: HLT_FULL_cff.py:11678
reco::Muon::MvaVVTight
Definition: Muon.h:233
reco::Muon::MiniIsoLoose
Definition: Muon.h:220
reco::Muon::MiniIsoTight
Definition: Muon.h:222
muon::AllGlobalMuons
Definition: MuonSelectors.h:20
muon::isHighPtMuon
bool isHighPtMuon(const reco::Muon &, const reco::Vertex &)
Definition: MuonSelectors.cc:933
muon::GMTkKinkTight
Definition: MuonSelectors.h:36
muon::TMOneStationTight
Definition: MuonSelectors.h:31
bphysicsOniaDQM_cfi.vertex
vertex
Definition: bphysicsOniaDQM_cfi.py:7
type
type
Definition: SiPixelVCal_PayloadInspector.cc:39
muon::isTightMuon
bool isTightMuon(const reco::Muon &, const reco::Vertex &)
Definition: MuonSelectors.cc:880
reco::Muon::TriggerIdLoose
Definition: Muon.h:224
reco::Muon::LowPtMvaMedium
Definition: Muon.h:235
muon::TMLastStationAngTight
Definition: MuonSelectors.h:38
reco::Muon::PFIsoVeryTight
Definition: Muon.h:212
muon::AllME0Muons
Definition: MuonSelectors.h:53
reco::Muon::MultiIsoMedium
Definition: Muon.h:228
muon::overlap
bool overlap(const reco::Muon &muon1, const reco::Muon &muon2, double pullX=1.0, double pullY=1.0, bool checkAdjacentChambers=false)
Definition: MuonSelectors.cc:791
reco::Muon::LowPtMvaLoose
Definition: Muon.h:234
muon::SelectionTypeStringToEnum
a lightweight "map" for selection type string label and enum value
Definition: MuonSelectors.h:61
muon::ME0MuonArbitrated
Definition: MuonSelectors.h:54
reco::Muon::MiniIsoMedium
Definition: Muon.h:221
reco::Muon::CutBasedIdMediumPrompt
Definition: Muon.h:204
muon::TMLastStationOptimizedBarrelLowPtLoose
Definition: MuonSelectors.h:49
muon::isMediumMuon
bool isMediumMuon(const reco::Muon &, bool run2016_hip_mitigation=false)
Definition: MuonSelectors.cc:899
muon::TMOneStationLoose
Definition: MuonSelectors.h:30
HLT_FULL_cff.maxAbsDx
maxAbsDx
Definition: HLT_FULL_cff.py:11681
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
muon::AllArbitrated
Definition: MuonSelectors.h:24
reco::Muon::PFIsoTight
Definition: Muon.h:211
reco::Muon::MvaMedium
Definition: Muon.h:218
muon::makeSelectorBitset
reco::Muon::Selector makeSelectorBitset(reco::Muon const &muon, reco::Vertex const *vertex=nullptr, bool run2016_hip_mitigation=false)
Definition: MuonSelectors.cc:1033
muon::TMLastStationOptimizedBarrelLowPtTight
Definition: MuonSelectors.h:51
muon::TM2DCompatibilityTight
Definition: MuonSelectors.h:29
reco::Muon::CutBasedIdGlobalHighPt
Definition: Muon.h:206
muon::selectionTypeStringToEnumMap
static const SelectionTypeStringToEnum selectionTypeStringToEnumMap[]
Definition: MuonSelectors.h:66
muon::SelectionTypeStringToEnum::label
const char * label
Definition: MuonSelectors.h:62
reco::Muon::PFIsoVeryVeryTight
Definition: Muon.h:226
muon::sharedSegments
int sharedSegments(const reco::Muon &muon1, const reco::Muon &muon2, unsigned int segmentArbitrationMask=reco::MuonSegmentMatch::BestInChamberByDR)
Definition: MuonSelectors.cc:978
muon::All
Definition: MuonSelectors.h:19
muon::selectorStringToEnumMap
static const SelectorStringToEnum selectorStringToEnumMap[]
Definition: MuonSelectors.h:107
HltBtagValidation_cff.Vertex
Vertex
Definition: HltBtagValidation_cff.py:32
HLT_FULL_cff.minNumberOfMatches
minNumberOfMatches
Definition: HLT_FULL_cff.py:11684
reco::Muon::PFIsoMedium
Definition: Muon.h:210
muon::GEMMuonArbitrated
Definition: MuonSelectors.h:56
muon::selectorFromString
reco::Muon::Selector selectorFromString(const std::string &label)
Definition: MuonSelectors.cc:24
muon::AlgorithmType
AlgorithmType
Definition: MuonSelectors.h:154
muon::TMLastStationLoose
Definition: MuonSelectors.h:26
reco::Muon::SoftCutBasedId
Definition: Muon.h:215
muon::SelectorStringToEnum::label
const char * label
Definition: MuonSelectors.h:103
muon::TMLastStationOptimizedLowPtTight
Definition: MuonSelectors.h:33
muon::TM2DCompatibility
Definition: MuonSelectors.h:154
muon::TMLastStationAngLoose
Definition: MuonSelectors.h:37
muon::AllStandAloneMuons
Definition: MuonSelectors.h:21
muon::GMStaChiCompatibility
Definition: MuonSelectors.h:35
muon::TriggerIdLoose
Definition: MuonSelectors.h:57
muon::TMOneStationAngTight
Definition: MuonSelectors.h:40
reco::Muon::MvaTight
Definition: Muon.h:219
muon::RPCMu
Definition: MuonSelectors.h:154
muon::AllTrackerMuons
Definition: MuonSelectors.h:22
muon::RequiredStationMask
unsigned int RequiredStationMask(const reco::Muon &muon, double maxChamberDist, double maxChamberDistPull, reco::Muon::ArbitrationType arbitrationType)
Definition: MuonSelectors.cc:40
muon::TMOneStationAngLoose
Definition: MuonSelectors.h:39
label
const char * label
Definition: PFTauDecayModeTools.cc:11
reco::Vertex
Definition: Vertex.h:35
reco::MuonSegmentMatch::BestInChamberByDR
static const unsigned int BestInChamberByDR
Definition: MuonSegmentMatch.h:17
reco::Muon::CutBasedIdTight
Definition: Muon.h:205
reco::Muon::ArbitrationType
ArbitrationType
define arbitration schemes
Definition: Muon.h:187
muon::TM2DCompatibilityLoose
Definition: MuonSelectors.h:28
reco::Muon::InTimeMuon
Definition: Muon.h:225