17 edm::LogInfo(
"CTPPSPixelGainCalibration") <<
"Default instance of CTPPSPixelGainCalibration";
21 const uint32_t& sensorSize = 24960,
22 const uint32_t& nCols = 156)
23 : minPed_(0.), maxPed_(255.), minGain_(0.), maxGain_(255.) {
27 myreg.
iend = sensorSize;
29 myreg.
nrows = sensorSize / nCols;
32 <<
"Instance of CTPPSPixelGainCalibration setting detId = " <<
detId <<
" and npix = " << sensorSize
33 <<
" and ncols = " << nCols <<
" and nrows= " << myreg.
nrows;
38 : minPed_(minPed), maxPed_(maxPed), minGain_(minGain), maxGain_(maxGain) {
46 edm::LogInfo(
"CTPPSPixelGainCalibration") <<
"Instance of CTPPSPixelGainCalibration setting mininums and maximums";
50 const std::vector<float>& peds,
51 const std::vector<float>&
gains,
56 : minPed_(minPed), maxPed_(maxPed), minGain_(minGain), maxGain_(maxGain) {
59 <<
"Instance of CTPPSPixelGainCalibration setting detId = " << detid <<
"and vectors of peds and gains";
63 const std::vector<float>& peds,
64 const std::vector<float>&
gains) {
65 int sensorSize = peds.size();
66 int gainsSize =
gains.size();
67 if (gainsSize != sensorSize)
68 throw cms::Exception(
"CTPPSPixelGainCalibration payload configuration error")
69 <<
"[CTPPSPixelGainCalibration::CTPPSPixelGainCalibration] peds and gains vector sizes don't match for detid " 70 << detid <<
" size peds = " << sensorSize <<
" size gains = " << gainsSize;
74 myreg.
iend = sensorSize;
80 for (
int i = 0;
i < sensorSize; ++
i)
87 if (ped >= 0 &&
gain >= 0)
89 <<
"[CTPPSPixelGainCalibration::putData] attempting to fill the vectors that are already filled detid = " 93 edm::LogInfo(
"CTPPSPixelGainCalibration") <<
"resetting pixel calibration for noisy or dead flag";
98 <<
"[CTPPSPixelGainCalibration::putData] the order got scrambled detid = " <<
indexes.
detid <<
" ipix " << ipix;
115 edm::LogError(
"CTPPSPixelGainCalibration") <<
"this element ipix = " << ipix <<
" has not been set yet";
125 if (
col >= nCols || row >= nRows) {
127 <<
"[CTPPSPixelGainCalibration::getPed] Pixel out of range: col " <<
col <<
" row " << row;
130 int ipix =
col + row * nCols;
131 float tmpped =
getPed(ipix );
139 if (
col >= nCols || row >= nRows) {
141 <<
"[CTPPSPixelGainCalibration::getGain] Pixel out of range: col " <<
col <<
" row " << row;
144 int ipix =
col + row * nCols;
float getPed(const int &col, const int &row) const
void resetPixData(uint32_t ipix, float ped, float gain)
Log< level::Error, false > LogError
CTPPSPixelGainCalibration()
float getGain(const int &col, const int &row) const
std::vector< float > v_pedestals
void setGainsPeds(const uint32_t &detId, const std::vector< float > &peds, const std::vector< float > &gains)
constexpr float gains[NGAINS]
Log< level::Info, false > LogInfo
std::vector< float > v_gains
void setIndexes(const uint32_t &detId)
void putData(uint32_t ipix, float ped, float gain)