CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GsfEleEmHadD1IsoRhoCut.cc
Go to the documentation of this file.
6 
8 
10 public:
12 
13  result_type operator()(const reco::GsfElectronPtr&) const override final;
14 
15  void setConsumes(edm::ConsumesCollector&) override final;
16  void getEventContent(const edm::EventBase&) override final;
17 
18  double value(const reco::CandidatePtr& cand) const override final;
19 
20  CandidateType candidateType() const override final {
21  return ELECTRON;
22  }
23 
24 private:
25  float rhoConstant_;
29 
30 
32 
33 };
34 
37  "GsfEleEmHadD1IsoRhoCut");
38 
41  rhoConstant_(params.getParameter<double>("rhoConstant")),
42  slopeTerm_(params,"slopeTerm"),
43  slopeStart_(params,"slopeStart"),
44  constTerm_(params,"constTerm"){
45  edm::InputTag rhoTag = params.getParameter<edm::InputTag>("rho");
46  contentTags_.emplace("rho",rhoTag);
47 
48 }
49 
51  auto rho = cc.consumes<double>(contentTags_["rho"]);
52  contentTokens_.emplace("rho",rho);
53 }
54 
57 }
58 
59 CutApplicatorBase::result_type
61 operator()(const reco::GsfElectronPtr& cand) const{
62  const double rho = (*rhoHandle_);
63 
64  const float isolEmHadDepth1 = cand->dr03EcalRecHitSumEt() + cand->dr03HcalDepth1TowerSumEt();
65 
66  const float et = cand->et();
67  const float cutValue = et > slopeStart_(cand) ? slopeTerm_(cand)*(et-slopeStart_(cand)) + constTerm_(cand) : constTerm_(cand);
68  return isolEmHadDepth1 < cutValue + rhoConstant_*rho;
69 }
70 
72  reco::GsfElectronPtr ele(cand);
73  return ele->dr03EcalRecHitSumEt() + ele->dr03HcalDepth1TowerSumEt();
74 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
CandidateType candidateType() const overridefinal
std::unordered_map< std::string, edm::EDGetToken > contentTokens_
bool ev
void getEventContent(const edm::EventBase &) overridefinal
std::unordered_map< std::string, edm::InputTag > contentTags_
edm::Handle< double > rhoHandle_
double value(const reco::CandidatePtr &cand) const overridefinal
GsfEleEmHadD1IsoRhoCut(const edm::ParameterSet &c)
string const
Definition: compareJSON.py:14
bool getByLabel(InputTag const &, Handle< T > &) const
Definition: EventBase.h:90
#define DEFINE_EDM_PLUGIN(factory, type, name)
result_type operator()(const reco::GsfElectronPtr &) const overridefinal
void setConsumes(edm::ConsumesCollector &) overridefinal