CMS 3D CMS Logo

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")) {
38  edm::InputTag rhoTag = params.getParameter<edm::InputTag>("rho");
39  contentTags_.emplace("rho", rhoTag);
40 }
41 
43  auto rho = cc.consumes<double>(contentTags_["rho"]);
44  contentTokens_.emplace("rho", rho);
45 }
46 
48  ev.getByLabel(contentTags_["rho"], rhoHandle_);
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 =
61  return isolEmHadDepth1 < cutValue + rhoConstant_ * rho;
62 }
63 
66  return ele->dr03EcalRecHitSumEt() + ele->dr03HcalTowerSumEt(1);
67 }
result_type operator()(const reco::GsfElectronPtr &) const final
std::unordered_map< std::string, edm::InputTag > contentTags_
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
EleEnergyRetriever energyRetriever_
edm::Handle< double > rhoHandle_
void getEventContent(const edm::EventBase &) final
std::unordered_map< std::string, edm::EDGetToken > contentTokens_
GsfEleEmHadD1IsoRhoCut(const edm::ParameterSet &c)
CandidateType candidateType() const final
float dr03EcalRecHitSumEt() const
Definition: GsfElectron.h:559
#define DEFINE_EDM_PLUGIN(factory, type, name)
float dr03HcalTowerSumEt(int depth=0) const
Definition: GsfElectron.h:576
void setConsumes(edm::ConsumesCollector &) final
double value(const reco::CandidatePtr &cand) const final