CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MinPtCutInEtaRanges.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 minEta = range.getParameter<double>("minEta");
12  const double maxEta = range.getParameter<double>("maxEta");
13  const double minPt = range.getParameter<double>("minPt");
14  _ranges.emplace_back(minEta,maxEta);
15  _minPt.push_back(minPt);
16  }
17  }
18 
19  result_type asCandidate(const argument_type&) const override final;
20 
21 private:
22  const bool _absEta;
23  std::vector<std::pair<double,double> > _ranges;
24  std::vector<double> _minPt; // indexed as above
25 };
26 
28  "MinPtCutInEtaRanges");
29 
30 CutApplicatorBase::result_type
31 MinPtCutInEtaRanges::
32 asCandidate(const argument_type& cand) const{
33  const double the_eta = ( _absEta ? std::abs(cand->eta()) : cand->eta() );
34  bool result = false;
35  for( unsigned i = 0; i < _ranges.size(); ++i ) {
36  const auto& range = _ranges[i];
37  if( the_eta >= range.first && the_eta < range.second &&
38  cand->pt() > _minPt[i] ) {
39  result = true; break;
40  }
41  }
42  return result;
43 }
int i
Definition: DBlmapReader.cc:9
VParameterSet const & getParameterSetVector(std::string const &name) const
result_type asCandidate(const argument_type &) const overridefinal
MinPtCutInEtaRanges(const edm::ParameterSet &c)
double maxEta
std::vector< double > _minPt
tuple result
Definition: query.py:137
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
string ranges
Definition: diffTwoXMLs.py:78
string const
Definition: compareJSON.py:14
#define private
Definition: FWFileEntry.h:17
#define DEFINE_EDM_PLUGIN(factory, type, name)
std::vector< std::pair< double, double > > _ranges