CMS 3D CMS Logo

List of all members | Public Member Functions
SiPixelGainCalibrationForHLTService Class Referencefinal

#include <SiPixelGainCalibrationForHLTService.h>

Inheritance diagram for SiPixelGainCalibrationForHLTService:
SiPixelGainCalibrationServicePayloadGetter< SiPixelGainCalibrationForHLT, SiPixelGainCalibrationForHLTRcd > SiPixelGainCalibrationServiceBase

Public Member Functions

void calibrate (uint32_t detID, DigiIterator b, DigiIterator e, float conversionFactor, float offset, int *electron) override
 
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
 
 SiPixelGainCalibrationForHLTService (const edm::ParameterSet &conf)
 
 ~SiPixelGainCalibrationForHLTService () override
 
- Public Member Functions inherited from SiPixelGainCalibrationServicePayloadGetter< SiPixelGainCalibrationForHLT, SiPixelGainCalibrationForHLTRcd >
std::vector< uint32_t > getDetIds () override
 
double getGainHigh () override
 
double getGainLow () override
 
double getPedHigh () override
 
double getPedLow () override
 
SiPixelGainCalibrationForHLT const & payload () const
 
void setESObjects (const edm::EventSetup &es) override
 
 SiPixelGainCalibrationServicePayloadGetter (const edm::ParameterSet &conf)
 
 ~SiPixelGainCalibrationServicePayloadGetter () override
 
- Public Member Functions inherited from SiPixelGainCalibrationServiceBase
 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< SiPixelGainCalibrationForHLT, SiPixelGainCalibrationForHLTRcd >
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< SiPixelGainCalibrationForHLT, SiPixelGainCalibrationForHLTRcd >
edm::ParameterSet conf_
 
bool ESetupInit_
 
double gainHigh_
 
double gainLow_
 
int numberOfRowsAveragedOver_
 
int old_cols
 
uint32_t old_detID
 
SiPixelGainCalibrationForHLT ::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< SiPixelGainCalibrationForHLTped
 
double pedHigh_
 
double pedLow_
 

Detailed Description

Definition at line 21 of file SiPixelGainCalibrationForHLTService.h.

Constructor & Destructor Documentation

◆ SiPixelGainCalibrationForHLTService()

SiPixelGainCalibrationForHLTService::SiPixelGainCalibrationForHLTService ( const edm::ParameterSet conf)
inlineexplicit

◆ ~SiPixelGainCalibrationForHLTService()

SiPixelGainCalibrationForHLTService::~SiPixelGainCalibrationForHLTService ( )
inlineoverride

Definition at line 27 of file SiPixelGainCalibrationForHLTService.h.

27 {};

Member Function Documentation

◆ calibrate()

void SiPixelGainCalibrationForHLTService::calibrate ( uint32_t  detID,
DigiIterator  b,
DigiIterator  e,
float  conversionFactor,
float  offset,
int *  electron 
)
overridevirtual

Reimplemented from SiPixelGainCalibrationServiceBase.

Definition at line 20 of file SiPixelGainCalibrationForHLTService.cc.

21  {
23  int cols;
24  std::tie(range, cols) = ped->getRangeAndNCols(detID);
25  float pedestal = 0, gain = 0;
26  int i = 0;
27  bool isDeadColumn = false, isNoisyColumn = false;
28  int oldCol = -1, oldAveragedBlock = -1;
29  for (DigiIterator di = b; di != e; ++di) {
30  int row = di->row();
31  int col = di->column();
32  int averagedBlock = row / numberOfRowsAveragedOver_;
33  if ((col != oldCol) | (averagedBlock != oldAveragedBlock)) {
34  oldCol = col;
35  oldAveragedBlock = averagedBlock;
36  std::tie(pedestal, gain) = ped->getPedAndGain(col, row, range, cols, isDeadColumn, isNoisyColumn);
37  }
39  electron[i++] = 0;
40  else {
41  float vcal = di->adc() * gain - pedestal * gain;
42  // float vcal = (di->adc() - DBpedestal) * DBgain;
43  electron[i++] = int(vcal * conversionFactor + offset);
44  }
45  }
46  assert(i == (e - b));
47 }

