Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:58:18

0001 // -*- C++ -*-
0002 //
0003 // Package:     CalibFormats/SiStripObjects
0004 // Class  :     SiStripDetInfo
0005 //
0006 // Implementation:
0007 //     [Notes on implementation]
0008 //
0009 // Original Author:  Christopher Jones
0010 //         Created:  Fri, 28 May 2021 20:10:25 GMT
0011 //
0012 
0013 // system include files
0014 
0015 // user include files
0016 #include "CalibFormats/SiStripObjects/interface/SiStripDetInfo.h"
0017 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0018 
0019 const std::pair<unsigned short, double> SiStripDetInfo::getNumberOfApvsAndStripLength(uint32_t detId) const {
0020   std::map<uint32_t, DetInfo>::const_iterator it = detData_.find(detId);
0021 
0022   if (it != detData_.end()) {
0023     return std::pair<unsigned short, double>(it->second.nApvs, it->second.stripLength);
0024 
0025   } else {
0026     std::pair<unsigned short, double> defaultValue(0, 0.);
0027     edm::LogWarning(
0028         "SiStripDetInfoFileReader::getNumberOfApvsAndStripLength - Unable to find requested detid. Returning invalid "
0029         "data ")
0030         << std::endl;
0031     return defaultValue;
0032   }
0033 }
0034 
0035 const float& SiStripDetInfo::getThickness(uint32_t detId) const {
0036   std::map<uint32_t, DetInfo>::const_iterator it = detData_.find(detId);
0037 
0038   if (it != detData_.end()) {
0039     return it->second.thickness;
0040 
0041   } else {
0042     static const float defaultValue = 0;
0043     edm::LogWarning("SiStripDetInfo::getThickness - Unable to find requested detid. Returning invalid data ")
0044         << std::endl;
0045     return defaultValue;
0046   }
0047 }