Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:26:59

0001 #ifndef __RecoMuon_MuonIdentification_MuonSelectorVIDWrapper_h__
0002 #define __RecoMuon_MuonIdentification_MuonSelectorVIDWrapper_h__
0003 
0004 #include "PhysicsTools/SelectorUtils/interface/CutApplicatorBase.h"
0005 #include "DataFormats/MuonReco/interface/Muon.h"
0006 #include "DataFormats/MuonReco/interface/MuonSelectors.h"
0007 #include "DataFormats/MuonReco/interface/MuonFwd.h"
0008 
0009 template <muon::SelectionType selectionType,
0010           reco::Muon::ArbitrationType arbitrationType = reco::Muon::SegmentAndTrackArbitration>
0011 class MuonSelectorVIDWrapper : public CutApplicatorBase {
0012 public:
0013   MuonSelectorVIDWrapper(const edm::ParameterSet& c) : CutApplicatorBase(c) {}
0014 
0015   double value(const reco::CandidatePtr& cand) const final {
0016     edm::Ptr<reco::Muon> mu(cand);
0017     return muon::isGoodMuon(*mu, selectionType, arbitrationType);
0018   }
0019 
0020   result_type operator()(const edm::Ptr<reco::Muon>& muon) const final {
0021     return muon::isGoodMuon(*muon, selectionType, arbitrationType);
0022   }
0023 
0024   CandidateType candidateType() const final { return MUON; }
0025 };
0026 
0027 #endif