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 GsfEleFull5x5SigmaIEtaIEtaCut : public CutApplicatorBase {
0005 public:
0006   GsfEleFull5x5SigmaIEtaIEtaCut(const edm::ParameterSet& c);
0007 
0008   result_type operator()(const reco::GsfElectronPtr&) const final;
0009 
0010   double value(const reco::CandidatePtr& cand) const final;
0011 
0012   CandidateType candidateType() const final { return ELECTRON; }
0013 
0014 private:
0015   float _full5x5SigmaIEtaIEtaCutValueEB;
0016   float _full5x5SigmaIEtaIEtaCutValueEE;
0017   float _barrelCutOff;
0018 };
0019 
0020 DEFINE_EDM_PLUGIN(CutApplicatorFactory, GsfEleFull5x5SigmaIEtaIEtaCut, "GsfEleFull5x5SigmaIEtaIEtaCut");
0021 
0022 GsfEleFull5x5SigmaIEtaIEtaCut::GsfEleFull5x5SigmaIEtaIEtaCut(const edm::ParameterSet& c)
0023     : CutApplicatorBase(c),
0024       _full5x5SigmaIEtaIEtaCutValueEB(c.getParameter<double>("full5x5SigmaIEtaIEtaCutValueEB")),
0025       _full5x5SigmaIEtaIEtaCutValueEE(c.getParameter<double>("full5x5SigmaIEtaIEtaCutValueEE")),
0026       _barrelCutOff(c.getParameter<double>("barrelCutOff")) {}
0027 
0028 CutApplicatorBase::result_type GsfEleFull5x5SigmaIEtaIEtaCut::operator()(const reco::GsfElectronPtr& cand) const {
0029   // Figure out the cut value
0030   const float full5x5SigmaIEtaIEtaCutValue =
0031       (std::abs(cand->superCluster()->position().eta()) < _barrelCutOff ? _full5x5SigmaIEtaIEtaCutValueEB
0032                                                                         : _full5x5SigmaIEtaIEtaCutValueEE);
0033 
0034   // Apply the cut and return the result
0035   return cand->full5x5_sigmaIetaIeta() < full5x5SigmaIEtaIEtaCutValue;
0036 }
0037 
0038 double GsfEleFull5x5SigmaIEtaIEtaCut::value(const reco::CandidatePtr& cand) const {
0039   reco::GsfElectronPtr ele(cand);
0040   return ele->full5x5_sigmaIetaIeta();
0041 }