References cms::cuda::assert(), b, cuy::col, MillePedeFileConverter_cfg::e, HPSPFTauProducerPuppi_cfi::electron, PedestalClient_cfi::gain, SiPixelGainCalibrationForHLT::getPedAndGain(), SiPixelGainCalibrationForHLT::getRangeAndNCols(), mps_fire::i, createfilelist::int, isDeadColumn(), isNoisyColumn(), SiPixelGainCalibrationServicePayloadGetter< SiPixelGainCalibrationForHLT, SiPixelGainCalibrationForHLTRcd >::numberOfRowsAveragedOver_, hltrates_dqm_sourceclient-live_cfg::offset, SiPixelGainCalibrationServicePayloadGetter< SiPixelGainCalibrationForHLT, SiPixelGainCalibrationForHLTRcd >::ped, EcalCondDBWriter_cfi::pedestal, and FastTimerService_cff::range.

◆ getGain()

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

◆ getPedestal()

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

◆ isDead()

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

Implements SiPixelGainCalibrationServicePayloadGetter< SiPixelGainCalibrationForHLT, SiPixelGainCalibrationForHLTRcd >.

Definition at line 71 of file SiPixelGainCalibrationForHLTService.cc.

71  {
72  bool isDead = false;
73  bool isNoisy = false;
74  try {
75  this->getPedestalByColumn(detID, col, row, isDead, isNoisy); //pedestal stores dead column value as well
76  } catch (cms::Exception& e) {
77  // Do not stop processing if you check if a nonexistant pixel is dead
78  edm::LogInfo("SiPixelGainCalibrationForHLTService")
79  << "Attempting to check if nonexistant pixel is dead. Exception message: " << e.what();
80  isDead = false;
81  }
82  return isDead;
83 }

References cuy::col, MillePedeFileConverter_cfg::e, SiPixelGainCalibrationServicePayloadGetter< SiPixelGainCalibrationForHLT, SiPixelGainCalibrationForHLTRcd >::getPedestalByColumn(), and isNoisy().

Referenced by getGain(), getPedestal(), isDeadColumn(), isNoisy(), and isNoisyColumn().

◆ isDeadColumn()

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

Implements SiPixelGainCalibrationServicePayloadGetter< SiPixelGainCalibrationForHLT, SiPixelGainCalibrationForHLTRcd >.

Definition at line 99 of file SiPixelGainCalibrationForHLTService.cc.

99  {
100  bool isDead = false;
101  bool isNoisy = false;
102  try {
103  this->getGainByColumn(detID, col, row, isDead, isNoisy);
104  } catch (cms::Exception& e) {
105  // Do not stop processing if you check if a nonexistant pixel is dead
106  edm::LogInfo("SiPixelGainCalibrationForHLTService")
107  << "Attempting to check if nonexistant pixel is dead. Exception message: " << e.what();
108  isDead = false;
109  }
110  return isDead;
111 }

References cuy::col, MillePedeFileConverter_cfg::e, SiPixelGainCalibrationServicePayloadGetter< SiPixelGainCalibrationForHLT, SiPixelGainCalibrationForHLTRcd >::getGainByColumn(), isDead(), and isNoisy().

Referenced by calibrate().

◆ isNoisy()

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

Implements SiPixelGainCalibrationServicePayloadGetter< SiPixelGainCalibrationForHLT, SiPixelGainCalibrationForHLTRcd >.

Definition at line 85 of file SiPixelGainCalibrationForHLTService.cc.

85  {
86  bool isDead = false;
87  bool isNoisy = false;
88  try {
89  this->getPedestalByColumn(detID, col, row, isDead, isNoisy); //pedestal stores noisy column value as well
90  } catch (cms::Exception& e) {
91  // Do not stop processing if you check if a nonexistant pixel is noisy
92  edm::LogInfo("SiPixelGainCalibrationForHLTService")
93  << "Attempting to check if nonexistant pixel is noisy. Exception message: " << e.what();
94  isNoisy = false;
95  }
96  return isNoisy;
97 }

References cuy::col, MillePedeFileConverter_cfg::e, SiPixelGainCalibrationServicePayloadGetter< SiPixelGainCalibrationForHLT, SiPixelGainCalibrationForHLTRcd >::getPedestalByColumn(), and isDead().

Referenced by getGain(), getPedestal(), isDead(), isDeadColumn(), and isNoisyColumn().

◆ isNoisyColumn()

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

Implements SiPixelGainCalibrationServicePayloadGetter< SiPixelGainCalibrationForHLT, SiPixelGainCalibrationForHLTRcd >.

Definition at line 113 of file SiPixelGainCalibrationForHLTService.cc.

113  {
114  bool isDead = false;
115  bool isNoisy = false;
116  try {
117  this->getGainByColumn(detID, col, row, isDead, isNoisy);
118  } catch (cms::Exception& e) {
119  // Do not stop processing if you check if a nonexistant pixel is noisy
120  edm::LogInfo("SiPixelGainCalibrationForHLTService")
121  << "Attempting to check if nonexistant pixel is noisy. Exception message: " << e.what();
122  isNoisy = false;
123  }
124  return isNoisy;
125 }

