Skip to content

Commit dfc9a3c

Browse files
authored
Merge pull request #45765 from iarspider/iarspider-patch-20240821-2
Apply suggested fix for Wdangling-reference
2 parents 359454c + a8d271a commit dfc9a3c

File tree

2 files changed

+7
-14
lines changed

2 files changed

+7
-14
lines changed

CalibTracker/SiStripCommon/plugins/TkDetMapESProducer.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,7 @@ namespace {
294294
} // namespace
295295

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

301300
const auto& tTopo = tTopoRcd.get(tTopoToken_);

RecoLocalCalo/HcalRecAlgos/plugins/HcalChannelPropertiesEP.cc

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,8 @@ class HcalChannelPropertiesEP : public edm::ESProducer {
5353
inline ~HcalChannelPropertiesEP() override {}
5454

5555
ReturnType1 produce1(const HcalChannelPropertiesAuxRecord& rcd) {
56-
const auto& htopoRecord = rcd.getRecord<HcalRecNumberingRecord>();
57-
const HcalTopology& htopo = htopoRecord.get(topoToken_);
58-
const auto& paramsRecord = rcd.getRecord<HcalRecoParamsRcd>();
59-
const HcalRecoParams& params = paramsRecord.get(paramsToken_);
56+
const HcalTopology& htopo = rcd.get(topoToken_);
57+
const HcalRecoParams& params = rcd.get(paramsToken_);
6058

6159
ReturnType1 prod = std::make_unique<HcalRecoParams>(params);
6260
prod->setTopo(&htopo);
@@ -74,14 +72,10 @@ class HcalChannelPropertiesEP : public edm::ESProducer {
7472
// Retrieve various event setup records and data products
7573
const HcalDbRecord& dbRecord = rcd.getRecord<HcalDbRecord>();
7674
const HcalDbService& cond = dbRecord.get(condToken_);
77-
const auto& paramsRecord = rcd.getRecord<HcalChannelPropertiesAuxRecord>();
78-
const HcalRecoParams& params = paramsRecord.get(myParamsToken_);
79-
const auto& severityRecord = rcd.getRecord<HcalSeverityLevelComputerRcd>();
80-
const HcalSeverityLevelComputer& severity = severityRecord.get(sevToken_);
81-
const auto& qualRecord = dbRecord.getRecord<HcalChannelQualityRcd>();
82-
const HcalChannelQuality& qual = qualRecord.get(qualToken_);
83-
const auto& geomRecord = rcd.getRecord<CaloGeometryRecord>();
84-
const CaloGeometry& geom = geomRecord.get(geomToken_);
75+
const HcalRecoParams& params = rcd.get(myParamsToken_);
76+
const HcalSeverityLevelComputer& severity = rcd.get(sevToken_);
77+
const HcalChannelQuality& qual = dbRecord.get(qualToken_);
78+
const CaloGeometry& geom = rcd.get(geomToken_);
8579

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

0 commit comments

Comments
 (0)