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 
14 
15 private:
16  static bool isValidCutVal(int val);
17 
18 private:
19  enum EcalDrivenCode { IGNORE = -1, FAIL = 0, PASS = 1 };
21  const double barrelCutOff_;
22 };
23 
25 
28  ecalDrivenEB_(static_cast<EcalDrivenCode>(c.getParameter<int>("ecalDrivenEB"))),
29  ecalDrivenEE_(static_cast<EcalDrivenCode>(c.getParameter<int>("ecalDrivenEE"))),
30  barrelCutOff_(c.getParameter<double>("barrelCutOff")) {
33  << "error in constructing GsfEleEcalDrivenCut" << std::endl
34  << "values of ecalDrivenEB: " << ecalDrivenEB_ << " and/or ecalDrivenEE: " << ecalDrivenEE_ << " are invalid "
35  << std::endl
36  << "allowed values are IGNORE:" << IGNORE << " FAIL:" << FAIL << " PASS:" << PASS;
37  }
38 }
39 
41  const auto ecalDrivenRequirement =
42  std::abs(cand->superCluster()->position().eta()) < barrelCutOff_ ? ecalDrivenEB_ : ecalDrivenEE_;
43  if (ecalDrivenRequirement == IGNORE)
44  return true;
45  else if (ecalDrivenRequirement == FAIL)
46  return !cand->ecalDriven();
47  else if (ecalDrivenRequirement == PASS)
48  return cand->ecalDriven();
49  else {
50  throw edm::Exception(edm::errors::LogicError) << "error in " << __FILE__ << " line " << __LINE__ << std::endl
51  << "default option should not be reached, code has been updated "
52  "without changing the logic, this needs to be fixed";
53  }
54 }
55 
58  return ele->ecalDriven();
59 }
60 
62  if (val == IGNORE)
63  return true;
64  if (val == FAIL)
65  return true;
66  if (val == PASS)
67  return true;
68  return false;
69 }
GsfEleEcalDrivenCut::FAIL
Definition: GsfEleEcalDrivenCut.cc:19
GsfEleEcalDrivenCut::value
double value(const reco::CandidatePtr &cand) const final
Definition: GsfEleEcalDrivenCut.cc:56
GsfEleEcalDrivenCut::IGNORE
Definition: GsfEleEcalDrivenCut.cc:19
GsfEleEcalDrivenCut::barrelCutOff_
const double barrelCutOff_
Definition: GsfEleEcalDrivenCut.cc:21
edm::errors::LogicError
Definition: EDMException.h:37
GsfEleEcalDrivenCut::PASS
Definition: GsfEleEcalDrivenCut.cc:19
GsfEleEcalDrivenCut
Definition: GsfEleEcalDrivenCut.cc:5
GsfEleEcalDrivenCut::operator()
result_type operator()(const reco::GsfElectronPtr &) const final
Definition: GsfEleEcalDrivenCut.cc:40
watchdog.const
const
Definition: watchdog.py:83
candidate_functions::CandidateCut::result_type
bool result_type
Definition: CandidateCut.h:11
GsfEleEcalDrivenCut::isValidCutVal
static bool isValidCutVal(int val)
Definition: GsfEleEcalDrivenCut.cc:61
GsfElectron.h
DEFINE_EDM_PLUGIN
#define DEFINE_EDM_PLUGIN(factory, type, name)
Definition: PluginFactory.h:124
edm::ParameterSet
Definition: ParameterSet.h:36
CutApplicatorBase::CandidateType
CandidateType
Definition: CutApplicatorBase.h:47
edmplugin::PluginFactory
Definition: PluginFactory.h:34
GsfEleEcalDrivenCut::GsfEleEcalDrivenCut
GsfEleEcalDrivenCut(const edm::ParameterSet &c)
Definition: GsfEleEcalDrivenCut.cc:26
cand
Definition: decayParser.h:34
createfilelist.int
int
Definition: createfilelist.py:10
GsfTrack.h
reco::GsfElectron::ecalDriven
bool ecalDriven() const
Definition: GsfElectron.cc:168
GsfEleEcalDrivenCut::candidateType
CandidateType candidateType() const final
Definition: GsfEleEcalDrivenCut.cc:13
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
edm::Ptr< reco::GsfElectron >
GsfEleEcalDrivenCut::ecalDrivenEE_
const int ecalDrivenEE_
Definition: GsfEleEcalDrivenCut.cc:20
CutApplicatorBase
Definition: CutApplicatorBase.h:45
heppy_batch.val
val
Definition: heppy_batch.py:351
Exception
Definition: hltDiff.cc:246
GsfEleEcalDrivenCut::ecalDrivenEB_
const int ecalDrivenEB_
Definition: GsfEleEcalDrivenCut.cc:20
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
CutApplicatorBase.h
CutApplicatorBase::ELECTRON
Definition: CutApplicatorBase.h:47
edm::errors::Configuration
Definition: EDMException.h:36
GsfEleEcalDrivenCut::EcalDrivenCode
EcalDrivenCode
Definition: GsfEleEcalDrivenCut.cc:19