Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[12_5_X] Fix in SiPixelQualityESProducer to support two labelled records #40075

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class SiPixelQualityESProducer : public edm::ESProducer, public edm::EventSetupR

std::unique_ptr<SiPixelQuality> produce(const SiPixelQualityRcd& iRecord);
std::unique_ptr<SiPixelQuality> produceWithLabel(const SiPixelQualityRcd& iRecord);
std::unique_ptr<SiPixelQuality> produceWithLabelRawToDigi(const SiPixelQualityRcd& iRecord);

private:
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey&,
Expand All @@ -66,6 +67,7 @@ class SiPixelQualityESProducer : public edm::ESProducer, public edm::EventSetupR

const Tokens defaultTokens_;
Tokens labelTokens_;
Tokens labelTokens_RawToDigi_;
};

//
Expand All @@ -79,10 +81,19 @@ SiPixelQualityESProducer::SiPixelQualityESProducer(const edm::ParameterSet& conf
auto label =
conf_.exists("siPixelQualityLabel") ? conf_.getParameter<std::string>("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<std::string>("siPixelQualityLabel_RawToDigi")
: std::string{};

if (label == "forRawToDigi") {
labelTokens_RawToDigi_ = Tokens(
setWhatProduced(this, &SiPixelQualityESProducer::produceWithLabelRawToDigi, edm::es::Label(label)), label);
}
findingRecord<SiPixelQualityRcd>();
}

Expand Down Expand Up @@ -119,6 +130,9 @@ std::unique_ptr<SiPixelQuality> SiPixelQualityESProducer::produce(const SiPixelQ
std::unique_ptr<SiPixelQuality> SiPixelQualityESProducer::produceWithLabel(const SiPixelQualityRcd& iRecord) {
return get_pointer(iRecord, labelTokens_);
}
std::unique_ptr<SiPixelQuality> SiPixelQualityESProducer::produceWithLabelRawToDigi(const SiPixelQualityRcd& iRecord) {
return get_pointer(iRecord, labelTokens_RawToDigi_);
}

void SiPixelQualityESProducer::setIntervalFor(const edm::eventsetup::EventSetupRecordKey&,
const edm::IOVSyncValue& iosv,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
)