CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EtaMultiRangeCut.cc
Go to the documentation of this file.
2 
4 public:
7  _absEta(c.getParameter<bool>("useAbsEta")) {
8  const std::vector<edm::ParameterSet>& ranges =
9  c.getParameterSetVector("allowedEtaRanges");
10  for( const auto& range : ranges ) {
11  const double min = range.getParameter<double>("minEta");
12  const double max = range.getParameter<double>("maxEta");
13  _ranges.emplace_back(min,max);
14  }
15  }
16 
17  result_type asCandidate(const argument_type&) const override final;
18 
19 private:
20  const bool _absEta;
21  std::vector<std::pair<double,double> > _ranges;
22 };
23 
25 
26 CutApplicatorBase::result_type
27 EtaMultiRangeCut::
28 asCandidate(const argument_type& cand) const{
29  const double the_eta = ( _absEta ? std::abs(cand->eta()) : cand->eta() );
30  bool result = false;
31  for(const auto& range : _ranges ) {
32  if( the_eta >= range.first && the_eta < range.second ) {
33  result = true; break;
34  }
35  }
36  return result;
37 }
VParameterSet const & getParameterSetVector(std::string const &name) const
std::vector< std::pair< double, double > > _ranges
tuple result
Definition: query.py:137
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
EtaMultiRangeCut(const edm::ParameterSet &c)
string const
Definition: compareJSON.py:14
result_type asCandidate(const argument_type &) const overridefinal
#define private
Definition: FWFileEntry.h:17
#define DEFINE_EDM_PLUGIN(factory, type, name)