CMS 3D CMS Logo

GsfEleEcalDrivenCut.cc
Go to the documentation of this file.
4 
6 public:
8 
9  result_type operator()(const reco::GsfElectronPtr&) const final;
10 
11  double value(const reco::CandidatePtr& cand) const final;
12 
13  CandidateType candidateType() const final {
14  return ELECTRON;
15  }
16 
17 private:
18  static bool isValidCutVal(int val);
19 
20 private:
23  const double barrelCutOff_;
24 
25 };
26 
29  "GsfEleEcalDrivenCut");
30 
31 
32 
35  ecalDrivenEB_(static_cast<EcalDrivenCode>(c.getParameter<int>("ecalDrivenEB"))),
36  ecalDrivenEE_(static_cast<EcalDrivenCode>(c.getParameter<int>("ecalDrivenEE"))),
37  barrelCutOff_(c.getParameter<double>("barrelCutOff"))
38 {
41  <<"error in constructing GsfEleEcalDrivenCut"<<std::endl
42  <<"values of ecalDrivenEB: "<<ecalDrivenEB_<<" and/or ecalDrivenEE: "<<ecalDrivenEE_<<" are invalid "<<std::endl
43  <<"allowed values are IGNORE:"<<IGNORE<<" FAIL:"<<FAIL<<" PASS:"<<PASS;
44  }
45 }
46 
47 CutApplicatorBase::result_type
50  const auto ecalDrivenRequirement = std::abs(cand->superCluster()->position().eta()) < barrelCutOff_ ?
52  if(ecalDrivenRequirement==IGNORE) return true;
53  else if(ecalDrivenRequirement==FAIL) return !cand->ecalDriven();
54  else if(ecalDrivenRequirement==PASS) return cand->ecalDriven();
55  else{
57  <<"error in "<<__FILE__<<" line "<<__LINE__<<std::endl
58  <<"default option should not be reached, code has been updated without changing the logic, this needs to be fixed";
59  }
60 }
61 
63  reco::GsfElectronPtr ele(cand);
64  return ele->ecalDriven();
65 }
66 
68 {
69  if(val==IGNORE) return true;
70  if(val==FAIL) return true;
71  if(val==PASS) return true;
72  return false;
73 }
result_type operator()(const reco::GsfElectronPtr &) const final
static bool isValidCutVal(int val)
double value(const reco::CandidatePtr &cand) const final
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
CandidateType candidateType() const final
SuperClusterRef superCluster() const override
reference to a SuperCluster
Definition: GsfElectron.h:184
GsfEleEcalDrivenCut(const edm::ParameterSet &c)
#define DEFINE_EDM_PLUGIN(factory, type, name)
bool ecalDriven() const
Definition: GsfElectron.cc:174