CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 << " is already stored. Skippig this put" << std::endl;
10  return false;
11  }
12  else m_PixelGeomFactors[detid]=value;
13  return true;
14 }
15 
16 double SiPixelDynamicInefficiency::getPixelGeomFactor (const uint32_t& detid) const {
17  std::map<unsigned int,double>::const_iterator id=m_PixelGeomFactors.find(detid);
18  if(id!=m_PixelGeomFactors.end()) return id->second;
19  else {
20  edm::LogError("SiPixelDynamicInefficiency") << "SiPixelDynamicInefficiency PixelGeomFactor for DetID " << detid << " is not stored" << std::endl;
21  }
22  return 0;
23 }
24 
25 bool SiPixelDynamicInefficiency::putColGeomFactor (const uint32_t& detid, double& value){
26  std::map<unsigned int,double>::const_iterator id=m_ColGeomFactors.find(detid);
27  if(id!=m_ColGeomFactors.end()){
28  edm::LogError("SiPixelDynamicInefficiency") << "SiPixelDynamicInefficiency ColGeomFactor for DetID " << detid << " is already stored. Skippig this put" << std::endl;
29  return false;
30  }
31  else m_ColGeomFactors[detid]=value;
32  return true;
33 }
34 
35 double SiPixelDynamicInefficiency::getColGeomFactor (const uint32_t& detid) const {
36  std::map<unsigned int,double>::const_iterator id=m_ColGeomFactors.find(detid);
37  if(id!=m_ColGeomFactors.end()) return id->second;
38  else {
39  edm::LogError("SiPixelDynamicInefficiency") << "SiPixelDynamicInefficiency ColGeomFactor for DetID " << detid << " is not stored" << std::endl;
40  }
41  return 0;
42 }
43 
44 bool SiPixelDynamicInefficiency::putChipGeomFactor (const uint32_t& detid, double& value){
45  std::map<unsigned int,double>::const_iterator id=m_ChipGeomFactors.find(detid);
46  if(id!=m_ChipGeomFactors.end()){
47  edm::LogError("SiPixelDynamicInefficiency") << "SiPixelDynamicInefficiency ChipGeomFactor for DetID " << detid << " is already stored. Skippig this put" << std::endl;
48  return false;
49  }
50  else m_ChipGeomFactors[detid]=value;
51  return true;
52 }
53 
54 double SiPixelDynamicInefficiency::getChipGeomFactor (const uint32_t& detid) const {
55  std::map<unsigned int,double>::const_iterator id=m_ChipGeomFactors.find(detid);
56  if(id!=m_ChipGeomFactors.end()) return id->second;
57  else {
58  edm::LogError("SiPixelDynamicInefficiency") << "SiPixelDynamicInefficiency ChipGeomFactor for DetID " << detid << " is not stored" << std::endl;
59  }
60  return 0;
61 }
62 
63 bool SiPixelDynamicInefficiency::putPUFactor (const uint32_t& detid, std::vector<double>& v_value){
64  std::map<unsigned int,std::vector<double> >::const_iterator id=m_PUFactors.find(detid);
65  if(id!=m_PUFactors.end()){
66  edm::LogError("SiPixelDynamicInefficiency") << "SiPixelDynamicInefficiency PUFactor for DetID " << detid << " is already stored. Skippig this put" << std::endl;
67  return false;
68  }
69  else m_PUFactors[detid]=v_value;
70  return true;
71 }
72 
73 std::vector<double> SiPixelDynamicInefficiency::getPUFactor (const uint32_t& detid) const {
74  std::map<unsigned int,std::vector<double> >::const_iterator id=m_PUFactors.find(detid);
75  if(id!=m_PUFactors.end()) return id->second;
76  else {
77  edm::LogError("SiPixelDynamicInefficiency") << "SiPixelDynamicInefficiency PUFactor for DetID " << detid << " is not stored" << std::endl;
78  }
79  std::vector<double> empty;
80  return empty;
81 }
82 
84  for (unsigned int i=0;i<v_DetIdmasks.size();i++) if (mask == v_DetIdmasks.at(i)) return false;
85  v_DetIdmasks.push_back(mask);
86  return true;
87 }
88 uint32_t SiPixelDynamicInefficiency::getDetIdmask(unsigned int& i) const{
89  if (v_DetIdmasks.size() <= i) {
90  edm::LogError("SiPixelDynamicInefficiency") << "SiPixelDynamicInefficiency DetIdmask "<<i<<" is not stored!" << std::endl;
91  return 0;
92  }
93  else return v_DetIdmasks.at(i);
94 }
95 
96 bool SiPixelDynamicInefficiency::puttheInstLumiScaleFactor(double& theInstLumiScaleFactor){
97  if (theInstLumiScaleFactor_ != -9999){
98  edm::LogError("SiPixelDynamicInefficiency") << "SiPixelDynamicInefficiency theInstLumiScaleFactor is already stored! Skippig this put!" << std::endl;
99  return false;
100  }
101  else {
102  theInstLumiScaleFactor_ = theInstLumiScaleFactor;
103  return true;
104  }
105 }
106 
108  if (theInstLumiScaleFactor_ == -9999) {
109  edm::LogError("SiPixelDynamicInefficiency") << "SiPixelDynamicInefficiency theInstLumiScaleFactor is not stored!" << std::endl;
110  return 0;
111  }
112  else return theInstLumiScaleFactor_;
113 }
uint32_t getDetIdmask(unsigned int &) const
int i
Definition: DBlmapReader.cc:9
bool putPUFactor(const uint32_t &, std::vector< double > &)
bool putChipGeomFactor(const uint32_t &, double &)
bool putColGeomFactor(const uint32_t &, double &)
double getPixelGeomFactor(const uint32_t &) const
std::vector< uint32_t > v_DetIdmasks
double getColGeomFactor(const uint32_t &) const
std::map< unsigned int, double > m_ChipGeomFactors
std::map< unsigned int, std::vector< double > > m_PUFactors
std::map< unsigned int, double > m_PixelGeomFactors
double getChipGeomFactor(const uint32_t &) const
std::map< unsigned int, double > m_ColGeomFactors
std::vector< double > getPUFactor(const uint32_t &) const
bool putPixelGeomFactor(const uint32_t &, double &)