CMS 3D CMS Logo

SiPixelVCal.cc
Go to the documentation of this file.
3 
4 bool SiPixelVCal::putSlopeAndOffset(const uint32_t& pixid, float& slopeValue, float& offsetValue) {
5  std::map<unsigned int, VCal>::const_iterator id = m_vcal.find(pixid);
6  if (id != m_vcal.end()) {
7  edm::LogError("SiPixelVCal") << "SiPixelVCal for pixid " << pixid << " is already stored. Skippig this put"
8  << std::endl;
9  return false;
10  } else {
11  m_vcal[pixid] = {slopeValue, offsetValue};
12  }
13  return true;
14 }
15 
16 SiPixelVCal::VCal SiPixelVCal::getSlopeAndOffset(const uint32_t& pixid) const {
17  std::map<unsigned int, VCal>::const_iterator id = m_vcal.find(pixid);
18  if (id != m_vcal.end())
19  return id->second;
20  else
21  edm::LogError("SiPixelVCal") << "SiPixelVCal for pixid " << pixid << " is not stored" << std::endl;
22  VCal vcal_default;
23  return vcal_default;
24 }
25 
26 float SiPixelVCal::getSlope(const uint32_t& pixid) const {
27  std::map<unsigned int, VCal>::const_iterator id = m_vcal.find(pixid);
28  if (id != m_vcal.end())
29  return id->second.slope;
30  else
31  edm::LogError("SiPixelVCal") << "SiPixelVCal slope for pixid " << pixid << " is not stored" << std::endl;
32  return 47.;
33 }
34 
35 float SiPixelVCal::getOffset(const uint32_t& pixid) const {
36  std::map<unsigned int, VCal>::const_iterator id = m_vcal.find(pixid);
37  if (id != m_vcal.end())
38  return id->second.offset;
39  else
40  edm::LogError("SiPixelVCal") << "SiPixelVCal offset for pixid " << pixid << " is not stored" << std::endl;
41  return -60.;
42 }
SiPixelVCal::putSlopeAndOffset
void putSlopeAndOffset(std::map< unsigned int, VCal > &vcal)
Definition: SiPixelVCal.h:20
MessageLogger.h
SiPixelVCal.h
SiPixelVCal::getSlope
float getSlope(const uint32_t &) const
Definition: SiPixelVCal.cc:26
edm::LogError
Definition: MessageLogger.h:183
SiPixelVCal::m_vcal
std::map< unsigned int, VCal > m_vcal
Definition: SiPixelVCal.h:35
SiPixelVCal::VCal
Definition: SiPixelVCal.h:14
SiPixelVCal::getSlopeAndOffset
const std::map< unsigned int, VCal > & getSlopeAndOffset() const
Definition: SiPixelVCal.h:21
SiPixelVCal::getOffset
float getOffset(const uint32_t &) const
Definition: SiPixelVCal.cc:35
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31