CMS 3D CMS Logo

PhoGenericRhoPtScaledCut.cc
Go to the documentation of this file.
7 
9 public:
11 
12  result_type operator()(const reco::PhotonPtr&) const final;
13 
15  void getEventContent(const edm::EventBase&) final;
16 
17  double value(const reco::CandidatePtr& cand) const final;
18 
20 
21 private:
23  bool lessThan_;
24  //cut value is constTerm + linearRhoTerm_*rho + linearPtTerm*pt + quadraticPtTerm*pt*pt
25  //note EBEECutValues & Effective areas are conceptually the same thing, both are eta
26  //binned constants, just Effective areas have arbitary rather than barrel/endcap binnng
31 
33 };
34 
36 
39  varFunc_(params.getParameter<std::string>("cutVariable")),
40  lessThan_(params.getParameter<bool>("lessThan")),
41  constTerm_(params, "constTerm"),
42  linearRhoTerm_(params.getParameter<edm::FileInPath>("effAreasConfigFile").fullPath()),
43  linearPtTerm_(params, "linearPtTerm"),
44  quadraticPtTerm_(params, "quadPtTerm") {
45  edm::InputTag rhoTag = params.getParameter<edm::InputTag>("rho");
46  contentTags_.emplace("rho", rhoTag);
47 }
48 
50  auto rho = cc.consumes<double>(contentTags_["rho"]);
51  contentTokens_.emplace("rho", rho);
52 }
53 
55  ev.getByLabel(contentTags_["rho"], rhoHandle_);
56 }
57 
59  const double rho = (*rhoHandle_);
60 
61  const float var = varFunc_(*pho);
62 
63  const float et = pho->et();
64  const float absEta = std::abs(pho->superCluster()->eta());
65  const float cutValue = constTerm_(pho) + linearRhoTerm_.getEffectiveArea(absEta) * rho + linearPtTerm_(pho) * et +
66  quadraticPtTerm_(pho) * et * et;
67  if (lessThan_)
68  return var < cutValue;
69  else
70  return var >= cutValue;
71 }
72 
74  reco::PhotonPtr pho(cand);
75  return varFunc_(*pho);
76 }
std::unordered_map< std::string, edm::InputTag > contentTags_
void getEventContent(const edm::EventBase &) final
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
PhoGenericRhoPtScaledCut(const edm::ParameterSet &c)
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
const float getEffectiveArea(float eta) const
result_type operator()(const reco::PhotonPtr &) const final
std::unordered_map< std::string, edm::EDGetToken > contentTokens_
ThreadSafeFunctor< StringObjectFunction< reco::Photon > > varFunc_
HLT enums.
#define DEFINE_EDM_PLUGIN(factory, type, name)