28 using ReturnType = std::unique_ptr<SiStripClusterizerConditions>;
50 descriptions.
add(
"SiStripClusterizerConditionsESProducer", desc);
56 const auto& noises = iRecord.
get(m_noisesToken);
57 const auto&
quality = iRecord.
get(m_qualityToken);
59 auto product = std::make_unique<SiStripClusterizerConditions>(&
quality);
61 const auto& connected =
quality.cabling()->connected();
62 const auto& detCabling =
quality.cabling()->getDetCabling();
63 product->reserve(connected.size());
64 for (
const auto&
conn : connected) {
65 const auto det =
conn.first;
66 if (!
quality.IsModuleBad(det)) {
67 const auto gainRange = gainsH->getRange(det);
68 std::vector<float> invGains;
71 gainRange.first, gainRange.second, std::back_inserter(invGains), [](
auto gain) {
return 1.f / gain; });
73 static const std::vector<const FedChannelConnection*> noConn{};
74 const auto detConn_it = detCabling.find(det);
76 product->emplace_back(det,
80 (detCabling.end() != detConn_it) ? (*detConn_it).second : noConn);
83 LogDebug(
"SiStripClusterizerConditionsESProducer")
84 <<
"Produced a SiStripClusterizerConditions object for " << product->allDets().size() <<
" modules";
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
ESTransientHandle< ProductT > getTransientHandle(ESGetToken< ProductT, DepRecordT > const &iToken) const
~SiStripClusterizerConditionsESProducer() override
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
edm::ESGetToken< SiStripNoises, SiStripNoisesRcd > m_noisesToken
SiStripClusterizerConditionsESProducer(const edm::ParameterSet &)
ReturnType produce(const SiStripClusterizerConditionsRcd &)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
T getParameter(std::string const &) const
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
edm::ESGetToken< SiStripGain, SiStripGainRcd > m_gainToken
std::unique_ptr< SiStripClusterizerConditions > ReturnType
edm::ESGetToken< SiStripQuality, SiStripQualityRcd > m_qualityToken