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 
18  CandidateType candidateType() const final {
19  return PHOTON;
20  }
21 
22 private:
24  bool lessThan_;
25  //cut value is constTerm + linearRhoTerm_*rho + linearPtTerm*pt + quadraticPtTerm*pt*pt
26  //note EBEECutValues & Effective areas are conceptually the same thing, both are eta
27  //binned constants, just Effective areas have arbitary rather than barrel/endcap binnng
32 
34 };
35 
36 
39  "PhoGenericRhoPtScaledCut");
40 
43  varFunc_(params.getParameter<std::string>("cutVariable")),
44  lessThan_(params.getParameter<bool>("lessThan")),
45  constTerm_(params,"constTerm"),
46  linearRhoTerm_(params.getParameter<edm::FileInPath>("effAreasConfigFile").fullPath()),
47  linearPtTerm_(params,"linearPtTerm"),
48  quadraticPtTerm_(params,"quadPtTerm")
49 {
51  contentTags_.emplace("rho",rhoTag);
52 }
53 
55  auto rho = cc.consumes<double>(contentTags_["rho"]);
56  contentTokens_.emplace("rho",rho);
57 }
58 
61 }
62 
65 operator()(const reco::PhotonPtr& pho) const{
66  const double rho = (*rhoHandle_);
67 
68  const float var = varFunc_(*pho);
69 
70  const float et = pho->et();
71  const float absEta = std::abs(pho->superCluster()->eta());
72  const float cutValue = constTerm_(pho) + linearRhoTerm_.getEffectiveArea(absEta)*rho +
73  linearPtTerm_(pho)*et + quadraticPtTerm_(pho)*et*et;
74  if(lessThan_) return var < cutValue;
75  else return var>=cutValue;
76 }
77 
79  reco::PhotonPtr pho(cand);
80  return varFunc_(*pho);
81 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
void getEventContent(const edm::EventBase &) final
std::unordered_map< std::string, edm::EDGetToken > contentTokens_
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
std::unordered_map< std::string, edm::InputTag > contentTags_
CandidateType candidateType() const final
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
ThreadSafeStringCut< StringObjectFunction< reco::Photon >, reco::Photon > varFunc_
void setConsumes(edm::ConsumesCollector &) final
et
define resolution functions of each parameter
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