CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
GsfEleSCEtaMultiRangeCut.cc
Go to the documentation of this file.
3 
5 public:
7  : CutApplicatorBase(c), _absEta(c.getParameter<bool>("useAbsEta")) {
8  const std::vector<edm::ParameterSet>& ranges = c.getParameterSetVector("allowedEtaRanges");
9  for (const auto& range : ranges) {
10  const double min = range.getParameter<double>("minEta");
11  const double max = range.getParameter<double>("maxEta");
12  _ranges.emplace_back(min, max);
13  }
14  }
15 
17 
18  double value(const reco::CandidatePtr& cand) const final;
19 
21 
22 private:
23  const bool _absEta;
24  std::vector<std::pair<double, double> > _ranges;
25 };
26 
28 
30  const reco::SuperClusterRef& scref = cand->superCluster();
31  const double the_eta = (_absEta ? std::abs(scref->eta()) : scref->eta());
32  bool result = false;
33  for (const auto& range : _ranges) {
34  if (the_eta >= range.first && the_eta < range.second) {
35  result = true;
36  break;
37  }
38  }
39  return result;
40 }
41 
43  reco::GsfElectronPtr ele(cand);
44  const reco::SuperClusterRef& scref = ele->superCluster();
45  return (_absEta ? std::abs(scref->eta()) : scref->eta());
46 }
VParameterSet const & getParameterSetVector(std::string const &name) const
const edm::EventSetup & c
std::vector< std::pair< double, double > > _ranges
double value(const reco::CandidatePtr &cand) const final
GsfEleSCEtaMultiRangeCut(const edm::ParameterSet &c)
const uint16_t range(const Frame &aFrame)
tuple result
Definition: mps_fire.py:311
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
string ranges
Definition: diffTwoXMLs.py:79
edm::Ptr< Candidate > CandidatePtr
persistent reference to an object in a collection of Candidate objects
Definition: CandidateFwd.h:25
CandidateType candidateType() const final
result_type operator()(const reco::GsfElectronPtr &) const final
#define DEFINE_EDM_PLUGIN(factory, type, name)