CMS 3D CMS Logo

SiPixelGainCalibrationOfflineService.cc
Go to the documentation of this file.
1 /*
2  * =====================================================================================
3  *
4  * Filename: SiPixelGainCalibrationOfflineService.cc
5  *
6  * Description:
7  *
8  * Version: 1.0 (some functionality moved from ../interface/SiPixelGainCalibrationOfflineService.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 SiPixelGainCalibrationOfflineService::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("Offline getPedestal()", detID, col, row, pedestalValue);
27  return 0.0;
28  }
29  return pedestalValue;
30 }
31 
32 float SiPixelGainCalibrationOfflineService::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("Offline getGain()", detID, col, row, gainValue);
40  return 0.0;
41  }
42  return gainValue;
43 }
44 
45 bool SiPixelGainCalibrationOfflineService::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("SiPixelGainCalibrationOfflineService") << "Attempting to check if nonexistant pixel is dead. Exception message: " << e.what();
57  isDead = false;
58  }
59  return isDead;
60 }
61 
62 bool SiPixelGainCalibrationOfflineService::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 dead
73  edm::LogInfo("SiPixelGainCalibrationOfflineService") << "Attempting to check if nonexistant pixel is noisy. Exception message: " << e.what();
74  isNoisy = false;
75  }
76  return isNoisy;
77 }
78 
79 bool SiPixelGainCalibrationOfflineService::isDeadColumn( const uint32_t& detID,const int& col, const int& row)
80 {
81  bool isDead = false;
82  bool isNoisy = false;
83  try
84  {
85  this->getGainByColumn(detID, col, row, isDead, isNoisy); // the gain column average can flag a whole column as bad
86  }
87  catch (cms::Exception& e)
88  {
89  // Do not stop processing if you check if a nonexistant pixel is dead
90  edm::LogInfo("SiPixelGainCalibrationOfflineService") << "Attempting to check if nonexistant pixel is dead. Exception message: " << e.what();
91  isDead = false;
92  }
93  return isDead;
94 }
95 
96 bool SiPixelGainCalibrationOfflineService::isNoisyColumn( const uint32_t& detID,const int& col, const int& row)
97 {
98  bool isDead = false;
99  bool isNoisy = false;
100  try
101  {
102  this->getGainByColumn(detID, col, row, isDead, isNoisy); // the gain column average can flag a whole column as bad
103  }
104  catch (cms::Exception& e)
105  {
106  // Do not stop processing if you check if a nonexistant pixel is dead
107  edm::LogInfo("SiPixelGainCalibrationOfflineService") << "Attempting to check if nonexistant pixel is Noisy. Exception message: " << e.what();
108  isNoisy = false;
109  }
110  return isNoisy;
111 }
bool isNoisyColumn(const uint32_t &detID, const int &col, const int &row) override
float getPedestalByPixel(const uint32_t &detID, const int &col, const int &row, bool &isDeadPixel, bool &isNoisyPixel)
char const * what() const override
Definition: Exception.cc:141
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) override
bool isDead(const uint32_t &detID, const int &col, const int &row) override
bool isNoisy(const uint32_t &detID, const int &col, const int &row) override
col
Definition: cuy.py:1008
float getPedestal(const uint32_t &detID, const int &col, const int &row) override
float getGain(const uint32_t &detID, const int &col, const int &row) override