CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
GsfEleTrkPtIsoRhoCut.cc
Go to the documentation of this file.
7 
9 public:
11 
12  result_type operator()(const reco::GsfElectronPtr&) const final;
13 
15  void getEventContent(const edm::EventBase&) final;
16 
17  double value(const reco::CandidatePtr& cand) const final;
18 
20 
21 private:
27 
29 };
30 
32 
35  slopeTerm_(params, "slopeTerm"),
36  slopeStart_(params, "slopeStart"),
37  constTerm_(params, "constTerm"),
38  rhoEtStart_(params, "rhoEtStart"),
39  rhoEA_(params, "rhoEA") {
41  contentTags_.emplace("rho", rhoTag);
42 }
43 
45  auto rho = cc.consumes<double>(contentTags_["rho"]);
46  contentTokens_.emplace("rho", rho);
47 }
48 
50 
52  const double rho = (*rhoHandle_);
53  const float isolTrkPt = cand->dr03TkSumPt();
54 
55  const float et = cand->et();
56  const float cutValue =
57  et > slopeStart_(cand) ? slopeTerm_(cand) * (et - slopeStart_(cand)) + constTerm_(cand) : constTerm_(cand);
58 
59  const float rhoCutValue = et >= rhoEtStart_(cand) ? rhoEA_(cand) * rho : 0.;
60 
61  return isolTrkPt < cutValue + rhoCutValue;
62 }
63 
65  reco::GsfElectronPtr ele(cand);
66  return ele->dr03TkSumPt();
67 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
const edm::EventSetup & c
std::unordered_map< std::string, edm::InputTag > contentTags_
CandidateType candidateType() const final
void getEventContent(const edm::EventBase &) final
edm::Handle< double > rhoHandle_
void setConsumes(edm::ConsumesCollector &) final
GsfEleTrkPtIsoRhoCut(const edm::ParameterSet &c)
std::unordered_map< std::string, edm::EDGetToken > contentTokens_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
bool getByLabel(InputTag const &, Handle< T > &) const
Definition: EventBase.h:92
result_type operator()(const reco::GsfElectronPtr &) const final
#define DEFINE_EDM_PLUGIN(factory, type, name)
double value(const reco::CandidatePtr &cand) const final