CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/DataFormats/MuonReco/interface/MuonSelectors.h

Go to the documentation of this file.
00001 #ifndef MuonReco_MuonSelectors_h
00002 #define MuonReco_MuonSelectors_h
00003 //
00004 // Package:    MuonReco
00005 // 
00006 //
00007 // Original Author:  Jake Ribnik, Dmytro Kovalskyi
00008 // $Id: MuonSelectors.h,v 1.13 2010/06/28 08:06:37 dmytro Exp $
00009 
00010 #include "DataFormats/MuonReco/interface/Muon.h"
00011 #include "TMath.h"
00012 #include <string>
00013 
00014 namespace muon {
00016    enum SelectionType {
00017       All = 0,                      // dummy options - always true
00018       AllGlobalMuons = 1,           // checks isGlobalMuon flag
00019       AllStandAloneMuons = 2,       // checks isStandAloneMuon flag
00020       AllTrackerMuons = 3,          // checks isTrackerMuon flag
00021       TrackerMuonArbitrated = 4,    // resolve ambiguity of sharing segments
00022       AllArbitrated = 5,            // all muons with the tracker muon arbitrated
00023       GlobalMuonPromptTight = 6,    // global muons with tighter fit requirements
00024       TMLastStationLoose = 7,       // penetration depth loose selector
00025       TMLastStationTight = 8,       // penetration depth tight selector
00026       TM2DCompatibilityLoose = 9,   // likelihood based loose selector
00027       TM2DCompatibilityTight = 10,  // likelihood based tight selector
00028       TMOneStationLoose = 11,       // require one well matched segment
00029       TMOneStationTight = 12,       // require one well matched segment
00030       TMLastStationOptimizedLowPtLoose = 13, // combination of TMLastStation and TMOneStation
00031       TMLastStationOptimizedLowPtTight = 14, // combination of TMLastStation and TMOneStation
00032       GMTkChiCompatibility = 15,    // require tk stub have good chi2 relative to glb track
00033       GMStaChiCompatibility = 16,   // require sta stub have good chi2 compatibility relative to glb track
00034       GMTkKinkTight = 17,           // require a small kink value in the tracker stub
00035       TMLastStationAngLoose = 18,   // TMLastStationLoose with additional angular cuts
00036       TMLastStationAngTight = 19,   // TMLastStationTight with additional angular cuts
00037       TMOneStationAngLoose = 20,    // TMOneStationLoose with additional angular cuts
00038       TMOneStationAngTight = 21,    // TMOneStationTight with additional angular cuts
00039       // The two algorithms that follow are identical to what were known as
00040       // TMLastStationOptimizedLowPt* (sans the Barrel) as late as revision
00041       // 1.7 of this file. The names were changed because indeed the low pt
00042       // optimization applies only to the barrel region, whereas the sel-
00043       // ectors above are more efficient at low pt in the endcaps, which is
00044       // what we feel is more suggestive of the algorithm name. This will be
00045       // less confusing for future generations of CMS members, I hope...
00046       TMLastStationOptimizedBarrelLowPtLoose = 22, // combination of TMLastStation and TMOneStation but with low pT optimization in barrel only
00047       TMLastStationOptimizedBarrelLowPtTight = 23  // combination of TMLastStation and TMOneStation but with low pT optimization in barrel only
00048    };
00049 
00051    struct SelectionTypeStringToEnum { const char *label; SelectionType value; };
00052    SelectionType selectionTypeFromString( const std::string &label );
00053      
00055    bool isGoodMuon( const reco::Muon& muon, SelectionType type, 
00056                     reco::Muon::ArbitrationType arbitrationType = reco::Muon::SegmentAndTrackArbitration);
00057 
00058    // ===========================================================================
00059    //                               Support functions
00060    // 
00061    enum AlgorithmType { TMLastStation, TM2DCompatibility, TMOneStation };
00062    
00063    // specialized GoodMuon functions called from main wrapper
00064    bool isGoodMuon( const reco::Muon& muon, 
00065                     AlgorithmType type,
00066                     double minCompatibility,
00067                     reco::Muon::ArbitrationType arbitrationType );
00068    
00069    bool isGoodMuon( const reco::Muon& muon, 
00070                     AlgorithmType type,
00071                     int minNumberOfMatches,
00072                     double maxAbsDx,
00073                     double maxAbsPullX,
00074                     double maxAbsDy,
00075                     double maxAbsPullY,
00076                     double maxChamberDist,
00077                     double maxChamberDistPull,
00078                     reco::Muon::ArbitrationType arbitrationType,
00079                     bool   syncMinNMatchesNRequiredStationsInBarrelOnly = true,//this is what we had originally
00080                     bool   applyAlsoAngularCuts = false);
00081    
00082    // determine if station was crossed well withing active volume
00083    unsigned int RequiredStationMask( const reco::Muon& muon,
00084                                      double maxChamberDist,
00085                                      double maxChamberDistPull,
00086                                      reco::Muon::ArbitrationType arbitrationType );
00087 
00088    // ------------ method to return the calo compatibility for a track with matched muon info  ------------
00089    float caloCompatibility(const reco::Muon& muon);
00090 
00091    // ------------ method to calculate the segment compatibility for a track with matched muon info  ------------
00092    float segmentCompatibility(const reco::Muon& muon,reco::Muon::ArbitrationType arbitrationType = reco::Muon::SegmentAndTrackArbitration);
00093    
00094    // Check if two muon trajectory overlap
00095    // The overlap is performed by comparing distance between two muon
00096    // trajectories if they cross the same muon chamber. Trajectories 
00097    // overlap if distance/uncertainty is smaller than allowed pullX 
00098    // and pullY
00099    bool overlap( const reco::Muon& muon1, const reco::Muon& muon2, 
00100                  double pullX = 1.0, double pullY = 1.0, bool checkAdjacentChambers = false);
00101 
00102 }
00103 #endif