File indexing completed on 2024-04-06 11:59:33
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #include "CalibTracker/SiPixelESProducers/interface/SiPixelGainCalibrationOfflineService.h"
0018
0019 float SiPixelGainCalibrationOfflineService::getPedestal(const uint32_t& detID, const int& col, const int& row) {
0020 bool isDead = false;
0021 bool isNoisy = false;
0022 float pedestalValue = this->getPedestalByPixel(detID, col, row, isDead, isNoisy);
0023 if (isDead || isNoisy) {
0024 this->throwExepctionForBadRead("Offline getPedestal()", detID, col, row, pedestalValue);
0025 return 0.0;
0026 }
0027 return pedestalValue;
0028 }
0029
0030 float SiPixelGainCalibrationOfflineService::getGain(const uint32_t& detID, const int& col, const int& row) {
0031 bool isDead = false;
0032 bool isNoisy = false;
0033 float gainValue = this->getGainByColumn(detID, col, row, isDead, isNoisy);
0034 if (isDead || isNoisy) {
0035 this->throwExepctionForBadRead("Offline getGain()", detID, col, row, gainValue);
0036 return 0.0;
0037 }
0038 return gainValue;
0039 }
0040
0041 bool SiPixelGainCalibrationOfflineService::isDead(const uint32_t& detID, const int& col, const int& row) {
0042 bool isDead = false;
0043 bool isNoisy = false;
0044 try {
0045 this->getPedestalByPixel(detID, col, row, isDead, isNoisy);
0046 } catch (cms::Exception& e) {
0047
0048 edm::LogInfo("SiPixelGainCalibrationOfflineService")
0049 << "Attempting to check if nonexistant pixel is dead. Exception message: " << e.what();
0050 isDead = false;
0051 }
0052 return isDead;
0053 }
0054
0055 bool SiPixelGainCalibrationOfflineService::isNoisy(const uint32_t& detID, const int& col, const int& row) {
0056 bool isDead = false;
0057 bool isNoisy = false;
0058 try {
0059 this->getPedestalByPixel(detID, col, row, isDead, isNoisy);
0060 } catch (cms::Exception& e) {
0061
0062 edm::LogInfo("SiPixelGainCalibrationOfflineService")
0063 << "Attempting to check if nonexistant pixel is noisy. Exception message: " << e.what();
0064 isNoisy = false;
0065 }
0066 return isNoisy;
0067 }
0068
0069 bool SiPixelGainCalibrationOfflineService::isDeadColumn(const uint32_t& detID, const int& col, const int& row) {
0070 bool isDead = false;
0071 bool isNoisy = false;
0072 try {
0073 this->getGainByColumn(detID, col, row, isDead, isNoisy);
0074 } catch (cms::Exception& e) {
0075
0076 edm::LogInfo("SiPixelGainCalibrationOfflineService")
0077 << "Attempting to check if nonexistant pixel is dead. Exception message: " << e.what();
0078 isDead = false;
0079 }
0080 return isDead;
0081 }
0082
0083 bool SiPixelGainCalibrationOfflineService::isNoisyColumn(const uint32_t& detID, const int& col, const int& row) {
0084 bool isDead = false;
0085 bool isNoisy = false;
0086 try {
0087 this->getGainByColumn(detID, col, row, isDead, isNoisy);
0088 } catch (cms::Exception& e) {
0089
0090 edm::LogInfo("SiPixelGainCalibrationOfflineService")
0091 << "Attempting to check if nonexistant pixel is Noisy. Exception message: " << e.what();
0092 isNoisy = false;
0093 }
0094 return isNoisy;
0095 }