CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
GsfEleEmHadD1IsoRhoCut.cc
Go to the documentation of this file.
5 
7 public:
9 
10  result_type operator()(const reco::GsfElectronPtr&) const final;
11 
13  void getEventContent(const edm::EventBase&) final;
14 
15  double value(const reco::CandidatePtr& cand) const final;
16 
18 
19 private:
20  float rhoConstant_;
25 
27 };
28 
30 
33  rhoConstant_(params.getParameter<double>("rhoConstant")),
34  slopeTerm_(params, "slopeTerm"),
35  slopeStart_(params, "slopeStart"),
36  constTerm_(params, "constTerm"),
37  energyRetriever_(params.getParameter<std::string>("energyType")) {
39  contentTags_.emplace("rho", rhoTag);
40 }
41 
43  auto rho = cc.consumes<double>(contentTags_["rho"]);
44  contentTokens_.emplace("rho", rho);
45 }
46 
49 }
50 
52  const double rho = (*rhoHandle_);
53 
54  const float isolEmHadDepth1 = cand->dr03EcalRecHitSumEt() + cand->dr03HcalTowerSumEt(1);
55 
56  const float sinTheta = cand->p() != 0. ? cand->pt() / cand->p() : 0.;
57  const float et = energyRetriever_(*cand) * sinTheta;
58 
59  const float cutValue =
60  et > slopeStart_(cand) ? slopeTerm_(cand) * (et - slopeStart_(cand)) + constTerm_(cand) : constTerm_(cand);
61  return isolEmHadDepth1 < cutValue + rhoConstant_ * rho;
62 }
63 
65  reco::GsfElectronPtr ele(cand);
66  return ele->dr03EcalRecHitSumEt() + ele->dr03HcalTowerSumEt(1);
67 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
result_type operator()(const reco::GsfElectronPtr &) const final
const edm::EventSetup & c
std::unordered_map< std::string, edm::InputTag > contentTags_
EleEnergyRetriever energyRetriever_
bool ev
edm::Handle< double > rhoHandle_
void getEventContent(const edm::EventBase &) final
std::unordered_map< std::string, edm::EDGetToken > contentTokens_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
GsfEleEmHadD1IsoRhoCut(const edm::ParameterSet &c)
bool getByLabel(InputTag const &, Handle< T > &) const
Definition: EventBase.h:92
CandidateType candidateType() const final
#define DEFINE_EDM_PLUGIN(factory, type, name)
void setConsumes(edm::ConsumesCollector &) final
double value(const reco::CandidatePtr &cand) const final