CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SiPixelGainCalibrationService.cc
Go to the documentation of this file.
1 /*
2  * =====================================================================================
3  *
4  * Filename: SiPixelGainCalibrationServic.cc
5  *
6  * Description:
7  *
8  * Version: 1.0 (some functionality moved from ../interface/SiPixelGainCalibrationService.h)
9  * Created: 04/16/2008 10:35:35 AM
10  *
11  * Author: Evan Friis (evan.klose.friis@cern.ch)
12  * University of California, Davis
13  *
14  * =====================================================================================
15  */
16 
18 
19 float SiPixelGainCalibrationService::getPedestal( const uint32_t& detID,const int& col, const int& row)
20 {
21  bool isDead = false;
22  bool isNoisy = false;
23  float pedestalValue = this->getPedestalByPixel(detID, col, row, isDead, isNoisy);
24  if (isDead || isNoisy)
25  {
26  this->throwExepctionForBadRead("FullCalibration getPedestal()",detID, col, row, pedestalValue);
27  return 0.0;
28  }
29  return pedestalValue;
30 }
31 
32 float SiPixelGainCalibrationService::getGain( const uint32_t& detID,const int& col, const int& row)
33 {
34  bool isDead = false;
35  bool isNoisy = false;
36  float gainValue = this->getGainByColumn(detID, col, row, isDead, isNoisy);
37  if (isDead || isNoisy)
38  {
39  this->throwExepctionForBadRead("FullCalibration getGain()",detID, col, row, gainValue);
40  return 0.0;
41  }
42  return gainValue;
43 }
44 
45 bool SiPixelGainCalibrationService::isDead( const uint32_t& detID,const int& col, const int& row)
46 {
47  bool isDead = false;
48  bool isNoisy = false;
49  try
50  {
51  this->getPedestalByPixel(detID, col, row, isDead, isNoisy);
52  }
53  catch (cms::Exception& e)
54  {
55  // Do not stop processing if you check if a nonexistant pixel is dead
56  edm::LogInfo("SiPixelGainCalibrationService") << "Attempting to check if nonexistant pixel is dead. Exception message: " << e.what();
57  isDead = false;
58  }
59  return isDead;
60 }
61 
62 bool SiPixelGainCalibrationService::isNoisy( const uint32_t& detID,const int& col, const int& row)
63 {
64  bool isDead = false;
65  bool isNoisy = false;
66  try
67  {
68  this->getPedestalByPixel(detID, col, row, isDead, isNoisy);
69  }
70  catch (cms::Exception& e)
71  {
72  // Do not stop processing if you check if a nonexistant pixel is noisy
73  edm::LogInfo("SiPixelGainCalibrationService") << "Attempting to check if nonexistant pixel is noisy. Exception message: " << e.what();
74  isNoisy = false;
75  }
76  return isNoisy;
77 }
78 
79 bool SiPixelGainCalibrationService::isDeadColumn( const uint32_t& detID,const int& col, const int& row)
80 {
81  edm::LogError("SiPixelGainCalibrationService") << "You attempted to check if an entire column was dead with a payload that stores information at pixel granularity. Please check by pixel. THANKS!";
82  return false;
83 }
84 
85 bool SiPixelGainCalibrationService::isNoisyColumn( const uint32_t& detID,const int& col, const int& row)
86 {
87  edm::LogError("SiPixelGainCalibrationService") << "You attempted to check if an entire column was noisy with a payload that stores information at pixel granularity. Please check by pixel. THANKS!";
88  return false;
89 }
virtual char const * what() const
Definition: Exception.cc:141
bool isNoisy(const uint32_t &detID, const int &col, const int &row)
float getPedestalByPixel(const uint32_t &detID, const int &col, const int &row, bool &isDeadPixel, bool &isNoisyPixel)
float getGain(const uint32_t &detID, const int &col, const int &row)
bool isNoisyColumn(const uint32_t &detID, const int &col, const int &row)
float getPedestal(const uint32_t &detID, const int &col, const int &row)
float getGainByColumn(const uint32_t &detID, const int &col, const int &row, bool &isDeadColumn, bool &isNoisyColumn)
void throwExepctionForBadRead(std::string payload, const uint32_t &detID, const int &col, const int &row, double value=-1) const
bool isDeadColumn(const uint32_t &detID, const int &col, const int &row)
bool isDead(const uint32_t &detID, const int &col, const int &row)