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. Skippig 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. Skippig 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. Skippig 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. Skippig 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! Skippig 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 }
SiPixelDynamicInefficiency::m_ChipGeomFactors
std::map< unsigned int, double > m_ChipGeomFactors
Definition: SiPixelDynamicInefficiency.h:59
SiPixelDynamicInefficiency::putPixelGeomFactor
bool putPixelGeomFactor(const uint32_t &, double &)
Definition: SiPixelDynamicInefficiency.cc:6
SiPixelDynamicInefficiency::getColGeomFactor
double getColGeomFactor(const uint32_t &) const
Definition: SiPixelDynamicInefficiency.cc:39
SiPixelDynamicInefficiency::m_ColGeomFactors
std::map< unsigned int, double > m_ColGeomFactors
Definition: SiPixelDynamicInefficiency.h:58
mps_fire.i
i
Definition: mps_fire.py:428
MessageLogger.h
SiPixelDynamicInefficiency::putDetIdmask
bool putDetIdmask(uint32_t &)
Definition: SiPixelDynamicInefficiency.cc:95
SiPixelDynamicInefficiency::getChipGeomFactor
double getChipGeomFactor(const uint32_t &) const
Definition: SiPixelDynamicInefficiency.cc:61
SiPixelDynamicInefficiency::m_PUFactors
std::map< unsigned int, std::vector< double > > m_PUFactors
Definition: SiPixelDynamicInefficiency.h:60
SiPixelDynamicInefficiency::puttheInstLumiScaleFactor
bool puttheInstLumiScaleFactor(double &)
Definition: SiPixelDynamicInefficiency.cc:111
SiPixelDynamicInefficiency::putColGeomFactor
bool putColGeomFactor(const uint32_t &, double &)
Definition: SiPixelDynamicInefficiency.cc:28
SiPixelDynamicInefficiency::m_PixelGeomFactors
std::map< unsigned int, double > m_PixelGeomFactors
Definition: SiPixelDynamicInefficiency.h:57
SiPixelDynamicInefficiency::gettheInstLumiScaleFactor
double gettheInstLumiScaleFactor() const
Definition: SiPixelDynamicInefficiency.cc:122
SiPixelDynamicInefficiency::SiPixelDynamicInefficiency
SiPixelDynamicInefficiency()
Definition: SiPixelDynamicInefficiency.cc:4
value
Definition: value.py:1
SiPixelDynamicInefficiency::getPixelGeomFactor
double getPixelGeomFactor(const uint32_t &) const
Definition: SiPixelDynamicInefficiency.cc:17
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
SiPixelDynamicInefficiency::v_DetIdmasks
std::vector< uint32_t > v_DetIdmasks
Definition: SiPixelDynamicInefficiency.h:61
SiPixelDynamicInefficiency.h
SiPixelDynamicInefficiency::theInstLumiScaleFactor_
double theInstLumiScaleFactor_
Definition: SiPixelDynamicInefficiency.h:62
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
relativeConstraints.value
value
Definition: relativeConstraints.py:53
relativeConstraints.empty
bool empty
Definition: relativeConstraints.py:46
SiPixelDynamicInefficiency::putPUFactor
bool putPUFactor(const uint32_t &, std::vector< double > &)
Definition: SiPixelDynamicInefficiency.cc:72
SiPixelDynamicInefficiency::putChipGeomFactor
bool putChipGeomFactor(const uint32_t &, double &)
Definition: SiPixelDynamicInefficiency.cc:50
SiPixelDynamicInefficiency::getDetIdmask
uint32_t getDetIdmask(unsigned int &) const
Definition: SiPixelDynamicInefficiency.cc:102
edm::Log
Definition: MessageLogger.h:70
SiPixelDynamicInefficiency::getPUFactor
std::vector< double > getPUFactor(const uint32_t &) const
Definition: SiPixelDynamicInefficiency.cc:83