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 #include "DataFormats/Common/interface/ValueMap.h"
0004 #include "RecoEgamma/EgammaTools/interface/EBEECutValues.h"
0005 
0006 class GsfEleFull5x5SigmaIEtaIEtaWithSatCut : public CutApplicatorBase {
0007 public:
0008   GsfEleFull5x5SigmaIEtaIEtaWithSatCut(const edm::ParameterSet& c);
0009 
0010   result_type operator()(const reco::GsfElectronPtr&) const final;
0011 
0012   double value(const reco::CandidatePtr& cand) const final;
0013 
0014   CandidateType candidateType() const final { return ELECTRON; }
0015 
0016 private:
0017   EBEECutValues maxSigmaIEtaIEtaCut_;
0018   EBEECutValuesInt maxNrSatCrysIn5x5Cut_;
0019 };
0020 
0021 DEFINE_EDM_PLUGIN(CutApplicatorFactory, GsfEleFull5x5SigmaIEtaIEtaWithSatCut, "GsfEleFull5x5SigmaIEtaIEtaWithSatCut");
0022 
0023 GsfEleFull5x5SigmaIEtaIEtaWithSatCut::GsfEleFull5x5SigmaIEtaIEtaWithSatCut(const edm::ParameterSet& params)
0024     : CutApplicatorBase(params),
0025       maxSigmaIEtaIEtaCut_(params, "maxSigmaIEtaIEta"),
0026       maxNrSatCrysIn5x5Cut_(params, "maxNrSatCrysIn5x5") {}
0027 
0028 CutApplicatorBase::result_type GsfEleFull5x5SigmaIEtaIEtaWithSatCut::operator()(const reco::GsfElectronPtr& cand) const {
0029   if (cand->nSaturatedXtals() > maxNrSatCrysIn5x5Cut_(cand))
0030     return true;
0031   else
0032     return cand->full5x5_sigmaIetaIeta() < maxSigmaIEtaIEtaCut_(cand);
0033 }
0034 
0035 double GsfEleFull5x5SigmaIEtaIEtaWithSatCut::value(const reco::CandidatePtr& cand) const {
0036   reco::GsfElectronPtr ele(cand);
0037   return ele->full5x5_sigmaIetaIeta();
0038 }