test
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  double value(const reco::CandidatePtr& cand) const override final;
21 
22  CandidateType candidateType() const override final {
23  return ELECTRON;
24  }
25 
26 private:
27  const bool _absEta;
28  std::vector<std::pair<double,double> > _ranges;
29 };
30 
33  "GsfEleSCEtaMultiRangeCut");
34 
35 CutApplicatorBase::result_type
37 operator()(const reco::GsfElectronPtr& cand) const{
38  const reco::SuperClusterRef& scref = cand->superCluster();
39  const double the_eta = ( _absEta ? std::abs(scref->eta()) : scref->eta() );
40  bool result = false;
41  for(const auto& range : _ranges ) {
42  if( the_eta >= range.first && the_eta < range.second ) {
43  result = true; break;
44  }
45  }
46  return result;
47 }
48 
50  reco::GsfElectronPtr ele(cand);
51  const reco::SuperClusterRef& scref = ele->superCluster();
52  return ( _absEta ? std::abs(scref->eta()) : scref->eta() );
53 }
double value(const reco::CandidatePtr &cand) const overridefinal
VParameterSet const & getParameterSetVector(std::string const &name) const
GsfEleSCEtaMultiRangeCut(const edm::ParameterSet &c)
tuple result
Definition: mps_fire.py:84
CandidateType candidateType() const overridefinal
result_type operator()(const reco::GsfElectronPtr &) const overridefinal
std::vector< std::pair< double, double > > _ranges
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
T min(T a, T b)
Definition: MathUtil.h:58
string ranges
Definition: diffTwoXMLs.py:78
edm::Ptr< Candidate > CandidatePtr
persistent reference to an object in a collection of Candidate objects
Definition: CandidateFwd.h:25
string const
Definition: compareJSON.py:14
#define DEFINE_EDM_PLUGIN(factory, type, name)