CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_9_patch3/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.14.2.1 2012/09/24 21:11:53 gpetrucc Exp $
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,                      // dummy options - always true
00020       AllGlobalMuons = 1,           // checks isGlobalMuon flag
00021       AllStandAloneMuons = 2,       // checks isStandAloneMuon flag
00022       AllTrackerMuons = 3,          // checks isTrackerMuon flag
00023       TrackerMuonArbitrated = 4,    // resolve ambiguity of sharing segments
00024       AllArbitrated = 5,            // all muons with the tracker muon arbitrated
00025       GlobalMuonPromptTight = 6,    // global muons with tighter fit requirements
00026       TMLastStationLoose = 7,       // penetration depth loose selector
00027       TMLastStationTight = 8,       // penetration depth tight selector
00028       TM2DCompatibilityLoose = 9,   // likelihood based loose selector
00029       TM2DCompatibilityTight = 10,  // likelihood based tight selector
00030       TMOneStationLoose = 11,       // require one well matched segment
00031       TMOneStationTight = 12,       // require one well matched segment
00032       TMLastStationOptimizedLowPtLoose = 13, // combination of TMLastStation and TMOneStation
00033       TMLastStationOptimizedLowPtTight = 14, // combination of TMLastStation and TMOneStation
00034       GMTkChiCompatibility = 15,    // require tk stub have good chi2 relative to glb track
00035       GMStaChiCompatibility = 16,   // require sta stub have good chi2 compatibility relative to glb track
00036       GMTkKinkTight = 17,           // require a small kink value in the tracker stub
00037       TMLastStationAngLoose = 18,   // TMLastStationLoose with additional angular cuts
00038       TMLastStationAngTight = 19,   // TMLastStationTight with additional angular cuts
00039       TMOneStationAngLoose = 20,    // TMOneStationLoose with additional angular cuts
00040       TMOneStationAngTight = 21,    // TMOneStationTight with additional angular cuts
00041       // The two algorithms that follow are identical to what were known as
00042       // TMLastStationOptimizedLowPt* (sans the Barrel) as late as revision
00043       // 1.7 of this file. The names were changed because indeed the low pt
00044       // optimization applies only to the barrel region, whereas the sel-
00045       // ectors above are more efficient at low pt in the endcaps, which is
00046       // what we feel is more suggestive of the algorithm name. This will be
00047       // less confusing for future generations of CMS members, I hope...
00048       TMLastStationOptimizedBarrelLowPtLoose = 22, // combination of TMLastStation and TMOneStation but with low pT optimization in barrel only
00049       TMLastStationOptimizedBarrelLowPtTight = 23  // combination of TMLastStation and TMOneStation but with low pT optimization in barrel only
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    //                               Support functions
00062    // 
00063    enum AlgorithmType { TMLastStation, TM2DCompatibility, TMOneStation };
00064    
00065    // specialized GoodMuon functions called from main wrapper
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,//this is what we had originally
00082                     bool   applyAlsoAngularCuts = false);
00083 
00084    bool isTightMuon(const reco::Muon&, const reco::Vertex&);
00085    
00086    // determine if station was crossed well withing active volume
00087    unsigned int RequiredStationMask( const reco::Muon& muon,
00088                                      double maxChamberDist,
00089                                      double maxChamberDistPull,
00090                                      reco::Muon::ArbitrationType arbitrationType );
00091 
00092    // ------------ method to return the calo compatibility for a track with matched muon info  ------------
00093    float caloCompatibility(const reco::Muon& muon);
00094 
00095    // ------------ method to calculate the segment compatibility for a track with matched muon info  ------------
00096    float segmentCompatibility(const reco::Muon& muon,reco::Muon::ArbitrationType arbitrationType = reco::Muon::SegmentAndTrackArbitration);
00097    
00098    // Check if two muon trajectory overlap
00099    // The overlap is performed by comparing distance between two muon
00100    // trajectories if they cross the same muon chamber. Trajectories 
00101    // overlap if distance/uncertainty is smaller than allowed pullX 
00102    // and pullY
00103    bool overlap( const reco::Muon& muon1, const reco::Muon& muon2, 
00104                  double pullX = 1.0, double pullY = 1.0, bool checkAdjacentChambers = false);
00105 
00108    int sharedSegments( const reco::Muon& muon1, const reco::Muon& muon2, 
00109                        unsigned int segmentArbitrationMask = reco::MuonSegmentMatch::BestInChamberByDR ) ;
00110 
00111 }
00112 #endif