CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GsfEleSCEtaMultiRangeCut.cc
Go to the documentation of this file.
3 
5 public:
8  _absEta(c.getParameter<bool>("useAbsEta")) {
9  const std::vector<edm::ParameterSet>& ranges =
10  c.getParameterSetVector("allowedEtaRanges");
11  for( const auto& range : ranges ) {
12  const double min = range.getParameter<double>("minEta");
13  const double max = range.getParameter<double>("maxEta");
14  _ranges.emplace_back(min,max);
15  }
16  }
17 
18  result_type operator()(const reco::GsfElectronPtr&) const override final;
19 
20  CandidateType candidateType() const override final {
21  return ELECTRON;
22  }
23 
24 private:
25  const bool _absEta;
26  std::vector<std::pair<double,double> > _ranges;
27 };
28 
31  "GsfEleSCEtaMultiRangeCut");
32 
33 CutApplicatorBase::result_type
35 operator()(const reco::GsfElectronPtr& cand) const{
36  const reco::SuperClusterRef& scref = cand->superCluster();
37  const double the_eta = ( _absEta ? std::abs(scref->eta()) : scref->eta() );
38  bool result = false;
39  for(const auto& range : _ranges ) {
40  if( the_eta >= range.first && the_eta < range.second ) {
41  result = true; break;
42  }
43  }
44  return result;
45 }
VParameterSet const & getParameterSetVector(std::string const &name) const
GsfEleSCEtaMultiRangeCut(const edm::ParameterSet &c)
CandidateType candidateType() const overridefinal
result_type operator()(const reco::GsfElectronPtr &) const overridefinal
const T & max(const T &a, const T &b)
tuple result
Definition: query.py:137
std::vector< std::pair< double, double > > _ranges
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
string ranges
Definition: diffTwoXMLs.py:78
string const
Definition: compareJSON.py:14
#define DEFINE_EDM_PLUGIN(factory, type, name)