37 virtual ~ProductAdder() =
default;
41 template <
typename Product,
typename RealRecord>
42 class ProductAdderT :
public ProductAdder {
47 quality.
add(&iRecord.
get(token_));
54 template <
typename Product,
typename RealRecord>
56 return std::make_unique<ProductAdderT<Product, RealRecord>>(cc,
label);
78 : thresholdForReducedGranularity_{iConfig.
getParameter<
double>(
"ThresholdForReducedGranularity")},
86 bool doRunInfo =
false;
89 auto toGet = iConfig.getParameter<std::vector<edm::ParameterSet>>(
"ListOfRecordToMerge");
91 for (
const auto& toGetPSet :
toGet) {
96 <<
"[SiStripQualityESProducer::ctor] Going to get data from record " << recordName <<
" with tag " <<
tagName;
98 if (recordName ==
"SiStripBadModuleRcd") {
99 productAdders_.emplace_back(make_ProductAdder<SiStripBadStrip, SiStripBadModuleRcd>(cc, tagName));
100 }
else if (recordName ==
"SiStripBadModuleFedErrRcd") {
101 productAdders_.emplace_back(make_ProductAdder<SiStripBadStrip, SiStripBadModuleFedErrRcd>(cc, tagName));
102 }
else if (recordName ==
"SiStripBadFiberRcd") {
103 productAdders_.emplace_back(make_ProductAdder<SiStripBadStrip, SiStripBadFiberRcd>(cc, tagName));
104 }
else if (recordName ==
"SiStripBadChannelRcd") {
105 productAdders_.emplace_back(make_ProductAdder<SiStripBadStrip, SiStripBadChannelRcd>(cc, tagName));
106 }
else if (recordName ==
"SiStripBadStripRcd") {
107 productAdders_.emplace_back(make_ProductAdder<SiStripBadStrip, SiStripBadStripRcd>(cc, tagName));
108 }
else if (recordName ==
"SiStripDetCablingRcd") {
109 productAdders_.emplace_back(make_ProductAdder<SiStripDetCabling, SiStripDetCablingRcd>(cc, tagName));
110 }
else if (recordName ==
"SiStripDetVOffRcd") {
111 productAdders_.emplace_back(make_ProductAdder<SiStripDetVOff, SiStripDetVOffRcd>(cc, tagName));
112 }
else if (recordName ==
"RunInfoRcd") {
118 <<
"[SiStripQualityESProducer::ctor] Skipping the requested data for unexisting record " << recordName
119 <<
" with tag " << tagName << std::endl;
130 auto quality = std::make_unique<SiStripQuality>();
131 edm::LogInfo(
"SiStripQualityESProducer") <<
"produce called";
T getParameter(std::string const &) const
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
void add(const uint32_t &, const SiStripBadStrip::Range &)
~SiStripQualityESProducer() override
auto consumesFrom(ESInputTag const &tag)
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
const bool reduceGranularity_
std::unique_ptr< SiStripQuality > produce(const SiStripQualityRcd &)
edm::ESGetToken< RunInfo, RunInfoRcd > runInfoToken_
const double thresholdForReducedGranularity_
void add(std::map< std::string, TH1 * > &h, TH1 *hist)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
std::vector< std::unique_ptr< const ProductAdder > > productAdders_
const bool useEmptyRunInfo_
constexpr bool isInitialized() const noexcept
const bool printDebugOutput_
SiStripQualityESProducer(const edm::ParameterSet &)