41 auto cc = setWhatProduced(
this);
43 auto apvGainLabels =
iConfig.getParameter<std::vector<edm::ParameterSet> >(
"APVGain");
44 if (apvGainLabels.empty()) {
45 throw cms::Exception(
"Configuration") <<
"Got empty APVGain vector, but need at least one entry";
49 for (
const auto& gainPSet : apvGainLabels) {
51 tokenLabels_.emplace_back(
52 cc, gainPSet.getParameter<
std::string>(
"Record"), gainPSet.getUntrackedParameter<
std::string>(
"Label",
""));
53 factor_.push_back_norm(gainPSet.getUntrackedParameter<
double>(
"NormalizationFactor", 1.));
56 factor_.resetIfBadNorm();
64 auto gain = std::make_unique<SiStripGain>(apvGain,
factor_.
get(apvGain, 0),
tokenLabels_[0].recordLabel_, detInfo);
std::unique_ptr< SiStripGain > produce(const SiStripGainSimRcd &)
edm::ESGetToken< SiStripApvGain, SiStripApvGainSimRcd > token_
~SiStripGainSimESProducer() override
std::vector< TokenLabel > tokenLabels_
auto consumesFrom(ESInputTag const &tag)
TokenLabel(edm::ESConsumesCollector &cc, std::string record, std::string label)
std::pair< std::string, std::string > recordLabel_
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
SiStripDetInfo read(std::string filePath)
SiStripGainFactor factor_
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
double get(const SiStripApvGain &gain, const int apvGainIndex) const
static constexpr char const *const kDefaultFile
SiStripGainSimESProducer(const edm::ParameterSet &)