References cuy::col, MillePedeFileConverter_cfg::e, SiPixelGainCalibrationServicePayloadGetter< SiPixelGainCalibrationForHLT, SiPixelGainCalibrationForHLTRcd >::getGainByColumn(), isDead(), and isNoisy().

Referenced by calibrate().

FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
mps_fire.i
i
Definition: mps_fire.py:355
SiPixelGainCalibrationForHLT::getPedAndGain
std::pair< float, float > getPedAndGain(const int &col, const int &row, const Range &range, const int &nCols, bool &isDeadColumn, bool &isNoisyColumn) const
Definition: SiPixelGainCalibrationForHLT.cc:134
SiPixelGainCalibrationServiceBase::DigiIterator
edm::DetSet< PixelDigi >::const_iterator DigiIterator
Definition: SiPixelGainCalibrationServiceBase.h:31
cuy.col
col
Definition: cuy.py:1010
edm::LogInfo
Definition: MessageLogger.h:254
cms::cuda::assert
assert(be >=bs)
SiPixelGainCalibrationForHLT::Range
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiPixelGainCalibrationForHLT.h:51
SiPixelGainCalibrationServicePayloadGetter< SiPixelGainCalibrationForHLT, SiPixelGainCalibrationForHLTRcd >::getPedestalByColumn
float getPedestalByColumn(const uint32_t &detID, const int &col, const int &row, bool &isDeadColumn, bool &isNoisyColumn)
Definition: SiPixelGainCalibrationServiceBase.h:227
SiPixelGainCalibrationServicePayloadGetter< SiPixelGainCalibrationForHLT, SiPixelGainCalibrationForHLTRcd >::numberOfRowsAveragedOver_
int numberOfRowsAveragedOver_
Definition: SiPixelGainCalibrationServiceBase.h:98
SiPixelGainCalibrationServicePayloadGetter< SiPixelGainCalibrationForHLT, SiPixelGainCalibrationForHLTRcd >::getGainByColumn
float getGainByColumn(const uint32_t &detID, const int &col, const int &row, bool &isDeadColumn, bool &isNoisyColumn)
Definition: SiPixelGainCalibrationServiceBase.h:265
SiPixelGainCalibrationForHLTService::isNoisy
bool isNoisy(const uint32_t &detID, const int &col, const int &row) override
Definition: SiPixelGainCalibrationForHLTService.cc:85
SiPixelGainCalibrationServicePayloadGetter< SiPixelGainCalibrationForHLT, SiPixelGainCalibrationForHLTRcd >
SiPixelGainCalibrationServicePayloadGetter< SiPixelGainCalibrationForHLT, SiPixelGainCalibrationForHLTRcd >::ped
edm::ESHandle< SiPixelGainCalibrationForHLT > ped
Definition: SiPixelGainCalibrationServiceBase.h:97
b
double b
Definition: hdecay.h:118
SiPixelGainCalibrationForHLTService::isDead
bool isDead(const uint32_t &detID, const int &col, const int &row) override
Definition: SiPixelGainCalibrationForHLTService.cc:71
createfilelist.int
int
Definition: createfilelist.py:10
EcalCondDBWriter_cfi.pedestal
pedestal
Definition: EcalCondDBWriter_cfi.py:49
HPSPFTauProducerPuppi_cfi.electron
electron
Definition: HPSPFTauProducerPuppi_cfi.py:13
SiPixelGainCalibrationForHLT::getRangeAndNCols
const std::pair< const Range, const int > getRangeAndNCols(const uint32_t &detID) const
Definition: SiPixelGainCalibrationForHLT.cc:88
PedestalClient_cfi.gain
gain
Definition: PedestalClient_cfi.py:37
cms::Exception
Definition: Exception.h:70
SiPixelGainCalibrationForHLTService::isDeadColumn
bool isDeadColumn(const uint32_t &detID, const int &col, const int &row) override
Definition: SiPixelGainCalibrationForHLTService.cc:99
SiPixelGainCalibrationForHLTService::isNoisyColumn
bool isNoisyColumn(const uint32_t &detID, const int &col, const int &row) override
Definition: SiPixelGainCalibrationForHLTService.cc:113
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:82
SiPixelGainCalibrationServicePayloadGetter< SiPixelGainCalibrationForHLT, SiPixelGainCalibrationForHLTRcd >::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