Skip to content

Commit

Permalink
Merge pull request #45765 from iarspider/iarspider-patch-20240821-2
Browse files Browse the repository at this point in the history
Apply suggested fix for Wdangling-reference
  • Loading branch information
cmsbuild authored Aug 22, 2024
2 parents 359454c + a8d271a commit dfc9a3c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
3 changes: 1 addition & 2 deletions CalibTracker/SiStripCommon/plugins/TkDetMapESProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,7 @@ namespace {
} // namespace

std::unique_ptr<TkDetMap> TkDetMapESProducer::produce(const TrackerTopologyRcd& tTopoRcd) {
const auto& geomDetRcd = tTopoRcd.getRecord<IdealGeometryRecord>();
const auto& geomDet = geomDetRcd.get(geomDetToken_);
const auto& geomDet = tTopoRcd.get(geomDetToken_);
const auto TkDetIdList = TrackerGeometryUtils::getSiStripDetIds(geomDet);

const auto& tTopo = tTopoRcd.get(tTopoToken_);
Expand Down
18 changes: 6 additions & 12 deletions RecoLocalCalo/HcalRecAlgos/plugins/HcalChannelPropertiesEP.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,8 @@ class HcalChannelPropertiesEP : public edm::ESProducer {
inline ~HcalChannelPropertiesEP() override {}

ReturnType1 produce1(const HcalChannelPropertiesAuxRecord& rcd) {
const auto& htopoRecord = rcd.getRecord<HcalRecNumberingRecord>();
const HcalTopology& htopo = htopoRecord.get(topoToken_);
const auto& paramsRecord = rcd.getRecord<HcalRecoParamsRcd>();
const HcalRecoParams& params = paramsRecord.get(paramsToken_);
const HcalTopology& htopo = rcd.get(topoToken_);
const HcalRecoParams& params = rcd.get(paramsToken_);

ReturnType1 prod = std::make_unique<HcalRecoParams>(params);
prod->setTopo(&htopo);
Expand All @@ -74,14 +72,10 @@ class HcalChannelPropertiesEP : public edm::ESProducer {
// Retrieve various event setup records and data products
const HcalDbRecord& dbRecord = rcd.getRecord<HcalDbRecord>();
const HcalDbService& cond = dbRecord.get(condToken_);
const auto& paramsRecord = rcd.getRecord<HcalChannelPropertiesAuxRecord>();
const HcalRecoParams& params = paramsRecord.get(myParamsToken_);
const auto& severityRecord = rcd.getRecord<HcalSeverityLevelComputerRcd>();
const HcalSeverityLevelComputer& severity = severityRecord.get(sevToken_);
const auto& qualRecord = dbRecord.getRecord<HcalChannelQualityRcd>();
const HcalChannelQuality& qual = qualRecord.get(qualToken_);
const auto& geomRecord = rcd.getRecord<CaloGeometryRecord>();
const CaloGeometry& geom = geomRecord.get(geomToken_);
const HcalRecoParams& params = rcd.get(myParamsToken_);
const HcalSeverityLevelComputer& severity = rcd.get(sevToken_);
const HcalChannelQuality& qual = dbRecord.get(qualToken_);
const CaloGeometry& geom = rcd.get(geomToken_);

// HcalTopology is taken from "params" created by the "produce1" method
const HcalTopology& htopo(*params.topo());
Expand Down

0 comments on commit dfc9a3c

Please sign in to comment.