CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/CalibTracker/SiPixelESProducers/src/SiPixelGainCalibrationOfflineSimService.cc

Go to the documentation of this file.
00001 /*
00002  * =====================================================================================
00003  *
00004  *       Filename:  SiPixelGainCalibrationOfflineSimService.cc
00005  *
00006  *    Description:  
00007  *
00008  *        Version:  1.0 (some functionality moved from ../interface/SiPixelGainCalibrationOfflineSimService.h)
00009  *        Created:  04/16/2008 10:35:35 AM
00010  *
00011  *         Author:  Evan Friis (evan.klose.friis@cern.ch)
00012  *                  University of California, Davis
00013  *
00014  * =====================================================================================
00015  */
00016 
00017 #include "CalibTracker/SiPixelESProducers/interface/SiPixelGainCalibrationOfflineSimService.h"
00018 
00019 float SiPixelGainCalibrationOfflineSimService::getPedestal( const uint32_t& detID,const int& col, const int& row)
00020 {
00021    bool isDead = false;
00022    bool isNoisy = false;
00023    float pedestalValue = this->getPedestalByPixel(detID, col, row, isDead, isNoisy);
00024    if (isDead || isNoisy)
00025    {
00026       this->throwExepctionForBadRead("Offline getPedestal()", detID, col, row, pedestalValue);
00027       return 0.0;
00028    }
00029    return pedestalValue;
00030 }
00031 
00032 float SiPixelGainCalibrationOfflineSimService::getGain( const uint32_t& detID,const int& col, const int& row)
00033 {
00034    bool isDead = false;
00035    bool isNoisy = false;
00036    float gainValue = this->getGainByColumn(detID, col, row, isDead, isNoisy);
00037    if (isDead || isNoisy)
00038    {
00039       this->throwExepctionForBadRead("Offline getGain()", detID, col, row, gainValue);
00040       return 0.0;
00041    }
00042    return gainValue;
00043 }
00044 
00045 bool SiPixelGainCalibrationOfflineSimService::isDead( const uint32_t& detID,const int& col, const int& row)
00046 {
00047    bool isDead = false;
00048    bool isNoisy = false;
00049    try  
00050    {
00051       this->getPedestalByPixel(detID, col, row, isDead, isNoisy); 
00052    }
00053    catch (cms::Exception& e) 
00054    {
00055       // Do not stop processing if you check if a nonexistant pixel is dead
00056       edm::LogInfo("SiPixelGainCalibrationOfflineSimService") << "Attempting to check if nonexistant pixel is dead.  Exception message: " << e.what();
00057       isDead = false; 
00058    }
00059    return isDead;
00060 }
00061 
00062 bool SiPixelGainCalibrationOfflineSimService::isNoisy( const uint32_t& detID,const int& col, const int& row)
00063 {
00064    bool isDead = false;
00065    bool isNoisy = false;
00066    try  
00067    {
00068       this->getPedestalByPixel(detID, col, row, isDead, isNoisy); 
00069    }
00070    catch (cms::Exception& e) 
00071    {
00072       // Do not stop processing if you check if a nonexistant pixel is dead
00073       edm::LogInfo("SiPixelGainCalibrationOfflineSimService") << "Attempting to check if nonexistant pixel is noisy.  Exception message: " << e.what();
00074       isNoisy = false; 
00075    }
00076    return isNoisy;
00077 }
00078    
00079 bool SiPixelGainCalibrationOfflineSimService::isDeadColumn( const uint32_t& detID,const int& col, const int& row)
00080 {
00081    bool isDead = false;
00082    bool isNoisy = false;
00083    try  
00084    {
00085       this->getGainByColumn(detID, col, row, isDead, isNoisy); // the gain column average can flag a whole column as bad
00086    }
00087    catch (cms::Exception& e) 
00088    {
00089       // Do not stop processing if you check if a nonexistant pixel is dead
00090       edm::LogInfo("SiPixelGainCalibrationOfflineSimService") << "Attempting to check if nonexistant pixel is dead.  Exception message: " << e.what();
00091       isDead = false; 
00092    }
00093    return isDead;
00094 }
00095 
00096 bool SiPixelGainCalibrationOfflineSimService::isNoisyColumn( const uint32_t& detID,const int& col, const int& row)
00097 {
00098    bool isDead = false;
00099    bool isNoisy = false;
00100    try  
00101    {
00102       this->getGainByColumn(detID, col, row, isDead, isNoisy); // the gain column average can flag a whole column as bad
00103    }
00104    catch (cms::Exception& e) 
00105    {
00106       // Do not stop processing if you check if a nonexistant pixel is dead
00107       edm::LogInfo("SiPixelGainCalibrationOfflineSimService") << "Attempting to check if nonexistant pixel is Noisy.  Exception message: " << e.what();
00108       isNoisy = false; 
00109    }
00110    return isNoisy;
00111 }