Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #include "PhysicsTools/SelectorUtils/interface/CutApplicatorBase.h"
0002 #include "DataFormats/EgammaCandidates/interface/Photon.h"
0003 
0004 class PhoFull5x5SigmaIEtaIEtaCut : public CutApplicatorBase {
0005 public:
0006   PhoFull5x5SigmaIEtaIEtaCut(const edm::ParameterSet& c);
0007 
0008   result_type operator()(const reco::PhotonPtr&) const final;
0009 
0010   double value(const reco::CandidatePtr& cand) const final;
0011 
0012   CandidateType candidateType() const final { return PHOTON; }
0013 
0014 private:
0015   float _cutValueEB;
0016   float _cutValueEE;
0017   float _barrelCutOff;
0018 };
0019 
0020 DEFINE_EDM_PLUGIN(CutApplicatorFactory, PhoFull5x5SigmaIEtaIEtaCut, "PhoFull5x5SigmaIEtaIEtaCut");
0021 
0022 PhoFull5x5SigmaIEtaIEtaCut::PhoFull5x5SigmaIEtaIEtaCut(const edm::ParameterSet& c)
0023     : CutApplicatorBase(c),
0024       _cutValueEB(c.getParameter<double>("cutValueEB")),
0025       _cutValueEE(c.getParameter<double>("cutValueEE")),
0026       _barrelCutOff(c.getParameter<double>("barrelCutOff")) {}
0027 
0028 CutApplicatorBase::result_type PhoFull5x5SigmaIEtaIEtaCut::operator()(const reco::PhotonPtr& cand) const {
0029   // Figure out the cut value
0030   const float full5x5SigmaIEtaIEtaCutValue =
0031       (std::abs(cand->superCluster()->eta()) < _barrelCutOff ? _cutValueEB : _cutValueEE);
0032 
0033   // Apply the cut and return the result
0034   return cand->full5x5_sigmaIetaIeta() < full5x5SigmaIEtaIEtaCutValue;
0035 }
0036 
0037 double PhoFull5x5SigmaIEtaIEtaCut::value(const reco::CandidatePtr& cand) const {
0038   reco::PhotonPtr pho(cand);
0039   return pho->full5x5_sigmaIetaIeta();
0040 }