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 GsfEleSigmaIEtaIEtaCut : public CutApplicatorBase {
0005 public:
0006   GsfEleSigmaIEtaIEtaCut(const edm::ParameterSet& c)
0007       : CutApplicatorBase(c),
0008         _sigmaIEtaIEtaCutValueEB(c.getParameter<double>("sigmaIEtaIEtaCutValueEB")),
0009         _sigmaIEtaIEtaCutValueEE(c.getParameter<double>("sigmaIEtaIEtaCutValueEE")),
0010         _barrelCutOff(c.getParameter<double>("barrelCutOff")) {}
0011 
0012   result_type operator()(const reco::GsfElectronPtr&) const final;
0013 
0014   double value(const reco::CandidatePtr& cand) const final;
0015 
0016   CandidateType candidateType() const final { return ELECTRON; }
0017 
0018 private:
0019   const double _sigmaIEtaIEtaCutValueEB, _sigmaIEtaIEtaCutValueEE, _barrelCutOff;
0020 };
0021 
0022 DEFINE_EDM_PLUGIN(CutApplicatorFactory, GsfEleSigmaIEtaIEtaCut, "GsfEleSigmaIEtaIEtaCut");
0023 
0024 CutApplicatorBase::result_type GsfEleSigmaIEtaIEtaCut::operator()(const reco::GsfElectronPtr& cand) const {
0025   const float sigmaIEtaIEtaCutValue =
0026       (std::abs(cand->superCluster()->position().eta()) < _barrelCutOff ? _sigmaIEtaIEtaCutValueEB
0027                                                                         : _sigmaIEtaIEtaCutValueEE);
0028   return cand->sigmaIetaIeta() < sigmaIEtaIEtaCutValue;
0029 }
0030 
0031 double GsfEleSigmaIEtaIEtaCut::value(const reco::CandidatePtr& cand) const {
0032   reco::GsfElectronPtr ele(cand);
0033   return ele->sigmaIetaIeta();
0034 }