diff --git a/CalibTracker/SiPixelESProducers/plugins/SiPixelQualityESProducer.cc b/CalibTracker/SiPixelESProducers/plugins/SiPixelQualityESProducer.cc index d7681db11148c..38f64cc924f61 100644 --- a/CalibTracker/SiPixelESProducers/plugins/SiPixelQualityESProducer.cc +++ b/CalibTracker/SiPixelESProducers/plugins/SiPixelQualityESProducer.cc @@ -46,6 +46,7 @@ class SiPixelQualityESProducer : public edm::ESProducer, public edm::EventSetupR std::unique_ptr produce(const SiPixelQualityRcd& iRecord); std::unique_ptr produceWithLabel(const SiPixelQualityRcd& iRecord); + std::unique_ptr produceWithLabelRawToDigi(const SiPixelQualityRcd& iRecord); private: void setIntervalFor(const edm::eventsetup::EventSetupRecordKey&, @@ -66,6 +67,7 @@ class SiPixelQualityESProducer : public edm::ESProducer, public edm::EventSetupR const Tokens defaultTokens_; Tokens labelTokens_; + Tokens labelTokens_RawToDigi_; }; // @@ -79,10 +81,19 @@ SiPixelQualityESProducer::SiPixelQualityESProducer(const edm::ParameterSet& conf auto label = conf_.exists("siPixelQualityLabel") ? conf_.getParameter("siPixelQualityLabel") : std::string{}; - if (label == "forDigitizer" || label == "forRawToDigi") { + if (label == "forDigitizer") { labelTokens_ = Tokens(setWhatProduced(this, &SiPixelQualityESProducer::produceWithLabel, edm::es::Label(label)), label); } + + label = conf_.exists("siPixelQualityLabel_RawToDigi") + ? conf_.getParameter("siPixelQualityLabel_RawToDigi") + : std::string{}; + + if (label == "forRawToDigi") { + labelTokens_RawToDigi_ = Tokens( + setWhatProduced(this, &SiPixelQualityESProducer::produceWithLabelRawToDigi, edm::es::Label(label)), label); + } findingRecord(); } @@ -119,6 +130,9 @@ std::unique_ptr SiPixelQualityESProducer::produce(const SiPixelQ std::unique_ptr SiPixelQualityESProducer::produceWithLabel(const SiPixelQualityRcd& iRecord) { return get_pointer(iRecord, labelTokens_); } +std::unique_ptr SiPixelQualityESProducer::produceWithLabelRawToDigi(const SiPixelQualityRcd& iRecord) { + return get_pointer(iRecord, labelTokens_RawToDigi_); +} void SiPixelQualityESProducer::setIntervalFor(const edm::eventsetup::EventSetupRecordKey&, const edm::IOVSyncValue& iosv, diff --git a/CalibTracker/SiPixelESProducers/python/SiPixelQualityESProducer_cfi.py b/CalibTracker/SiPixelESProducers/python/SiPixelQualityESProducer_cfi.py index 3fee493a246c6..e226dbe013405 100644 --- a/CalibTracker/SiPixelESProducers/python/SiPixelQualityESProducer_cfi.py +++ b/CalibTracker/SiPixelESProducers/python/SiPixelQualityESProducer_cfi.py @@ -2,10 +2,11 @@ siPixelQualityESProducer = cms.ESProducer("SiPixelQualityESProducer", siPixelQualityLabel = cms.string(""), + siPixelQualityLabel_RawToDigi = cms.string("") ) from Configuration.ProcessModifiers.siPixelQualityRawToDigi_cff import siPixelQualityRawToDigi siPixelQualityRawToDigi.toModify(siPixelQualityESProducer, - siPixelQualityLabel = 'forRawToDigi', + siPixelQualityLabel_RawToDigi = 'forRawToDigi', )