39 virtual ~ProductAdder() =
default;
43 template <
typename Product,
typename RealRecord>
44 class ProductAdderT :
public ProductAdder {
49 quality.
add(&iRecord.
get(token_));
56 template <
typename Product,
typename RealRecord>
58 return std::make_unique<ProductAdderT<Product, RealRecord>>(cc,
label);
80 : thresholdForReducedGranularity_{iConfig.
getParameter<
double>(
"ThresholdForReducedGranularity")},
88 bool doRunInfo =
false;
91 auto toGet = iConfig.
getParameter<std::vector<edm::ParameterSet>>(
"ListOfRecordToMerge");
93 for (
const auto& toGetPSet :
toGet) {
94 auto tagName = toGetPSet.getParameter<
std::string>(
"tag");
98 <<
"[SiStripQualityESProducer::ctor] Going to get data from record " << recordName <<
" with tag " << tagName;
100 if (recordName ==
"SiStripBadModuleRcd") {
101 productAdders_.emplace_back(make_ProductAdder<SiStripBadStrip, SiStripBadModuleRcd>(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") {
113 runInfoTagName = tagName;
118 <<
"[SiStripQualityESProducer::ctor] Skipping the requested data for unexisting record " << recordName
119 <<
" with tag " << tagName << std::endl;
132 auto quality = std::make_unique<SiStripQuality>(detInfo);
133 edm::LogInfo(
"SiStripQualityESProducer") <<
"produce called";
141 adder->add(iRecord, *quality);
153 quality->cleanUp(
true);
156 quality->fillBadComponents();
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
~SiStripQualityESProducer() override
auto consumesFrom(ESInputTag const &tag)
Log< level::Error, false > LogError
void add(uint32_t, const SiStripBadStrip::Range &)
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
const bool reduceGranularity_
std::unique_ptr< SiStripQuality > produce(const SiStripQualityRcd &)
SiStripDetInfo read(std::string filePath)
edm::ESGetToken< RunInfo, RunInfoRcd > runInfoToken_
constexpr bool isInitialized() const noexcept
const double thresholdForReducedGranularity_
Log< level::Info, false > LogInfo
void add(std::map< std::string, TH1 * > &h, TH1 *hist)
T getParameter(std::string const &) const
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
std::vector< std::unique_ptr< const ProductAdder > > productAdders_
const bool useEmptyRunInfo_
static constexpr char const *const kDefaultFile
const bool printDebugOutput_
SiStripQualityESProducer(const edm::ParameterSet &)