Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:34:25

0001 #include "PhysicsTools/SelectorUtils/interface/CutApplicatorBase.h"
0002 #include "DataFormats/EgammaCandidates/interface/GsfElectron.h"
0003 
0004 class GsfEleSCMaxAbsEtaCut : public CutApplicatorBase {
0005 public:
0006   GsfEleSCMaxAbsEtaCut(const edm::ParameterSet& c) : CutApplicatorBase(c), _maxEta(c.getParameter<bool>("maxEta")) {}
0007 
0008   result_type operator()(const reco::GsfElectronPtr& cand) const final {
0009     const reco::SuperClusterRef& scref = cand->superCluster();
0010     return std::abs(scref->eta()) < _maxEta;
0011   }
0012 
0013   double value(const reco::CandidatePtr& cand) const final {
0014     reco::GsfElectronPtr ele(cand);
0015     const reco::SuperClusterRef& scref = ele->superCluster();
0016     return std::abs(scref->eta());
0017   }
0018 
0019   CandidateType candidateType() const final { return ELECTRON; }
0020 
0021 private:
0022   const double _maxEta;
0023 };
0024 
0025 DEFINE_EDM_PLUGIN(CutApplicatorFactory, GsfEleSCMaxAbsEtaCut, "GsfEleSCMaxAbsEtaCut");