Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:24:04

0001 #ifndef PhysicsTools_PatUtils_MuonSelector_h
0002 #define PhysicsTools_PatUtils_MuonSelector_h
0003 
0004 /**
0005     \class pat::MuonSelector MuonSelector.h "PhysicsTools/PatUtils/MuonSelector.h"
0006     \brief Selects good muons
0007 
0008     The muon selector returns a flag (see pat::ParticleStatus) based on one of the possible
0009     selections: reconstruction-based (global muons) or muId based (various algorithms),
0010     or custom (user-defined set of cuts). This is driven by the configuration parameters 
0011     (see the PATMuonCleaner documentation for configuration details).
0012     
0013     The parameters are passed to the selector through an MuonSelection struct.
0014     (An adapter exists for use in CMSSW: reco::modules::ParameterAdapter< pat::MuonSelector >.)
0015 
0016     \author F.J. Ronga (ETH Zurich)
0017     \version $Id: MuonSelector.h,v 1.7 2008/10/10 13:59:06 lowette Exp $
0018 */
0019 
0020 #include <string>
0021 
0022 #include "DataFormats/MuonReco/interface/Muon.h"
0023 
0024 #include "PhysicsTools/PatUtils/interface/ParticleCode.h"
0025 #include "DataFormats/MuonReco/interface/MuonSelectors.h"
0026 
0027 namespace pat {
0028 
0029   /// Structure defining the muon selection
0030   struct MuonSelection {
0031     std::string selectionType;  ///< Choose selection type (see PATMuonCleaner)
0032 
0033     /// @name Cuts for "custom" selection type:
0034     //@{
0035     double dPbyPmax;
0036     double chi2max;
0037     int nHitsMin;
0038     //@}
0039 
0040     /// @name Option for "muId" selection type:
0041     //@{
0042     muon::SelectionType flag;
0043     double minCaloCompatibility;
0044     double minSegmentCompatibility;
0045     //@}
0046   };
0047 
0048   class MuonSelector {
0049   public:
0050     MuonSelector(const MuonSelection& cfg) : config_(cfg) {}
0051     ~MuonSelector() {}
0052 
0053     /// Returns 0 if muon matches criteria, a flag otherwise.
0054     /// Criteria depend on the selector's configuration.
0055     const pat::ParticleStatus filter(const unsigned int& index, const edm::View<reco::Muon>& muons) const;
0056 
0057   private:
0058     MuonSelection config_;
0059 
0060     /// Full-fledged selection based on SusyAnalyser
0061     const pat::ParticleStatus customSelection_(const unsigned int& index, const edm::View<reco::Muon>& muons) const;
0062     const pat::ParticleStatus muIdSelection_(const unsigned int& index, const edm::View<reco::Muon>& muons) const;
0063 
0064   };  // class
0065 }  // namespace pat
0066 
0067 #endif