CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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, edm::ConsumesCollector iC)
 
- 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, edm::ConsumesCollector iC)
 
- 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
 
- Static Public Member Functions inherited from SiPixelGainCalibrationServiceBase
static void fillPSetDescription (edm::ParameterSetDescription &desc)
 
- 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_
 
const SiPixelGainCalibrationped
 
double pedHigh_
 
double pedLow_
 
const edm::ESGetToken< SiPixelGainCalibration, SiPixelGainCalibrationRcdpedToken_
 

Detailed Description

Definition at line 21 of file SiPixelGainCalibrationService.h.

Constructor & Destructor Documentation

◆ SiPixelGainCalibrationService()

SiPixelGainCalibrationService::SiPixelGainCalibrationService ( const edm::ParameterSet conf,
edm::ConsumesCollector  iC 
)
inlineexplicit

Member Function Documentation

◆ getGain()

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

Implements SiPixelGainCalibrationServicePayloadGetter< SiPixelGainCalibration, SiPixelGainCalibrationRcd >.

Definition at line 49 of file SiPixelGainCalibrationService.cc.

References cuy::col, SiPixelGainCalibrationServicePayloadGetter< SiPixelGainCalibration, SiPixelGainCalibrationRcd >::getGainByColumn(), isDead(), isNoisy(), and SiPixelGainCalibrationServicePayloadGetter< SiPixelGainCalibration, SiPixelGainCalibrationRcd >::throwExepctionForBadRead().

Referenced by cms::SiPixelCondObjReader::analyze().

49  {
50  bool isDead = false;
51  bool isNoisy = false;
52  float gainValue = this->getGainByColumn(detID, col, row, isDead, isNoisy);
53  if (isDead || isNoisy) {
54  this->throwExepctionForBadRead("FullCalibration getGain()", detID, col, row, gainValue);
55  return 0.0;
56  }
57  return gainValue;
58 }
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:1009
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

◆ getPedestal()

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

Implements SiPixelGainCalibrationServicePayloadGetter< SiPixelGainCalibration, SiPixelGainCalibrationRcd >.

Definition at line 38 of file SiPixelGainCalibrationService.cc.

References cuy::col, SiPixelGainCalibrationServicePayloadGetter< SiPixelGainCalibration, SiPixelGainCalibrationRcd >::getPedestalByPixel(), isDead(), isNoisy(), and SiPixelGainCalibrationServicePayloadGetter< SiPixelGainCalibration, SiPixelGainCalibrationRcd >::throwExepctionForBadRead().

Referenced by cms::SiPixelCondObjReader::analyze().

38  {
39  bool isDead = false;
40  bool isNoisy = false;
41  float pedestalValue = this->getPedestalByPixel(detID, col, row, isDead, isNoisy);
42  if (isDead || isNoisy) {
43  this->throwExepctionForBadRead("FullCalibration getPedestal()", detID, col, row, pedestalValue);
44  return 0.0;
45  }
46  return pedestalValue;
47 }
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:1009
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

◆ isDead()

bool SiPixelGainCalibrationService::isDead ( const uint32_t &  detID,
const int &  col,
const int &  row 
)
overridevirtual

Implements SiPixelGainCalibrationServicePayloadGetter< SiPixelGainCalibration, SiPixelGainCalibrationRcd >.

Definition at line 60 of file SiPixelGainCalibrationService.cc.

References cuy::col, MillePedeFileConverter_cfg::e, SiPixelGainCalibrationServicePayloadGetter< SiPixelGainCalibration, SiPixelGainCalibrationRcd >::getPedestalByPixel(), and isNoisy().

Referenced by cms::SiPixelCondObjReader::analyze(), getGain(), getPedestal(), and isNoisy().

60  {
61  bool isDead = false;
62  bool isNoisy = false;
63  try {
64  this->getPedestalByPixel(detID, col, row, isDead, isNoisy);
65  } catch (cms::Exception& e) {
66  // Do not stop processing if you check if a nonexistant pixel is dead
67  edm::LogInfo("SiPixelGainCalibrationService")
68  << "Attempting to check if nonexistant pixel is dead. Exception message: " << e.what();
69  isDead = false;
70  }
71  return isDead;
72 }
float getPedestalByPixel(const uint32_t &detID, const int &col, const int &row, bool &isDeadPixel, bool &isNoisyPixel)
Log< level::Info, false > LogInfo
col
Definition: cuy.py:1009
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

◆ isDeadColumn()

bool SiPixelGainCalibrationService::isDeadColumn ( const uint32_t &  detID,
const int &  col,
const int &  row 
)
overridevirtual

Implements SiPixelGainCalibrationServicePayloadGetter< SiPixelGainCalibration, SiPixelGainCalibrationRcd >.

Definition at line 88 of file SiPixelGainCalibrationService.cc.

88  {
89  edm::LogError("SiPixelGainCalibrationService")
90  << "You attempted to check if an entire column was dead with a payload that stores information at pixel "
91  "granularity. Please check by pixel. THANKS!";
92  return false;
93 }
Log< level::Error, false > LogError

◆ isNoisy()

bool SiPixelGainCalibrationService::isNoisy ( const uint32_t &  detID,
const int &  col,
const int &  row 
)
overridevirtual

Implements SiPixelGainCalibrationServicePayloadGetter< SiPixelGainCalibration, SiPixelGainCalibrationRcd >.

Definition at line 74 of file SiPixelGainCalibrationService.cc.

References cuy::col, MillePedeFileConverter_cfg::e, SiPixelGainCalibrationServicePayloadGetter< SiPixelGainCalibration, SiPixelGainCalibrationRcd >::getPedestalByPixel(), and isDead().

Referenced by cms::SiPixelCondObjReader::analyze(), getGain(), getPedestal(), and isDead().

74  {
75  bool isDead = false;
76  bool isNoisy = false;
77  try {
78  this->getPedestalByPixel(detID, col, row, isDead, isNoisy);
79  } catch (cms::Exception& e) {
80  // Do not stop processing if you check if a nonexistant pixel is noisy
81  edm::LogInfo("SiPixelGainCalibrationService")
82  << "Attempting to check if nonexistant pixel is noisy. Exception message: " << e.what();
83  isNoisy = false;
84  }
85  return isNoisy;
86 }
float getPedestalByPixel(const uint32_t &detID, const int &col, const int &row, bool &isDeadPixel, bool &isNoisyPixel)
Log< level::Info, false > LogInfo
col
Definition: cuy.py:1009
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

◆ isNoisyColumn()

bool SiPixelGainCalibrationService::isNoisyColumn ( const uint32_t &  detID,
const int &  col,
const int &  row 
)
overridevirtual

Implements SiPixelGainCalibrationServicePayloadGetter< SiPixelGainCalibration, SiPixelGainCalibrationRcd >.

Definition at line 95 of file SiPixelGainCalibrationService.cc.

95  {
96  edm::LogError("SiPixelGainCalibrationService")
97  << "You attempted to check if an entire column was noisy with a payload that stores information at pixel "
98  "granularity. Please check by pixel. THANKS!";
99  return false;
100 }
Log< level::Error, false > LogError