00001 #ifndef MuonReco_MuonSelectors_h
00002 #define MuonReco_MuonSelectors_h
00003
00004
00005
00006
00007
00008
00009
00010 #include "DataFormats/MuonReco/interface/Muon.h"
00011 #include "TMath.h"
00012 #include <string>
00013
00014 namespace reco{class Vertex;}
00015
00016 namespace muon {
00018 enum SelectionType {
00019 All = 0,
00020 AllGlobalMuons = 1,
00021 AllStandAloneMuons = 2,
00022 AllTrackerMuons = 3,
00023 TrackerMuonArbitrated = 4,
00024 AllArbitrated = 5,
00025 GlobalMuonPromptTight = 6,
00026 TMLastStationLoose = 7,
00027 TMLastStationTight = 8,
00028 TM2DCompatibilityLoose = 9,
00029 TM2DCompatibilityTight = 10,
00030 TMOneStationLoose = 11,
00031 TMOneStationTight = 12,
00032 TMLastStationOptimizedLowPtLoose = 13,
00033 TMLastStationOptimizedLowPtTight = 14,
00034 GMTkChiCompatibility = 15,
00035 GMStaChiCompatibility = 16,
00036 GMTkKinkTight = 17,
00037 TMLastStationAngLoose = 18,
00038 TMLastStationAngTight = 19,
00039 TMOneStationAngLoose = 20,
00040 TMOneStationAngTight = 21,
00041
00042
00043
00044
00045
00046
00047
00048 TMLastStationOptimizedBarrelLowPtLoose = 22,
00049 TMLastStationOptimizedBarrelLowPtTight = 23
00050 };
00051
00053 struct SelectionTypeStringToEnum { const char *label; SelectionType value; };
00054 SelectionType selectionTypeFromString( const std::string &label );
00055
00057 bool isGoodMuon( const reco::Muon& muon, SelectionType type,
00058 reco::Muon::ArbitrationType arbitrationType = reco::Muon::SegmentAndTrackArbitration);
00059
00060
00061
00062
00063 enum AlgorithmType { TMLastStation, TM2DCompatibility, TMOneStation };
00064
00065
00066 bool isGoodMuon( const reco::Muon& muon,
00067 AlgorithmType type,
00068 double minCompatibility,
00069 reco::Muon::ArbitrationType arbitrationType );
00070
00071 bool isGoodMuon( const reco::Muon& muon,
00072 AlgorithmType type,
00073 int minNumberOfMatches,
00074 double maxAbsDx,
00075 double maxAbsPullX,
00076 double maxAbsDy,
00077 double maxAbsPullY,
00078 double maxChamberDist,
00079 double maxChamberDistPull,
00080 reco::Muon::ArbitrationType arbitrationType,
00081 bool syncMinNMatchesNRequiredStationsInBarrelOnly = true,
00082 bool applyAlsoAngularCuts = false);
00083
00084 bool isTightMuon(const reco::Muon&, const reco::Vertex&);
00085
00086
00087 unsigned int RequiredStationMask( const reco::Muon& muon,
00088 double maxChamberDist,
00089 double maxChamberDistPull,
00090 reco::Muon::ArbitrationType arbitrationType );
00091
00092
00093 float caloCompatibility(const reco::Muon& muon);
00094
00095
00096 float segmentCompatibility(const reco::Muon& muon,reco::Muon::ArbitrationType arbitrationType = reco::Muon::SegmentAndTrackArbitration);
00097
00098
00099
00100
00101
00102
00103 bool overlap( const reco::Muon& muon1, const reco::Muon& muon2,
00104 double pullX = 1.0, double pullY = 1.0, bool checkAdjacentChambers = false);
00105
00106 }
00107 #endif