CMS 3D CMS Logo

GsfEleValueMapIsoRhoCut.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 getRhoCorr(const reco::GsfElectronPtr& cand) const;
21 
27 
28  bool useRho_;
29 
32 };
33 
35 
38  slopeTerm_(params, "slopeTerm"),
39  slopeStart_(params, "slopeStart"),
40  constTerm_(params, "constTerm"),
41  rhoEtStart_(params, "rhoEtStart"),
42  rhoEA_(params, "rhoEA") {
43  auto rho = params.getParameter<edm::InputTag>("rho");
44  if (!rho.label().empty()) {
45  useRho_ = true;
46  contentTags_.emplace("rho", rho);
47  } else
48  useRho_ = false;
49 
50  contentTags_.emplace("value", params.getParameter<edm::InputTag>("value"));
51 }
52 
54  if (useRho_)
55  contentTokens_.emplace("rho", cc.consumes<double>(contentTags_["rho"]));
56  contentTokens_.emplace("value", cc.consumes<edm::ValueMap<float> >(contentTags_["value"]));
57 }
58 
60  if (useRho_)
61  ev.getByLabel(contentTags_["rho"], rhoHandle_);
62  ev.getByLabel(contentTags_["value"], valueHandle_);
63 }
64 
66  const float val = (*valueHandle_)[cand];
67 
68  const float et = cand->et();
69  const float cutValue =
71  const float rhoCutValue = getRhoCorr(cand);
72 
73  return val < cutValue + rhoCutValue;
74 }
75 
78  return (*valueHandle_)[cand];
79 }
80 
82  if (!useRho_)
83  return 0.;
84  else {
85  const double rho = (*rhoHandle_);
86  return cand->et() >= rhoEtStart_(cand) ? rhoEA_(cand) * rho : 0.;
87  }
88 }
GsfEleValueMapIsoRhoCut::GsfEleValueMapIsoRhoCut
GsfEleValueMapIsoRhoCut(const edm::ParameterSet &c)
Definition: GsfEleValueMapIsoRhoCut.cc:36
GsfEleValueMapIsoRhoCut::valueHandle_
edm::Handle< edm::ValueMap< float > > valueHandle_
Definition: GsfEleValueMapIsoRhoCut.cc:31
CalibrationSummaryClient_cfi.params
params
Definition: CalibrationSummaryClient_cfi.py:14
EBEECutValues.h
GsfEleValueMapIsoRhoCut
Definition: GsfEleValueMapIsoRhoCut.cc:6
GsfEleValueMapIsoRhoCut::rhoEA_
EBEECutValues rhoEA_
Definition: GsfEleValueMapIsoRhoCut.cc:26
watchdog.const
const
Definition: watchdog.py:83
edm::Handle< double >
GsfEleValueMapIsoRhoCut::useRho_
bool useRho_
Definition: GsfEleValueMapIsoRhoCut.cc:28
CutApplicatorWithEventContentBase::contentTags_
std::unordered_map< std::string, edm::InputTag > contentTags_
Definition: CutApplicatorWithEventContentBase.h:35
candidate_functions::CandidateCut::result_type
bool result_type
Definition: CandidateCut.h:11
GsfEleValueMapIsoRhoCut::value
double value(const reco::CandidatePtr &cand) const final
Definition: GsfEleValueMapIsoRhoCut.cc:76
GsfEleValueMapIsoRhoCut::getRhoCorr
float getRhoCorr(const reco::GsfElectronPtr &cand) const
Definition: GsfEleValueMapIsoRhoCut.cc:81
GsfEleValueMapIsoRhoCut::slopeStart_
EBEECutValues slopeStart_
Definition: GsfEleValueMapIsoRhoCut.cc:23
CutApplicatorWithEventContentBase.h
GsfElectron.h
DEFINE_EDM_PLUGIN
#define DEFINE_EDM_PLUGIN(factory, type, name)
Definition: PluginFactory.h:124
DDAxes::rho
edm::ParameterSet
Definition: ParameterSet.h:47
CutApplicatorBase::CandidateType
CandidateType
Definition: CutApplicatorBase.h:47
edmplugin::PluginFactory
Definition: PluginFactory.h:34
cand
Definition: decayParser.h:32
GsfEleValueMapIsoRhoCut::getEventContent
void getEventContent(const edm::EventBase &) final
Definition: GsfEleValueMapIsoRhoCut.cc:59
EgHLTOffHistBins_cfi.et
et
Definition: EgHLTOffHistBins_cfi.py:8
cc
GsfEleValueMapIsoRhoCut::rhoEtStart_
EBEECutValues rhoEtStart_
Definition: GsfEleValueMapIsoRhoCut.cc:25
edm::Ptr< reco::GsfElectron >
ValueMap.h
heppy_batch.val
val
Definition: heppy_batch.py:351
GsfEleValueMapIsoRhoCut::rhoHandle_
edm::Handle< double > rhoHandle_
Definition: GsfEleValueMapIsoRhoCut.cc:30
GsfEleValueMapIsoRhoCut::constTerm_
EBEECutValues constTerm_
Definition: GsfEleValueMapIsoRhoCut.cc:24
edm::ValueMap< float >
ev
bool ev
Definition: Hydjet2Hadronizer.cc:97
CutApplicatorWithEventContentBase::contentTokens_
std::unordered_map< std::string, edm::EDGetToken > contentTokens_
Definition: CutApplicatorWithEventContentBase.h:40
edm::EventBase
Definition: EventBase.h:46
GsfEleValueMapIsoRhoCut::slopeTerm_
EBEECutValues slopeTerm_
Definition: GsfEleValueMapIsoRhoCut.cc:22
EBEECutValuesT< double >
GsfEleValueMapIsoRhoCut::candidateType
CandidateType candidateType() const final
Definition: GsfEleValueMapIsoRhoCut.cc:17
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:56
CutApplicatorBase::ELECTRON
Definition: CutApplicatorBase.h:47
edm::InputTag
Definition: InputTag.h:15
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
CutApplicatorWithEventContentBase
Definition: CutApplicatorWithEventContentBase.h:19
GsfEleValueMapIsoRhoCut::operator()
result_type operator()(const reco::GsfElectronPtr &) const final
Definition: GsfEleValueMapIsoRhoCut.cc:65
GsfEleValueMapIsoRhoCut::setConsumes
void setConsumes(edm::ConsumesCollector &) final
Definition: GsfEleValueMapIsoRhoCut.cc:53