CMS 3D CMS Logo

List of all members | Public Member Functions
SiPixelGainCalibrationService Class Reference

#include <SiPixelGainCalibrationService.h>

Inheritance diagram for SiPixelGainCalibrationService:
SiPixelGainCalibrationServicePayloadGetter< SiPixelGainCalibration, SiPixelGainCalibrationRcd > SiPixelGainCalibrationServiceBase

Public Member Functions

float getGain (const uint32_t &detID, const int &col, const int &row) override
 
float getPedestal (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 isDeadColumn (const uint32_t &detID, const int &col, const int &row) override
 
bool isNoisy (const uint32_t &detID, const int &col, const int &row) override
 
bool isNoisyColumn (const uint32_t &detID, const int &col, const int &row) override
 
 SiPixelGainCalibrationService (const edm::ParameterSet &conf)
 
 ~SiPixelGainCalibrationService () override
 
- Public Member Functions inherited from SiPixelGainCalibrationServicePayloadGetter< SiPixelGainCalibration, SiPixelGainCalibrationRcd >
std::vector< uint32_t > getDetIds () override
 
double getGainHigh () override
 
double getGainLow () override
 
double getPedHigh () override
 
double getPedLow () override
 
SiPixelGainCalibration const & payload () const
 
void setESObjects (const edm::EventSetup &es) override
 
 SiPixelGainCalibrationServicePayloadGetter (const edm::ParameterSet &conf)
 
 ~SiPixelGainCalibrationServicePayloadGetter () override
 
- Public Member Functions inherited from SiPixelGainCalibrationServiceBase
virtual void calibrate (uint32_t detID, DigiIterator b, DigiIterator e, float conversionFactor, float offset, int *electron)
 
 SiPixelGainCalibrationServiceBase ()
 
virtual ~SiPixelGainCalibrationServiceBase ()
 

Additional Inherited Members

- Public Types inherited from SiPixelGainCalibrationServiceBase
typedef edm::DetSet< PixelDigi >::const_iterator DigiIterator
 
- Protected Member Functions inherited from SiPixelGainCalibrationServicePayloadGetter< SiPixelGainCalibration, SiPixelGainCalibrationRcd >
float getGainByColumn (const uint32_t &detID, const int &col, const int &row, bool &isDeadColumn, bool &isNoisyColumn)
 
float getGainByPixel (const uint32_t &detID, const int &col, const int &row, bool &isDeadPixel, bool &isNoisyPixel)
 
float getPedestalByColumn (const uint32_t &detID, const int &col, const int &row, bool &isDeadColumn, bool &isNoisyColumn)
 
float getPedestalByPixel (const uint32_t &detID, const int &col, const int &row, bool &isDeadPixel, bool &isNoisyPixel)
 
void throwExepctionForBadRead (std::string payload, const uint32_t &detID, const int &col, const int &row, double value=-1) const
 
- Protected Attributes inherited from SiPixelGainCalibrationServicePayloadGetter< SiPixelGainCalibration, SiPixelGainCalibrationRcd >
edm::ParameterSet conf_
 
bool ESetupInit_
 
double gainHigh_
 
double gainLow_
 
int numberOfRowsAveragedOver_
 
int old_cols
 
uint32_t old_detID
 
SiPixelGainCalibration::Range old_range
 
int oldAveragedBlockDataGain_
 
int oldAveragedBlockDataPed_
 
int oldColumnIndexGain_
 
int oldColumnIndexPed_
 
float oldColumnValueGain_
 
float oldColumnValuePed_
 
bool oldThisColumnIsDeadGain_
 
bool oldThisColumnIsDeadPed_
 
bool oldThisColumnIsNoisyGain_
 
bool oldThisColumnIsNoisyPed_
 
edm::ESHandle< SiPixelGainCalibrationped
 
double pedHigh_
 
double pedLow_
 

Detailed Description

Definition at line 21 of file SiPixelGainCalibrationService.h.

Constructor & Destructor Documentation

SiPixelGainCalibrationService::SiPixelGainCalibrationService ( const edm::ParameterSet conf)
inlineexplicit
SiPixelGainCalibrationService::~SiPixelGainCalibrationService ( )
inlineoverride

Member Function Documentation

float SiPixelGainCalibrationService::getGain ( const uint32_t &  detID,
const int &  col,
const int &  row 
)
overridevirtual

Implements SiPixelGainCalibrationServicePayloadGetter< SiPixelGainCalibration, SiPixelGainCalibrationRcd >.

Definition at line 54 of file SiPixelGainCalibrationService.cc.

References SiPixelGainCalibrationServiceBase::isDead(), and SiPixelGainCalibrationServiceBase::isNoisy().

Referenced by ~SiPixelGainCalibrationService().

55 {
56  bool isDead = false;
57  bool isNoisy = false;
58  float gainValue = this->getGainByColumn(detID, col, row, isDead, isNoisy);
59  if (isDead || isNoisy)
60  {
61  this->throwExepctionForBadRead("FullCalibration getGain()",detID, col, row, gainValue);
62  return 0.0;
63  }
64  return gainValue;
65 }
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
col
Definition: cuy.py:1010
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
float SiPixelGainCalibrationService::getPedestal ( const uint32_t &  detID,
const int &  col,
const int &  row 
)
overridevirtual

Implements SiPixelGainCalibrationServicePayloadGetter< SiPixelGainCalibration, SiPixelGainCalibrationRcd >.

Definition at line 41 of file SiPixelGainCalibrationService.cc.

References SiPixelGainCalibrationServiceBase::isDead(), and SiPixelGainCalibrationServiceBase::isNoisy().

Referenced by ~SiPixelGainCalibrationService().

42 {
43  bool isDead = false;
44  bool isNoisy = false;
45  float pedestalValue = this->getPedestalByPixel(detID, col, row, isDead, isNoisy);
46  if (isDead || isNoisy)
47  {
48  this->throwExepctionForBadRead("FullCalibration getPedestal()",detID, col, row, pedestalValue);
49  return 0.0;
50  }
51  return pedestalValue;
52 }
float getPedestalByPixel(const uint32_t &detID, const int &col, const int &row, bool &isDeadPixel, bool &isNoisyPixel)
void throwExepctionForBadRead(std::string payload, const uint32_t &detID, const int &col, const int &row, double value=-1) const
col
Definition: cuy.py:1010
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
bool SiPixelGainCalibrationService::isDead ( const uint32_t &  detID,
const int &  col,
const int &  row 
)
overridevirtual

Implements SiPixelGainCalibrationServicePayloadGetter< SiPixelGainCalibration, SiPixelGainCalibrationRcd >.

Definition at line 67 of file SiPixelGainCalibrationService.cc.

References MillePedeFileConverter_cfg::e, SiPixelGainCalibrationServiceBase::isDead(), SiPixelGainCalibrationServiceBase::isNoisy(), and cms::Exception::what().

Referenced by ~SiPixelGainCalibrationService().

68 {
69  bool isDead = false;
70  bool isNoisy = false;
71  try
72  {
73  this->getPedestalByPixel(detID, col, row, isDead, isNoisy);
74  }
75  catch (cms::Exception& e)
76  {
77  // Do not stop processing if you check if a nonexistant pixel is dead
78  edm::LogInfo("SiPixelGainCalibrationService") << "Attempting to check if nonexistant pixel is dead. Exception message: " << e.what();
79  isDead = false;
80  }
81  return isDead;
82 }
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
col
Definition: cuy.py:1010
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
bool SiPixelGainCalibrationService::isDeadColumn ( const uint32_t &  detID,
const int &  col,
const int &  row 
)
overridevirtual

Implements SiPixelGainCalibrationServicePayloadGetter< SiPixelGainCalibration, SiPixelGainCalibrationRcd >.

Definition at line 101 of file SiPixelGainCalibrationService.cc.

Referenced by ~SiPixelGainCalibrationService().

102 {
103  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!";
104  return false;
105 }
bool SiPixelGainCalibrationService::isNoisy ( const uint32_t &  detID,
const int &  col,
const int &  row 
)
overridevirtual

Implements SiPixelGainCalibrationServicePayloadGetter< SiPixelGainCalibration, SiPixelGainCalibrationRcd >.

Definition at line 84 of file SiPixelGainCalibrationService.cc.

References MillePedeFileConverter_cfg::e, SiPixelGainCalibrationServiceBase::isDead(), SiPixelGainCalibrationServiceBase::isNoisy(), and cms::Exception::what().

Referenced by ~SiPixelGainCalibrationService().

85 {
86  bool isDead = false;
87  bool isNoisy = false;
88  try
89  {
90  this->getPedestalByPixel(detID, col, row, isDead, isNoisy);
91  }
92  catch (cms::Exception& e)
93  {
94  // Do not stop processing if you check if a nonexistant pixel is noisy
95  edm::LogInfo("SiPixelGainCalibrationService") << "Attempting to check if nonexistant pixel is noisy. Exception message: " << e.what();
96  isNoisy = false;
97  }
98  return isNoisy;
99 }
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
col
Definition: cuy.py:1010
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
bool SiPixelGainCalibrationService::isNoisyColumn ( const uint32_t &  detID,
const int &  col,
const int &  row 
)
overridevirtual

Implements SiPixelGainCalibrationServicePayloadGetter< SiPixelGainCalibration, SiPixelGainCalibrationRcd >.

Definition at line 107 of file SiPixelGainCalibrationService.cc.

Referenced by ~SiPixelGainCalibrationService().

108 {
109  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!";
110  return false;
111 }