CMS 3D CMS Logo

SiPixelDynamicInefficiency.cc
Go to the documentation of this file.
3 
5 
6 bool SiPixelDynamicInefficiency::putPixelGeomFactor(const uint32_t& detid, double& value) {
7  std::map<unsigned int, double>::const_iterator id = m_PixelGeomFactors.find(detid);
8  if (id != m_PixelGeomFactors.end()) {
9  edm::LogError("SiPixelDynamicInefficiency") << "SiPixelDynamicInefficiency PixelGeomFactor for DetID " << detid
10  << " is already stored. Skipping this put" << std::endl;
11  return false;
12  } else
13  m_PixelGeomFactors[detid] = value;
14  return true;
15 }
16 
17 double SiPixelDynamicInefficiency::getPixelGeomFactor(const uint32_t& detid) const {
18  std::map<unsigned int, double>::const_iterator id = m_PixelGeomFactors.find(detid);
19  if (id != m_PixelGeomFactors.end())
20  return id->second;
21  else {
22  edm::LogError("SiPixelDynamicInefficiency")
23  << "SiPixelDynamicInefficiency PixelGeomFactor for DetID " << detid << " is not stored" << std::endl;
24  }
25  return 0;
26 }
27 
28 bool SiPixelDynamicInefficiency::putColGeomFactor(const uint32_t& detid, double& value) {
29  std::map<unsigned int, double>::const_iterator id = m_ColGeomFactors.find(detid);
30  if (id != m_ColGeomFactors.end()) {
31  edm::LogError("SiPixelDynamicInefficiency") << "SiPixelDynamicInefficiency ColGeomFactor for DetID " << detid
32  << " is already stored. Skipping this put" << std::endl;
33  return false;
34  } else
35  m_ColGeomFactors[detid] = value;
36  return true;
37 }
38 
39 double SiPixelDynamicInefficiency::getColGeomFactor(const uint32_t& detid) const {
40  std::map<unsigned int, double>::const_iterator id = m_ColGeomFactors.find(detid);
41  if (id != m_ColGeomFactors.end())
42  return id->second;
43  else {
44  edm::LogError("SiPixelDynamicInefficiency")
45  << "SiPixelDynamicInefficiency ColGeomFactor for DetID " << detid << " is not stored" << std::endl;
46  }
47  return 0;
48 }
49 
50 bool SiPixelDynamicInefficiency::putChipGeomFactor(const uint32_t& detid, double& value) {
51  std::map<unsigned int, double>::const_iterator id = m_ChipGeomFactors.find(detid);
52  if (id != m_ChipGeomFactors.end()) {
53  edm::LogError("SiPixelDynamicInefficiency") << "SiPixelDynamicInefficiency ChipGeomFactor for DetID " << detid
54  << " is already stored. Skipping this put" << std::endl;
55  return false;
56  } else
57  m_ChipGeomFactors[detid] = value;
58  return true;
59 }
60 
61 double SiPixelDynamicInefficiency::getChipGeomFactor(const uint32_t& detid) const {
62  std::map<unsigned int, double>::const_iterator id = m_ChipGeomFactors.find(detid);
63  if (id != m_ChipGeomFactors.end())
64  return id->second;
65  else {
66  edm::LogError("SiPixelDynamicInefficiency")
67  << "SiPixelDynamicInefficiency ChipGeomFactor for DetID " << detid << " is not stored" << std::endl;
68  }
69  return 0;
70 }
71 
72 bool SiPixelDynamicInefficiency::putPUFactor(const uint32_t& detid, std::vector<double>& v_value) {
73  std::map<unsigned int, std::vector<double> >::const_iterator id = m_PUFactors.find(detid);
74  if (id != m_PUFactors.end()) {
75  edm::LogError("SiPixelDynamicInefficiency") << "SiPixelDynamicInefficiency PUFactor for DetID " << detid
76  << " is already stored. Skipping this put" << std::endl;
77  return false;
78  } else
79  m_PUFactors[detid] = v_value;
80  return true;
81 }
82 
83 std::vector<double> SiPixelDynamicInefficiency::getPUFactor(const uint32_t& detid) const {
84  std::map<unsigned int, std::vector<double> >::const_iterator id = m_PUFactors.find(detid);
85  if (id != m_PUFactors.end())
86  return id->second;
87  else {
88  edm::LogError("SiPixelDynamicInefficiency")
89  << "SiPixelDynamicInefficiency PUFactor for DetID " << detid << " is not stored" << std::endl;
90  }
91  std::vector<double> empty;
92  return empty;
93 }
94 
96  for (unsigned int i = 0; i < v_DetIdmasks.size(); i++)
97  if (mask == v_DetIdmasks.at(i))
98  return false;
99  v_DetIdmasks.push_back(mask);
100  return true;
101 }
102 uint32_t SiPixelDynamicInefficiency::getDetIdmask(unsigned int& i) const {
103  if (v_DetIdmasks.size() <= i) {
104  edm::LogError("SiPixelDynamicInefficiency")
105  << "SiPixelDynamicInefficiency DetIdmask " << i << " is not stored!" << std::endl;
106  return 0;
107  } else
108  return v_DetIdmasks.at(i);
109 }
110 
111 bool SiPixelDynamicInefficiency::puttheInstLumiScaleFactor(double& theInstLumiScaleFactor) {
112  if (theInstLumiScaleFactor_ != -9999) {
113  edm::LogError("SiPixelDynamicInefficiency")
114  << "SiPixelDynamicInefficiency theInstLumiScaleFactor is already stored! Skipping this put!" << std::endl;
115  return false;
116  } else {
117  theInstLumiScaleFactor_ = theInstLumiScaleFactor;
118  return true;
119  }
120 }
121 
123  if (theInstLumiScaleFactor_ == -9999) {
124  edm::LogError("SiPixelDynamicInefficiency")
125  << "SiPixelDynamicInefficiency theInstLumiScaleFactor is not stored!" << std::endl;
126  return 0;
127  } else
129 }
bool putPUFactor(const uint32_t &, std::vector< double > &)
double getPixelGeomFactor(const uint32_t &) const
bool putChipGeomFactor(const uint32_t &, double &)
bool putColGeomFactor(const uint32_t &, double &)
double getChipGeomFactor(const uint32_t &) const
std::map< unsigned int, double > m_PixelGeomFactors
Log< level::Error, false > LogError
std::map< unsigned int, double > m_ChipGeomFactors
std::vector< uint32_t > v_DetIdmasks
constexpr uint32_t mask
Definition: gpuClustering.h:26
std::map< unsigned int, std::vector< double > > m_PUFactors
Definition: value.py:1
std::map< unsigned int, double > m_ColGeomFactors
uint32_t getDetIdmask(unsigned int &) const
std::vector< double > getPUFactor(const uint32_t &) const
double getColGeomFactor(const uint32_t &) const
bool putPixelGeomFactor(const uint32_t &, double &)