57 auto const& dus =
geom.detUnits();
58 unsigned int n_detectors = dus.size();
59 for (
unsigned int i = 1;
i < 7; ++
i) {
61 if (
offset != dus.size() && dus[
offset]->type().isTrackerStrip()) {
67 LogDebug(
"SiPixelGainCalibrationForHLTSoA")
68 <<
"caching calibs for " << n_detectors <<
" pixel detectors of size " <<
gains.data().size() <<
'\n' 71 for (
size_t i = 0;
i <
gains.data().size();
i =
i + 2) {
72 product->view().v_pedestals()[
i / 2].gain =
gains.data()[
i];
73 product->view().v_pedestals()[
i / 2].ped =
gains.data()[
i + 1];
78 auto minPed =
gains.getPedLow();
79 auto maxPed =
gains.getPedHigh();
80 auto minGain =
gains.getGainLow();
81 auto maxGain =
gains.getGainHigh();
82 auto nBinsToUseForEncoding = 253;
85 product->view().minPed() = minPed;
86 product->view().maxPed() = maxPed;
87 product->view().minGain() = minGain;
88 product->view().maxGain() = maxGain;
90 product->view().numberOfRowsAveragedOver() = 80;
91 product->view().nBinsToUseForEncoding() = nBinsToUseForEncoding;
92 product->view().deadFlag() = 255;
93 product->view().noisyFlag() = 254;
95 product->view().pedPrecision() =
static_cast<float>(maxPed - minPed) / nBinsToUseForEncoding;
96 product->view().gainPrecision() =
static_cast<float>(maxGain - minGain) / nBinsToUseForEncoding;
98 LogDebug(
"SiPixelGainCalibrationForHLTSoA")
99 <<
"precisions g " << product->view().pedPrecision() <<
' ' << product->view().gainPrecision();
102 auto const& ind =
gains.getIndexes();
103 LogDebug(
"SiPixelGainCalibrationForHLTSoA") << ind.size() <<
" " << n_detectors;
105 for (
auto i = 0
U;
i < n_detectors; ++
i) {
108 assert(
p != ind.end() &&
p->detid == dus[
i]->geographicalId());
116 product->view().modStarts()[
i] =
p->ibegin;
117 product->view().modEnds()[
i] =
p->iend;
118 product->view().modCols()[
i] =
p->ncols;
120 if (ind[
i].detid != dus[
i]->geographicalId())
121 LogDebug(
"SiPixelGainCalibrationForHLTSoA") << ind[
i].detid <<
"!=" << dus[
i]->geographicalId();
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
SiPixelGainCalibrationForHLTSoAESProducer(const edm::ParameterSet &iConfig)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
uint32_t cc[maxCellsPerHit]
std::unique_ptr< SiPixelGainCalibrationForHLTHost > produce(const SiPixelGainCalibrationForHLTSoARcd &iRecord)
constexpr float gains[NGAINS]
#define DEFINE_FWK_EVENTSETUP_ALPAKA_MODULE(type)
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
constexpr SubDetector tkDetEnum[8]
edm::ESGetToken< SiPixelGainCalibrationForHLT, SiPixelGainCalibrationForHLTRcd > gainsToken_
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geometryToken_