CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Protected Attributes
l1tp2::ParametricCalibration Class Reference

#include <ParametricCalibration.h>

Public Member Functions

float operator() (const float pt, const float abseta) const
 
 ParametricCalibration ()
 
 ParametricCalibration (const edm::ParameterSet &cpset)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Protected Attributes

std::vector< float > etas
 
std::vector< float > pts
 
std::vector< float > scales
 

Detailed Description

Definition at line 12 of file ParametricCalibration.h.

Constructor & Destructor Documentation

◆ ParametricCalibration() [1/2]

l1tp2::ParametricCalibration::ParametricCalibration ( )
inline

Definition at line 14 of file ParametricCalibration.h.

14 {}

◆ ParametricCalibration() [2/2]

l1tp2::ParametricCalibration::ParametricCalibration ( const edm::ParameterSet cpset)

Definition at line 4 of file ParametricCalibration.cc.

4  {
5  std::vector<double> etaBins = cpset.getParameter<std::vector<double>>("etaBins");
6  std::vector<double> ptBins = cpset.getParameter<std::vector<double>>("ptBins");
7  std::vector<double> scale = cpset.getParameter<std::vector<double>>("scale");
8  etas.insert(etas.end(), etaBins.begin(), etaBins.end());
9  pts.insert(pts.end(), ptBins.begin(), ptBins.end());
10  scales.insert(scales.end(), scale.begin(), scale.end());
11 
12  if (pts.size() * etas.size() != scales.size())
13  throw cms::Exception("Configuration",
14  "Bad number of calibration scales, pts.size() * etas.size() != scales.size()");
15  }

References HLT_FULL_cff::etaBins, etas, edm::ParameterSet::getParameter(), L1EGammaCrystalsEmulatorProducer_cfi::ptBins, pts, L1EGammaCrystalsEmulatorProducer_cfi::scale, and scales.

Member Function Documentation

◆ fillDescriptions()

void l1tp2::ParametricCalibration::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 18 of file ParametricCalibration.cc.

18  {
20  desc.setComment("");
21  desc.addUntracked<std::vector<double>>("etaBins", std::vector<double>{});
22  desc.addUntracked<std::vector<double>>("ptBins", std::vector<double>{});
23  desc.addUntracked<std::vector<double>>("scale", std::vector<double>{});
24  descriptions.add("createIdealTkAlRecords", desc);
25  }

References edm::ConfigurationDescriptions::add(), and submitPVResolutionJobs::desc.

◆ operator()()

float l1tp2::ParametricCalibration::operator() ( const float  pt,
const float  abseta 
) const

Definition at line 27 of file ParametricCalibration.cc.

27  {
28  int ptBin = -1;
29  for (unsigned int i = 0, n = pts.size(); i < n; ++i) {
30  if (pt < pts[i]) {
31  ptBin = i;
32  break;
33  }
34  }
35  int etaBin = -1;
36  for (unsigned int i = 0, n = etas.size(); i < n; ++i) {
37  if (abseta < etas[i]) {
38  etaBin = i;
39  break;
40  }
41  }
42 
43  if (ptBin == -1 || etaBin == -1)
44  return 1;
45  else
46  return scales[ptBin * etas.size() + etaBin];
47  }

References etaBin(), etas, mps_fire::i, dqmiodumpmetadata::n, DiDispStaMuonMonitor_cfi::pt, muonRecoAnalyzer_cfi::ptBin, pts, and scales.

Member Data Documentation

◆ etas

std::vector<float> l1tp2::ParametricCalibration::etas
protected

Definition at line 21 of file ParametricCalibration.h.

Referenced by operator()(), and ParametricCalibration().

◆ pts

std::vector<float> l1tp2::ParametricCalibration::pts
protected

Definition at line 21 of file ParametricCalibration.h.

Referenced by operator()(), and ParametricCalibration().

◆ scales

std::vector<float> l1tp2::ParametricCalibration::scales
protected

Definition at line 21 of file ParametricCalibration.h.

Referenced by operator()(), and ParametricCalibration().

mps_fire.i
i
Definition: mps_fire.py:428
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
L1EGammaCrystalsEmulatorProducer_cfi.scale
scale
Definition: L1EGammaCrystalsEmulatorProducer_cfi.py:10
etaBin
int etaBin(const l1t::HGCalMulticluster *cl)
Definition: L1EGammaEEProducer.cc:19
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
HLT_FULL_cff.etaBins
etaBins
Definition: HLT_FULL_cff.py:15267
l1tp2::ParametricCalibration::pts
std::vector< float > pts
Definition: ParametricCalibration.h:21
muonRecoAnalyzer_cfi.ptBin
ptBin
Definition: muonRecoAnalyzer_cfi.py:45
l1tp2::ParametricCalibration::scales
std::vector< float > scales
Definition: ParametricCalibration.h:21
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
l1tp2::ParametricCalibration::etas
std::vector< float > etas
Definition: ParametricCalibration.h:21
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
cms::Exception
Definition: Exception.h:70
L1EGammaCrystalsEmulatorProducer_cfi.ptBins
ptBins
Definition: L1EGammaCrystalsEmulatorProducer_cfi.py:9