1 #ifndef CalibTracker_SiStripESProducers_SiStripGainFactor_h
2 #define CalibTracker_SiStripESProducers_SiStripGainFactor_h
18 bool badNorm = std::find_if(
norm_.begin(),
norm_.end(), [](
double x) {
return x <= 0.; }) !=
norm_.end();
21 edm::LogError(
"SiStripGainESProducer") <<
"[SiStripGainESProducer] - ERROR: negative or zero Normalization "
22 "factor provided. Assuming 1 for such factor"
32 std::vector<uint32_t> DetIds;
33 gain.getDetIds(DetIds);
35 double SumOfGains = 0.;
37 for (uint32_t detid : DetIds) {
41 for (std::vector<float>::const_iterator apvit = detRange.first; apvit != detRange.second; apvit++) {
42 SumOfGains += (*apvit);
46 <<
"detid/component: " << detid <<
"/" << iComp <<
" gain factor " << *apvit;
52 if (SumOfGains > 0 && NGains > 0) {
53 NFactor = SumOfGains /
NGains;
56 "SiStripGainESProducer::produce() - ERROR: empty set of gain values received. Cannot compute "
57 "normalization factor. Assuming 1 for such factor")
65 NFactor =
norm_[apvGainIndex];
70 <<
" putting A SiStrip Gain object in eventSetup with normalization factor " << NFactor;
T getUntrackedParameter(std::string const &, T const &) const
SiStripGainFactor(const edm::ParameterSet &iConfig)
Log< level::Error, false > LogError
void push_back_norm(double norm)
std::pair< ContainerIterator, ContainerIterator > Range
Log< level::Info, false > LogInfo
T getParameter(std::string const &) const
std::vector< double > norm_