CMS 3D CMS Logo

PhoGenericRhoPtScaledCut.cc
Go to the documentation of this file.
6 
8 public:
10 
11  result_type operator()(const reco::PhotonPtr&) const final;
12 
14  void getEventContent(const edm::EventBase&) final;
15 
16  double value(const reco::CandidatePtr& cand) const final;
17 
19 
20 private:
22  bool lessThan_;
23  //cut value is constTerm + linearRhoTerm_*rho + linearPtTerm*pt + quadraticPtTerm*pt*pt
24  //note EBEECutValues & Effective areas are conceptually the same thing, both are eta
25  //binned constants, just Effective areas have arbitary rather than barrel/endcap binnng
30 
32 };
33 
35 
38  varFunc_(params.getParameter<std::string>("cutVariable")),
39  lessThan_(params.getParameter<bool>("lessThan")),
40  constTerm_(params, "constTerm"),
41  linearRhoTerm_(params.getParameter<edm::FileInPath>("effAreasConfigFile").fullPath()),
42  linearPtTerm_(params, "linearPtTerm"),
43  quadraticPtTerm_(params, "quadPtTerm") {
45  contentTags_.emplace("rho", rhoTag);
46 }
47 
49  auto rho = cc.consumes<double>(contentTags_["rho"]);
50  contentTokens_.emplace("rho", rho);
51 }
52 
55 }
56 
58  const double rho = (*rhoHandle_);
59 
60  const float var = varFunc_(*pho);
61 
62  const float et = pho->et();
63  const float absEta = std::abs(pho->superCluster()->eta());
64  const float cutValue = constTerm_(pho) + linearRhoTerm_.getEffectiveArea(absEta) * rho + linearPtTerm_(pho) * et +
65  quadraticPtTerm_(pho) * et * et;
66  if (lessThan_)
67  return var < cutValue;
68  else
69  return var >= cutValue;
70 }
71 
73  reco::PhotonPtr pho(cand);
74  return varFunc_(*pho);
75 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
std::unordered_map< std::string, edm::InputTag > contentTags_
void getEventContent(const edm::EventBase &) final
ThreadSafeStringCut< StringObjectFunction< reco::Photon >, reco::Photon > varFunc_
bool ev
PhoGenericRhoPtScaledCut(const edm::ParameterSet &c)
const float getEffectiveArea(float eta) const
edm::Handle< double > rhoHandle_
double value(const reco::CandidatePtr &cand) const final
CandidateType candidateType() const final
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
void setConsumes(edm::ConsumesCollector &) final
std::unordered_map< std::string, edm::EDGetToken > contentTokens_
bool getByLabel(InputTag const &, Handle< T > &) const
Definition: EventBase.h:92
HLT enums.
#define DEFINE_EDM_PLUGIN(factory, type, name)
result_type operator()(const reco::PhotonPtr &) const final