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 "TMath.h"
11 #include <string>
12 
13 namespace reco{class Vertex;}
14 
15 namespace muon {
18  All = 0, // dummy options - always true
19  AllGlobalMuons = 1, // checks isGlobalMuon flag
20  AllStandAloneMuons = 2, // checks isStandAloneMuon flag
21  AllTrackerMuons = 3, // checks isTrackerMuon flag
22  TrackerMuonArbitrated = 4, // resolve ambiguity of sharing segments
23  AllArbitrated = 5, // all muons with the tracker muon arbitrated
24  GlobalMuonPromptTight = 6, // global muons with tighter fit requirements
25  TMLastStationLoose = 7, // penetration depth loose selector
26  TMLastStationTight = 8, // penetration depth tight selector
27  TM2DCompatibilityLoose = 9, // likelihood based loose selector
28  TM2DCompatibilityTight = 10, // likelihood based tight selector
29  TMOneStationLoose = 11, // require one well matched segment
30  TMOneStationTight = 12, // require one well matched segment
31  TMLastStationOptimizedLowPtLoose = 13, // combination of TMLastStation and TMOneStation
32  TMLastStationOptimizedLowPtTight = 14, // combination of TMLastStation and TMOneStation
33  GMTkChiCompatibility = 15, // require tk stub have good chi2 relative to glb track
34  GMStaChiCompatibility = 16, // require sta stub have good chi2 compatibility relative to glb track
35  GMTkKinkTight = 17, // require a small kink value in the tracker stub
36  TMLastStationAngLoose = 18, // TMLastStationLoose with additional angular cuts
37  TMLastStationAngTight = 19, // TMLastStationTight with additional angular cuts
38  TMOneStationAngLoose = 20, // TMOneStationLoose with additional angular cuts
39  TMOneStationAngTight = 21, // TMOneStationTight with additional angular cuts
40  // The two algorithms that follow are identical to what were known as
41  // TMLastStationOptimizedLowPt* (sans the Barrel) as late as revision
42  // 1.7 of this file. The names were changed because indeed the low pt
43  // optimization applies only to the barrel region, whereas the sel-
44  // ectors above are more efficient at low pt in the endcaps, which is
45  // what we feel is more suggestive of the algorithm name. This will be
46  // less confusing for future generations of CMS members, I hope...
47  TMLastStationOptimizedBarrelLowPtLoose = 22, // combination of TMLastStation and TMOneStation but with low pT optimization in barrel only
48  TMLastStationOptimizedBarrelLowPtTight = 23, // combination of TMLastStation and TMOneStation but with low pT optimization in barrel only
49  RPCMuLoose = 24, // checks isRPCMuon flag (require two well matched hits in different RPC layers)
55  };
56 
60 
64 
65  // ===========================================================================
66  // Support functions
67  //
69 
70  // specialized GoodMuon functions called from main wrapper
71  bool isGoodMuon( const reco::Muon& muon,
72  AlgorithmType type,
73  double minCompatibility,
74  reco::Muon::ArbitrationType arbitrationType );
75 
76  bool isGoodMuon( const reco::Muon& muon,
77  AlgorithmType type,
79  double maxAbsDx,
80  double maxAbsPullX,
81  double maxAbsDy,
82  double maxAbsPullY,
83  double maxChamberDist,
84  double maxChamberDistPull,
85  reco::Muon::ArbitrationType arbitrationType,
86  bool syncMinNMatchesNRequiredStationsInBarrelOnly = true,//this is what we had originally
87  bool applyAlsoAngularCuts = false);
88 
89  bool isTightMuon(const reco::Muon&, const reco::Vertex&);
90  bool isLooseMuon(const reco::Muon&);
91  bool isMediumMuon(const reco::Muon&, bool run2016_hip_mitigation=false);
92  bool isSoftMuon(const reco::Muon&, const reco::Vertex&, bool run2016_hip_mitigation=false);
93  bool isHighPtMuon(const reco::Muon&, const reco::Vertex&);
94  bool isTrackerHighPtMuon(const reco::Muon&, const reco::Vertex&);
95  bool isLooseTriggerMuon(const reco::Muon&);
96 
97  // determine if station was crossed well withing active volume
98  unsigned int RequiredStationMask( const reco::Muon& muon,
99  double maxChamberDist,
100  double maxChamberDistPull,
101  reco::Muon::ArbitrationType arbitrationType );
102 
103  // ------------ method to return the calo compatibility for a track with matched muon info ------------
104  float caloCompatibility(const reco::Muon& muon);
105 
106  // ------------ method to calculate the segment compatibility for a track with matched muon info ------------
108 
109  // Check if two muon trajectory overlap
110  // The overlap is performed by comparing distance between two muon
111  // trajectories if they cross the same muon chamber. Trajectories
112  // overlap if distance/uncertainty is smaller than allowed pullX
113  // and pullY
114  bool overlap( const reco::Muon& muon1, const reco::Muon& muon2,
115  double pullX = 1.0, double pullY = 1.0, bool checkAdjacentChambers = false);
116 
119  int sharedSegments( const reco::Muon& muon1, const reco::Muon& muon2,
120  unsigned int segmentArbitrationMask = reco::MuonSegmentMatch::BestInChamberByDR ) ;
121 
123  const reco::Vertex* vertex=nullptr,
124  bool run2016_hip_mitigation=false);
125 }
126 #endif
type
Definition: HCALResponse.h:21
AlgorithmType
Definition: MuonSelectors.h:68
bool isMediumMuon(const reco::Muon &, bool run2016_hip_mitigation=false)
void setCutBasedSelectorFlags(reco::Muon &muon, const reco::Vertex *vertex=0, bool run2016_hip_mitigation=false)
float caloCompatibility(const reco::Muon &muon)
bool isLooseMuon(const reco::Muon &)
SelectionType
Selector type.
Definition: MuonSelectors.h:17
bool overlap(const reco::Muon &muon1, const reco::Muon &muon2, double pullX=1.0, double pullY=1.0, bool checkAdjacentChambers=false)
char const * label
ArbitrationType
define arbitration schemes
Definition: Muon.h:186
float segmentCompatibility(const reco::Muon &muon, reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration)
static const unsigned int BestInChamberByDR
bool isSoftMuon(const reco::Muon &, const reco::Vertex &, bool run2016_hip_mitigation=false)
bool isGoodMuon(const reco::Muon &muon, AlgorithmType type, int minNumberOfMatches, double maxAbsDx, double maxAbsPullX, double maxAbsDy, double maxAbsPullY, double maxChamberDist, double maxChamberDistPull, reco::Muon::ArbitrationType arbitrationType, bool syncMinNMatchesNRequiredStationsInBarrelOnly=true, bool applyAlsoAngularCuts=false)
int sharedSegments(const reco::Muon &muon1, const reco::Muon &muon2, unsigned int segmentArbitrationMask=reco::MuonSegmentMatch::BestInChamberByDR)
bool isHighPtMuon(const reco::Muon &, const reco::Vertex &)
SelectionType selectionTypeFromString(const std::string &label)
Definition: MuonSelectors.cc:9
a lightweight "map" for selection type string label and enum value
Definition: MuonSelectors.h:58
unsigned int RequiredStationMask(const reco::Muon &muon, double maxChamberDist, double maxChamberDistPull, reco::Muon::ArbitrationType arbitrationType)
fixed size matrix
bool isTrackerHighPtMuon(const reco::Muon &, const reco::Vertex &)
bool isTightMuon(const reco::Muon &, const reco::Vertex &)
bool isLooseTriggerMuon(const reco::Muon &)