CMS 3D CMS Logo

SiPixelGainCalibrationForHLTSimService.cc
Go to the documentation of this file.
1 /*
2  * =====================================================================================
3  *
4  * Filename: SiPixelGainCalibrationForHLTSim.cc
5  *
6  * Description:
7  *
8  * Version: 1.0 (some functionality moved from ../interface/SiPixelGainCalibrationForHLT.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 SiPixelGainCalibrationForHLTSimService::getPedestal( const uint32_t& detID,const int& col, const int& row)
20 {
21  bool isDead = false;
22  bool isNoisy = false;
23  float pedestalValue = this->getPedestalByColumn(detID, col, row, isDead, isNoisy);
24  if (isDead || isNoisy)
25  {
26  this->throwExepctionForBadRead("HLT getPedestal()", detID, col, row, pedestalValue);
27  return 0.0;
28  }
29  return pedestalValue;
30 }
31 
32 float SiPixelGainCalibrationForHLTSimService::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("HLT getGain()", detID, col, row, gainValue);
40  return 0.0;
41  }
42  return gainValue;
43 }
44 
45 bool SiPixelGainCalibrationForHLTSimService::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->getPedestalByColumn(detID, col, row, isDead, isNoisy); //pedestal stores dead column value as well
52  }
53  catch (cms::Exception& e)
54  {
55  // Do not stop processing if you check if a nonexistant pixel is dead
56  edm::LogInfo("SiPixelGainCalibrationForHLTSimService") << "Attempting to check if nonexistant pixel is dead. Exception message: " << e.what();
57  isDead = false;
58  }
59  return isDead;
60 }
61 
62 bool SiPixelGainCalibrationForHLTSimService::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->getPedestalByColumn(detID, col, row, isDead, isNoisy); //pedestal stores noisy column value as well
69  }
70  catch (cms::Exception& e)
71  {
72  // Do not stop processing if you check if a nonexistant pixel is noisy
73  edm::LogInfo("SiPixelGainCalibrationForHLTSimService") << "Attempting to check if nonexistant pixel is noisy. Exception message: " << e.what();
74  isNoisy = false;
75  }
76  return isNoisy;
77 }
78 
79 bool SiPixelGainCalibrationForHLTSimService::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);
86  }
87  catch (cms::Exception& e)
88  {
89  // Do not stop processing if you check if a nonexistant pixel is dead
90  edm::LogInfo("SiPixelGainCalibrationForHLTSimService") << "Attempting to check if nonexistant pixel is dead. Exception message: " << e.what();
91  isDead = false;
92  }
93  return isDead;
94 }
95 
96 bool SiPixelGainCalibrationForHLTSimService::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);
103  }
104  catch (cms::Exception& e)
105  {
106  // Do not stop processing if you check if a nonexistant pixel is noisy
107  edm::LogInfo("SiPixelGainCalibrationForHLTSimService") << "Attempting to check if nonexistant pixel is noisy. Exception message: " << e.what();
108  isNoisy = false;
109  }
110  return isNoisy;
111 }
112 
char const * what() const override
Definition: Exception.cc:103
float getPedestalByColumn(const uint32_t &detID, const int &col, const int &row, bool &isDeadColumn, bool &isNoisyColumn)
bool isDead(const uint32_t &detID, const int &col, const int &row) override
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 isNoisyColumn(const uint32_t &detID, const int &col, const int &row) override
bool isNoisy(const uint32_t &detID, const int &col, const int &row) override
float getGain(const uint32_t &detID, const int &col, const int &row) override
col
Definition: cuy.py:1010
bool isDeadColumn(const uint32_t &detID, const int &col, const int &row) override
float getPedestal(const uint32_t &detID, const int &col, const int &row) override