Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:59:33

0001 /*
0002  * =====================================================================================
0003  *
0004  *       Filename:  SiPixelGainCalibrationForHLTSim.cc
0005  *
0006  *    Description:  
0007  *
0008  *        Version:  1.0 (some functionality moved from ../interface/SiPixelGainCalibrationForHLT.h)
0009  *        Created:  04/16/2008 10:35:35 AM
0010  *
0011  *         Author:  Evan Friis (evan.klose.friis@cern.ch)
0012  *                  University of California, Davis
0013  *
0014  * =====================================================================================
0015  */
0016 
0017 #include "CalibTracker/SiPixelESProducers/interface/SiPixelGainCalibrationForHLTSimService.h"
0018 
0019 float SiPixelGainCalibrationForHLTSimService::getPedestal(const uint32_t& detID, const int& col, const int& row) {
0020   bool isDead = false;
0021   bool isNoisy = false;
0022   float pedestalValue = this->getPedestalByColumn(detID, col, row, isDead, isNoisy);
0023   if (isDead || isNoisy) {
0024     this->throwExepctionForBadRead("HLT getPedestal()", detID, col, row, pedestalValue);
0025     return 0.0;
0026   }
0027   return pedestalValue;
0028 }
0029 
0030 float SiPixelGainCalibrationForHLTSimService::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("HLT getGain()", detID, col, row, gainValue);
0036     return 0.0;
0037   }
0038   return gainValue;
0039 }
0040 
0041 bool SiPixelGainCalibrationForHLTSimService::isDead(const uint32_t& detID, const int& col, const int& row) {
0042   bool isDead = false;
0043   bool isNoisy = false;
0044   try {
0045     this->getPedestalByColumn(detID, col, row, isDead, isNoisy);  //pedestal stores dead column value as well
0046   } catch (cms::Exception& e) {
0047     // Do not stop processing if you check if a nonexistant pixel is dead
0048     edm::LogInfo("SiPixelGainCalibrationForHLTSimService")
0049         << "Attempting to check if nonexistant pixel is dead.  Exception message: " << e.what();
0050     isDead = false;
0051   }
0052   return isDead;
0053 }
0054 
0055 bool SiPixelGainCalibrationForHLTSimService::isNoisy(const uint32_t& detID, const int& col, const int& row) {
0056   bool isDead = false;
0057   bool isNoisy = false;
0058   try {
0059     this->getPedestalByColumn(detID, col, row, isDead, isNoisy);  //pedestal stores noisy column value as well
0060   } catch (cms::Exception& e) {
0061     // Do not stop processing if you check if a nonexistant pixel is noisy
0062     edm::LogInfo("SiPixelGainCalibrationForHLTSimService")
0063         << "Attempting to check if nonexistant pixel is noisy.  Exception message: " << e.what();
0064     isNoisy = false;
0065   }
0066   return isNoisy;
0067 }
0068 
0069 bool SiPixelGainCalibrationForHLTSimService::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     // Do not stop processing if you check if a nonexistant pixel is dead
0076     edm::LogInfo("SiPixelGainCalibrationForHLTSimService")
0077         << "Attempting to check if nonexistant pixel is dead.  Exception message: " << e.what();
0078     isDead = false;
0079   }
0080   return isDead;
0081 }
0082 
0083 bool SiPixelGainCalibrationForHLTSimService::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     // Do not stop processing if you check if a nonexistant pixel is noisy
0090     edm::LogInfo("SiPixelGainCalibrationForHLTSimService")
0091         << "Attempting to check if nonexistant pixel is noisy.  Exception message: " << e.what();
0092     isNoisy = false;
0093   }
0094   return isNoisy;
0095 }