28 using ReturnType = std::unique_ptr<SiStripClusterizerConditions>;
50 descriptions.
add(
"SiStripClusterizerConditionsESProducer",
desc);
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";
ESTransientHandle< ProductT > getTransientHandle(ESGetToken< ProductT, DepRecordT > const &iToken) const
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
T getParameter(std::string const &) const
~SiStripClusterizerConditionsESProducer() override
edm::ESGetToken< SiStripNoises, SiStripNoisesRcd > m_noisesToken
SiStripClusterizerConditionsESProducer(const edm::ParameterSet &)
ReturnType produce(const SiStripClusterizerConditionsRcd &)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
#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
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
edm::ESGetToken< SiStripQuality, SiStripQualityRcd > m_qualityToken