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 "RecoEgamma/EgammaTools/interface/EBEECutValues.h"
0004 
0005 class GsfEleFull5x5E2x5OverE5x5Cut : public CutApplicatorBase {
0006 public:
0007   GsfEleFull5x5E2x5OverE5x5Cut(const edm::ParameterSet& c);
0008 
0009   result_type operator()(const reco::GsfElectronPtr&) const final;
0010 
0011   double value(const reco::CandidatePtr& cand) const final;
0012 
0013   CandidateType candidateType() const final { return ELECTRON; }
0014 
0015 private:
0016   EBEECutValues minE1x5OverE5x5Cut_;
0017   EBEECutValues minE2x5OverE5x5Cut_;
0018 };
0019 
0020 DEFINE_EDM_PLUGIN(CutApplicatorFactory, GsfEleFull5x5E2x5OverE5x5Cut, "GsfEleFull5x5E2x5OverE5x5Cut");
0021 
0022 GsfEleFull5x5E2x5OverE5x5Cut::GsfEleFull5x5E2x5OverE5x5Cut(const edm::ParameterSet& params)
0023     : CutApplicatorBase(params),
0024       minE1x5OverE5x5Cut_(params, "minE1x5OverE5x5"),
0025       minE2x5OverE5x5Cut_(params, "minE2x5OverE5x5") {}
0026 
0027 CutApplicatorBase::result_type GsfEleFull5x5E2x5OverE5x5Cut::operator()(const reco::GsfElectronPtr& cand) const {
0028   const double e5x5 = cand->full5x5_e5x5();
0029   const double e2x5OverE5x5 = e5x5 != 0 ? cand->full5x5_e2x5Max() / e5x5 : 0;
0030   const double e1x5OverE5x5 = e5x5 != 0 ? cand->full5x5_e1x5() / e5x5 : 0;
0031 
0032   return e1x5OverE5x5 > minE1x5OverE5x5Cut_(cand) || e2x5OverE5x5 > minE2x5OverE5x5Cut_(cand);
0033 }
0034 
0035 double GsfEleFull5x5E2x5OverE5x5Cut::value(const reco::CandidatePtr& cand) const {
0036   reco::GsfElectronPtr ele(cand);
0037   //btw we broke somebodies nice model of assuming every cut is 1D....
0038   //what this is returning is fairly meaningless...
0039   return ele->full5x5_e1x5() ? ele->full5x5_e2x5Max() / ele->full5x5_e1x5() : 0.;
0040 }