CMS 3D CMS Logo

SiPixelGainCalibrationOfflineSimService.cc
Go to the documentation of this file.
1 /*
2  * =====================================================================================
3  *
4  * Filename: SiPixelGainCalibrationOfflineSimService.cc
5  *
6  * Description:
7  *
8  * Version: 1.0 (some functionality moved from ../interface/SiPixelGainCalibrationOfflineSimService.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 SiPixelGainCalibrationOfflineSimService::getPedestal(const uint32_t& detID, const int& col, const int& row) {
20  bool isDead = false;
21  bool isNoisy = false;
22  float pedestalValue = this->getPedestalByPixel(detID, col, row, isDead, isNoisy);
23  if (isDead || isNoisy) {
24  this->throwExepctionForBadRead("Offline getPedestal()", detID, col, row, pedestalValue);
25  return 0.0;
26  }
27  return pedestalValue;
28 }
29 
30 float SiPixelGainCalibrationOfflineSimService::getGain(const uint32_t& detID, const int& col, const int& row) {
31  bool isDead = false;
32  bool isNoisy = false;
33  float gainValue = this->getGainByColumn(detID, col, row, isDead, isNoisy);
34  if (isDead || isNoisy) {
35  this->throwExepctionForBadRead("Offline getGain()", detID, col, row, gainValue);
36  return 0.0;
37  }
38  return gainValue;
39 }
40 
41 bool SiPixelGainCalibrationOfflineSimService::isDead(const uint32_t& detID, const int& col, const int& row) {
42  bool isDead = false;
43  bool isNoisy = false;
44  try {
45  this->getPedestalByPixel(detID, col, row, isDead, isNoisy);
46  } catch (cms::Exception& e) {
47  // Do not stop processing if you check if a nonexistant pixel is dead
48  edm::LogInfo("SiPixelGainCalibrationOfflineSimService")
49  << "Attempting to check if nonexistant pixel is dead. Exception message: " << e.what();
50  isDead = false;
51  }
52  return isDead;
53 }
54 
55 bool SiPixelGainCalibrationOfflineSimService::isNoisy(const uint32_t& detID, const int& col, const int& row) {
56  bool isDead = false;
57  bool isNoisy = false;
58  try {
59  this->getPedestalByPixel(detID, col, row, isDead, isNoisy);
60  } catch (cms::Exception& e) {
61  // Do not stop processing if you check if a nonexistant pixel is dead
62  edm::LogInfo("SiPixelGainCalibrationOfflineSimService")
63  << "Attempting to check if nonexistant pixel is noisy. Exception message: " << e.what();
64  isNoisy = false;
65  }
66  return isNoisy;
67 }
68 
69 bool SiPixelGainCalibrationOfflineSimService::isDeadColumn(const uint32_t& detID, const int& col, const int& row) {
70  bool isDead = false;
71  bool isNoisy = false;
72  try {
73  this->getGainByColumn(detID, col, row, isDead, isNoisy); // the gain column average can flag a whole column as bad
74  } catch (cms::Exception& e) {
75  // Do not stop processing if you check if a nonexistant pixel is dead
76  edm::LogInfo("SiPixelGainCalibrationOfflineSimService")
77  << "Attempting to check if nonexistant pixel is dead. Exception message: " << e.what();
78  isDead = false;
79  }
80  return isDead;
81 }
82 
83 bool SiPixelGainCalibrationOfflineSimService::isNoisyColumn(const uint32_t& detID, const int& col, const int& row) {
84  bool isDead = false;
85  bool isNoisy = false;
86  try {
87  this->getGainByColumn(detID, col, row, isDead, isNoisy); // the gain column average can flag a whole column as bad
88  } catch (cms::Exception& e) {
89  // Do not stop processing if you check if a nonexistant pixel is dead
90  edm::LogInfo("SiPixelGainCalibrationOfflineSimService")
91  << "Attempting to check if nonexistant pixel is Noisy. Exception message: " << e.what();
92  isNoisy = false;
93  }
94  return isNoisy;
95 }
SiPixelGainCalibrationOfflineSimService::isNoisyColumn
bool isNoisyColumn(const uint32_t &detID, const int &col, const int &row) override
Definition: SiPixelGainCalibrationOfflineSimService.cc:83
cuy.col
col
Definition: cuy.py:1010
edm::LogInfo
Definition: MessageLogger.h:254
SiPixelGainCalibrationOfflineSimService.h
SiPixelGainCalibrationServicePayloadGetter< SiPixelGainCalibrationOffline, SiPixelGainCalibrationOfflineSimRcd >::getGainByColumn
float getGainByColumn(const uint32_t &detID, const int &col, const int &row, bool &isDeadColumn, bool &isNoisyColumn)
Definition: SiPixelGainCalibrationServiceBase.h:265
SiPixelGainCalibrationOfflineSimService::getGain
float getGain(const uint32_t &detID, const int &col, const int &row) override
Definition: SiPixelGainCalibrationOfflineSimService.cc:30
SiPixelGainCalibrationOfflineSimService::getPedestal
float getPedestal(const uint32_t &detID, const int &col, const int &row) override
Definition: SiPixelGainCalibrationOfflineSimService.cc:19
SiPixelGainCalibrationOfflineSimService::isDead
bool isDead(const uint32_t &detID, const int &col, const int &row) override
Definition: SiPixelGainCalibrationOfflineSimService.cc:41
SiPixelGainCalibrationOfflineSimService::isDeadColumn
bool isDeadColumn(const uint32_t &detID, const int &col, const int &row) override
Definition: SiPixelGainCalibrationOfflineSimService.cc:69
cms::Exception
Definition: Exception.h:70
SiPixelGainCalibrationOfflineSimService::isNoisy
bool isNoisy(const uint32_t &detID, const int &col, const int &row) override
Definition: SiPixelGainCalibrationOfflineSimService.cc:55
SiPixelGainCalibrationServicePayloadGetter< SiPixelGainCalibrationOffline, SiPixelGainCalibrationOfflineSimRcd >::throwExepctionForBadRead
void throwExepctionForBadRead(std::string payload, const uint32_t &detID, const int &col, const int &row, double value=-1) const
Definition: SiPixelGainCalibrationServiceBase.h:302
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
SiPixelGainCalibrationServicePayloadGetter< SiPixelGainCalibrationOffline, SiPixelGainCalibrationOfflineSimRcd >::getPedestalByPixel
float getPedestalByPixel(const uint32_t &detID, const int &col, const int &row, bool &isDeadPixel, bool &isNoisyPixel)
Definition: SiPixelGainCalibrationServiceBase.h:186