CMS 3D CMS Logo

Cuts.cc
Go to the documentation of this file.
3 
4 #include <cmath>
5 #include <sstream>
6 
7 using namespace std;
8 using namespace muonisolation;
9 
10 Cuts::Cuts(const edm::ParameterSet& pset) {
11  vector<double> etaBounds = pset.getParameter<std::vector<double> >("EtaBounds");
12  vector<double> coneSizes = pset.getParameter<std::vector<double> >("ConeSizes");
13  vector<double> thresholds = pset.getParameter<std::vector<double> >("Thresholds");
14  init(etaBounds, coneSizes, thresholds);
15 }
16 
17 Cuts::Cuts(const vector<double>& etaBounds, const vector<double>& coneSizes, const vector<double>& thresholds) {
18  init(etaBounds, coneSizes, thresholds);
19 }
20 
21 void Cuts::init(const vector<double>& etaBounds, const vector<double>& coneSizes, const vector<double>& thresholds) {
22  double minEta = 0.;
23  double coneSize = 0;
24  double threshold = 0;
25  unsigned int nEta = etaBounds.size();
26  for (unsigned int i = 0; i < nEta; i++) {
27  if (i > 0)
28  minEta = etaBounds[i - 1];
29  double maxEta = etaBounds[i];
30  if (i < coneSizes.size())
31  coneSize = coneSizes[i];
32  if (i < thresholds.size())
34 
36 
37  theCuts.push_back(cut);
38  }
39 }
40 
41 const Cuts::CutSpec& Cuts::operator()(double eta) const {
42  double absEta = fabs(eta);
43  unsigned int nCuts = theCuts.size();
44  unsigned int idx_eta = nCuts - 1;
45  for (unsigned int i = 0; i < nCuts; i++) {
46  if (absEta < theCuts[i].etaRange.max()) {
47  idx_eta = i;
48  break;
49  }
50  }
51  return theCuts[idx_eta];
52 }
53 
55  std::ostringstream result;
56  typedef std::vector<CutSpec>::const_iterator IT;
57  result << "Cuts : " << std::endl;
58  for (IT it = theCuts.begin(), itEnd = theCuts.end(); it < itEnd; ++it) {
59  result << "eta: " << (*it).etaRange << ", cone: " << (*it).conesize << ", cut: " << (*it).threshold << std::endl;
60  }
61  return result.str();
62 }
init
int init
Definition: HydjetWrapper.h:64
mps_fire.i
i
Definition: mps_fire.py:355
particleFlowZeroSuppressionECAL_cff.thresholds
thresholds
Definition: particleFlowZeroSuppressionECAL_cff.py:31
generateTowerEtThresholdLUT.etaRange
etaRange
Definition: generateTowerEtThresholdLUT.py:55
TkAlMuonSelectors_cfi.cut
cut
Definition: TkAlMuonSelectors_cfi.py:5
HLT_2018_cff.coneSize
coneSize
Definition: HLT_2018_cff.py:49353
PVValHelper::eta
Definition: PVValidationHelpers.h:69
maxEta
double maxEta
Definition: PFJetBenchmarkAnalyzer.cc:76
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:36
HLT_2018_cff.nEta
nEta
Definition: HLT_2018_cff.py:5271
IT
std::vector< LinkConnSpec >::const_iterator IT
Definition: TriggerBoardSpec.cc:5
edm::print
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
muonisolation
Definition: CandViewExtractor.h:16
std
Definition: JetResolutionObject.h:76
mps_fire.result
result
Definition: mps_fire.py:303
ParameterSet.h
muonisolation::Range< double >
remoteMonitoring_LED_IterMethod_cfg.threshold
threshold
Definition: remoteMonitoring_LED_IterMethod_cfg.py:426
EgHLTOffEleSelection_cfi.minEta
minEta
Definition: EgHLTOffEleSelection_cfi.py:11
muonisolation::Cuts::CutSpec
Definition: Cuts.h:16
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
Cuts.h