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 RPCMuLoose = 24
00051 };
00052
00054 struct SelectionTypeStringToEnum { const char *label; SelectionType value; };
00055 SelectionType selectionTypeFromString( const std::string &label );
00056
00058 bool isGoodMuon( const reco::Muon& muon, SelectionType type,
00059 reco::Muon::ArbitrationType arbitrationType = reco::Muon::SegmentAndTrackArbitration);
00060
00061
00062
00063
00064 enum AlgorithmType { TMLastStation, TM2DCompatibility, TMOneStation, RPCMu };
00065
00066
00067 bool isGoodMuon( const reco::Muon& muon,
00068 AlgorithmType type,
00069 double minCompatibility,
00070 reco::Muon::ArbitrationType arbitrationType );
00071
00072 bool isGoodMuon( const reco::Muon& muon,
00073 AlgorithmType type,
00074 int minNumberOfMatches,
00075 double maxAbsDx,
00076 double maxAbsPullX,
00077 double maxAbsDy,
00078 double maxAbsPullY,
00079 double maxChamberDist,
00080 double maxChamberDistPull,
00081 reco::Muon::ArbitrationType arbitrationType,
00082 bool syncMinNMatchesNRequiredStationsInBarrelOnly = true,
00083 bool applyAlsoAngularCuts = false);
00084
00085 bool isTightMuon(const reco::Muon&, const reco::Vertex&);
00086 bool isLooseMuon(const reco::Muon&);
00087 bool isSoftMuon(const reco::Muon&, const reco::Vertex&);
00088 bool isHighPtMuon(const reco::Muon&, const reco::Vertex&);
00089
00090
00091 unsigned int RequiredStationMask( const reco::Muon& muon,
00092 double maxChamberDist,
00093 double maxChamberDistPull,
00094 reco::Muon::ArbitrationType arbitrationType );
00095
00096
00097 float caloCompatibility(const reco::Muon& muon);
00098
00099
00100 float segmentCompatibility(const reco::Muon& muon,reco::Muon::ArbitrationType arbitrationType = reco::Muon::SegmentAndTrackArbitration);
00101
00102
00103
00104
00105
00106
00107 bool overlap( const reco::Muon& muon1, const reco::Muon& muon2,
00108 double pullX = 1.0, double pullY = 1.0, bool checkAdjacentChambers = false);
00109
00112 int sharedSegments( const reco::Muon& muon1, const reco::Muon& muon2,
00113 unsigned int segmentArbitrationMask = reco::MuonSegmentMatch::BestInChamberByDR ) ;
00114
00115 }
00116 #endif