Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:25:06

0001 #include "PhysicsTools/SelectorUtils/interface/CutApplicatorBase.h"
0002 #include "DataFormats/EgammaCandidates/interface/GsfElectron.h"
0003 #include "CommonTools/Utils/interface/StringObjectFunction.h"
0004 #include "RecoEgamma/EgammaTools/interface/EBEECutValues.h"
0005 
0006 class GsfEleEBEECut : public CutApplicatorBase {
0007 public:
0008   GsfEleEBEECut(const edm::ParameterSet& c)
0009       : CutApplicatorBase(c), cutFormula_(c.getParameter<std::string>("cutString")), cutValue_(c, "cutValue") {}
0010 
0011   result_type operator()(const reco::GsfElectronPtr& cand) const final { return cutFormula_(*cand) < cutValue_(cand); }
0012 
0013   double value(const reco::CandidatePtr& cand) const final {
0014     reco::GsfElectronPtr ele(cand);
0015     return cutFormula_(*ele);
0016   }
0017 
0018   CandidateType candidateType() const final { return ELECTRON; }
0019 
0020 private:
0021   StringObjectFunction<reco::GsfElectron> cutFormula_;
0022   const EBEECutValuesT<double> cutValue_;
0023 };
0024 
0025 DEFINE_EDM_PLUGIN(CutApplicatorFactory, GsfEleEBEECut, "GsfEleEBEECut");