CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch1/src/CalibTracker/SiPixelESProducers/src/SiPixelGainCalibrationForHLTSimService.cc

Go to the documentation of this file.
00001 /*
00002  * =====================================================================================
00003  *
00004  *       Filename:  SiPixelGainCalibrationForHLTSim.cc
00005  *
00006  *    Description:  
00007  *
00008  *        Version:  1.0 (some functionality moved from ../interface/SiPixelGainCalibrationForHLT.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/SiPixelGainCalibrationForHLTSimService.h"
00018 
00019 float SiPixelGainCalibrationForHLTSimService::getPedestal( const uint32_t& detID,const int& col, const int& row)
00020 {
00021    bool isDead = false;
00022    bool isNoisy = false;
00023    float pedestalValue = this->getPedestalByColumn(detID, col, row, isDead, isNoisy);
00024    if (isDead || isNoisy)
00025    {
00026       this->throwExepctionForBadRead("HLT getPedestal()", detID, col, row, pedestalValue);
00027       return 0.0;
00028    }
00029    return pedestalValue;
00030 }
00031 
00032 float SiPixelGainCalibrationForHLTSimService::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("HLT getGain()", detID, col, row, gainValue);
00040       return 0.0;
00041    }
00042    return gainValue;
00043 }
00044 
00045 bool SiPixelGainCalibrationForHLTSimService::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->getPedestalByColumn(detID, col, row, isDead, isNoisy); //pedestal stores dead column value as well
00052    }
00053    catch (cms::Exception& e) 
00054    {
00055       // Do not stop processing if you check if a nonexistant pixel is dead
00056       edm::LogInfo("SiPixelGainCalibrationForHLTSimService") << "Attempting to check if nonexistant pixel is dead.  Exception message: " << e.what();
00057       isDead = false; 
00058    }
00059    return isDead;
00060 }
00061 
00062 bool SiPixelGainCalibrationForHLTSimService::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->getPedestalByColumn(detID, col, row, isDead, isNoisy); //pedestal stores noisy column value as well
00069    }
00070    catch (cms::Exception& e) 
00071    {
00072       // Do not stop processing if you check if a nonexistant pixel is noisy
00073       edm::LogInfo("SiPixelGainCalibrationForHLTSimService") << "Attempting to check if nonexistant pixel is noisy.  Exception message: " << e.what();
00074       isNoisy = false; 
00075    }
00076    return isNoisy;
00077 }
00078    
00079 bool SiPixelGainCalibrationForHLTSimService::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);
00086    }
00087    catch (cms::Exception& e) 
00088    {
00089       // Do not stop processing if you check if a nonexistant pixel is dead
00090       edm::LogInfo("SiPixelGainCalibrationForHLTSimService") << "Attempting to check if nonexistant pixel is dead.  Exception message: " << e.what();
00091       isDead = false; 
00092    }
00093    return isDead;
00094 }
00095   
00096 bool SiPixelGainCalibrationForHLTSimService::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);
00103    }
00104    catch (cms::Exception& e) 
00105    {
00106       // Do not stop processing if you check if a nonexistant pixel is noisy
00107       edm::LogInfo("SiPixelGainCalibrationForHLTSimService") << "Attempting to check if nonexistant pixel is noisy.  Exception message: " << e.what();
00108       isNoisy = false; 
00109    }
00110    return isNoisy;
00111 }
00112