CMS 3D CMS Logo

GsfEleEmHadD1IsoRhoCut.cc
Go to the documentation of this file.
4 
6 
8 public:
10 
11  result_type operator()(const reco::GsfElectronPtr&) const final;
12 
14  void getEventContent(const edm::EventBase&) final;
15 
16  double value(const reco::CandidatePtr& cand) const final;
17 
18  CandidateType candidateType() const final {
19  return ELECTRON;
20  }
21 
22 private:
23  float rhoConstant_;
28 
30 
31 };
32 
35  "GsfEleEmHadD1IsoRhoCut");
36 
39  rhoConstant_(params.getParameter<double>("rhoConstant")),
40  slopeTerm_(params,"slopeTerm"),
41  slopeStart_(params,"slopeStart"),
42  constTerm_(params,"constTerm"),
43  energyRetriever_(params.getParameter<std::string>("energyType"))
44 {
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 
62  const double rho = (*rhoHandle_);
63 
64  const float isolEmHadDepth1 = cand->dr03EcalRecHitSumEt() + cand->dr03HcalDepth1TowerSumEt();
65 
66  const float sinTheta = cand->p()!=0. ? cand->pt()/cand->p() : 0.;
67  const float et = energyRetriever_(*cand)*sinTheta;
68 
69  const float cutValue = et > slopeStart_(cand) ? slopeTerm_(cand)*(et-slopeStart_(cand)) + constTerm_(cand) : constTerm_(cand);
70  return isolEmHadDepth1 < cutValue + rhoConstant_*rho;
71 }
72 
74  reco::GsfElectronPtr ele(cand);
75  return ele->dr03EcalRecHitSumEt() + ele->dr03HcalDepth1TowerSumEt();
76 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
CandidateType candidateType() const final
std::unordered_map< std::string, edm::EDGetToken > contentTokens_
EleEnergyRetriever energyRetriever_
double pt() const final
transverse momentum
bool ev
double value(const reco::CandidatePtr &cand) const final
std::unordered_map< std::string, edm::InputTag > contentTags_
edm::Handle< double > rhoHandle_
float dr03HcalDepth1TowerSumEt() const
Definition: GsfElectron.h:555
result_type operator()(const reco::GsfElectronPtr &) const final
void getEventContent(const edm::EventBase &) final
double p() const final
magnitude of momentum vector
GsfEleEmHadD1IsoRhoCut(const edm::ParameterSet &c)
et
define resolution functions of each parameter
float dr03EcalRecHitSumEt() const
Definition: GsfElectron.h:554
bool getByLabel(InputTag const &, Handle< T > &) const
Definition: EventBase.h:92
#define DEFINE_EDM_PLUGIN(factory, type, name)
void setConsumes(edm::ConsumesCollector &) final