From 1370641a22fe472d2536c3f949d731b2ccdde22b Mon Sep 17 00:00:00 2001 From: Ivan Razumov Date: Wed, 21 Aug 2024 13:32:43 +0200 Subject: [PATCH] [GCC13] Redo fix for Wdangling-reference following suggestion --- .../CaloTPG/plugins/CaloTPGTranscoderULUTs.cc | 3 +-- .../HcalTPGEventSetup/src/HcalTPGCoderULUT.cc | 3 +-- ...ase2OuterTrackerFakeLorentzAngleESSource.cc | 4 ++-- .../plugins/TkDetMapESProducer.cc | 3 +-- .../SiStripBackPlaneCorrectionFakeESSource.cc | 3 +-- .../fake/SiStripHashedDetIdFakeESSource.cc | 3 +-- .../fake/SiStripLorentzAngleFakeESSource.cc | 3 +-- .../plugins/HcalChannelPropertiesEP.cc | 18 ++++++------------ 8 files changed, 14 insertions(+), 26 deletions(-) diff --git a/CalibCalorimetry/CaloTPG/plugins/CaloTPGTranscoderULUTs.cc b/CalibCalorimetry/CaloTPG/plugins/CaloTPGTranscoderULUTs.cc index 72ce528c1563a..8f440bc60ebe0 100644 --- a/CalibCalorimetry/CaloTPG/plugins/CaloTPGTranscoderULUTs.cc +++ b/CalibCalorimetry/CaloTPG/plugins/CaloTPGTranscoderULUTs.cc @@ -155,8 +155,7 @@ CaloTPGTranscoderULUTs::ReturnType CaloTPGTranscoderULUTs::produce(const CaloTPG const auto& lutMetadata = iRecord.get(lutMetadataToken); const auto& theTrigTowerGeometry = iRecord.get(theTrigTowerGeometryToken); - const auto& topoRecord = iRecord.getRecord(); - const auto& topo = topoRecord.get(topoToken); + const auto& topo = iRecord.get(topoToken); HcalLutMetadata fullLut{lutMetadata}; fullLut.setTopo(&topo); diff --git a/CalibCalorimetry/HcalTPGEventSetup/src/HcalTPGCoderULUT.cc b/CalibCalorimetry/HcalTPGEventSetup/src/HcalTPGCoderULUT.cc index 775a10cb76255..fcbe695f4e6a6 100644 --- a/CalibCalorimetry/HcalTPGEventSetup/src/HcalTPGCoderULUT.cc +++ b/CalibCalorimetry/HcalTPGEventSetup/src/HcalTPGCoderULUT.cc @@ -160,8 +160,7 @@ HcalTPGCoderULUT::ReturnType HcalTPGCoderULUT::produce(const HcalTPGRecord& iRec auto host = holder_.makeOrGet([]() { return new HostType; }); const auto& topo = iRecord.get(topoToken_); - const auto& delayRcd = iRecord.getRecord(); - const auto& delay = delayRcd.get(delayToken_); + const auto& delay = iRecord.get(delayToken_); if (read_Ascii_ || read_XML_) { buildCoder(&topo, &delay, host.get()); } else { diff --git a/CalibTracker/SiPhase2TrackerESProducers/plugins/SiPhase2OuterTrackerFakeLorentzAngleESSource.cc b/CalibTracker/SiPhase2TrackerESProducers/plugins/SiPhase2OuterTrackerFakeLorentzAngleESSource.cc index 88ca7611fa571..d8ebabd51b20e 100644 --- a/CalibTracker/SiPhase2TrackerESProducers/plugins/SiPhase2OuterTrackerFakeLorentzAngleESSource.cc +++ b/CalibTracker/SiPhase2TrackerESProducers/plugins/SiPhase2OuterTrackerFakeLorentzAngleESSource.cc @@ -69,13 +69,13 @@ namespace fakeOTLA { std::unique_ptr SiPhase2OuterTrackerFakeLorentzAngleESSource::produceOTLA( const SiPhase2OuterTrackerLorentzAngleRcd& rcd) { - const auto& geomDet = rcd.getRecord().get(m_geomDetToken); + const auto& geomDet = rcd.get(m_geomDetToken); return fakeOTLA::produceRecord(LAvalue_, geomDet); } std::unique_ptr SiPhase2OuterTrackerFakeLorentzAngleESSource::produceOTSimLA( const SiPhase2OuterTrackerLorentzAngleSimRcd& rcd) { - const auto& geomDet = rcd.getRecord().get(m_geomDetToken); + const auto& geomDet = rcd.get(m_geomDetToken); return fakeOTLA::produceRecord(LAvalue_, geomDet); } diff --git a/CalibTracker/SiStripCommon/plugins/TkDetMapESProducer.cc b/CalibTracker/SiStripCommon/plugins/TkDetMapESProducer.cc index f634d29508a81..69adaab6cab95 100644 --- a/CalibTracker/SiStripCommon/plugins/TkDetMapESProducer.cc +++ b/CalibTracker/SiStripCommon/plugins/TkDetMapESProducer.cc @@ -294,8 +294,7 @@ namespace { } // namespace std::unique_ptr TkDetMapESProducer::produce(const TrackerTopologyRcd& tTopoRcd) { - const auto& geomDetRcd = tTopoRcd.getRecord(); - const auto& geomDet = geomDetRcd.get(geomDetToken_); + const auto& geomDet = tTopoRcd.get(geomDetToken_); const auto TkDetIdList = TrackerGeometryUtils::getSiStripDetIds(geomDet); const auto& tTopo = tTopoRcd.get(tTopoToken_); diff --git a/CalibTracker/SiStripESProducers/plugins/fake/SiStripBackPlaneCorrectionFakeESSource.cc b/CalibTracker/SiStripESProducers/plugins/fake/SiStripBackPlaneCorrectionFakeESSource.cc index cf089d0f24a20..4e2f1db1a9420 100644 --- a/CalibTracker/SiStripESProducers/plugins/fake/SiStripBackPlaneCorrectionFakeESSource.cc +++ b/CalibTracker/SiStripESProducers/plugins/fake/SiStripBackPlaneCorrectionFakeESSource.cc @@ -65,8 +65,7 @@ SiStripBackPlaneCorrectionFakeESSource::ReturnType SiStripBackPlaneCorrectionFak const SiStripBackPlaneCorrectionRcd& iRecord) { using namespace edm::es; - const auto& geomDetRcd = iRecord.getRecord(); - const auto& geomDet = geomDetRcd.get(m_geomDetToken); + const auto& geomDet = iRecord.get(m_geomDetToken); const auto& tTopo = iRecord.get(m_tTopoToken); auto backPlaneCorrection = std::make_unique(); diff --git a/CalibTracker/SiStripESProducers/plugins/fake/SiStripHashedDetIdFakeESSource.cc b/CalibTracker/SiStripESProducers/plugins/fake/SiStripHashedDetIdFakeESSource.cc index 39793a014c857..f66b4bfd2f91a 100644 --- a/CalibTracker/SiStripESProducers/plugins/fake/SiStripHashedDetIdFakeESSource.cc +++ b/CalibTracker/SiStripESProducers/plugins/fake/SiStripHashedDetIdFakeESSource.cc @@ -31,8 +31,7 @@ std::unique_ptr SiStripHashedDetIdFakeESSource::produce(cons edm::LogVerbatim("HashedDetId") << "[SiStripHashedDetIdFakeESSource::" << __func__ << "]" << " Building \"fake\" hashed DetId map from IdealGeometry"; - const auto& geomDetRcd = record.getRecord(); - const auto& geomDet = geomDetRcd.get(geomDetToken_); + const auto& geomDet = record.get(geomDetToken_); const std::vector dets = TrackerGeometryUtils::getSiStripDetIds(geomDet); edm::LogVerbatim("HashedDetId") << "[SiStripHashedDetIdFakeESSource::" << __func__ << "]" diff --git a/CalibTracker/SiStripESProducers/plugins/fake/SiStripLorentzAngleFakeESSource.cc b/CalibTracker/SiStripESProducers/plugins/fake/SiStripLorentzAngleFakeESSource.cc index 5c1710758a318..eca60cd7985d6 100644 --- a/CalibTracker/SiStripESProducers/plugins/fake/SiStripLorentzAngleFakeESSource.cc +++ b/CalibTracker/SiStripESProducers/plugins/fake/SiStripLorentzAngleFakeESSource.cc @@ -183,8 +183,7 @@ SiStripLorentzAngleFakeESSource::ReturnType SiStripLorentzAngleFakeESSource::pro const SiStripLorentzAngleRcd& iRecord) { using namespace edm::es; - const auto& geomDetRcd = iRecord.getRecord(); - const auto& geomDet = geomDetRcd.get(m_geomDetToken); + const auto& geomDet = iRecord.get(m_geomDetToken); const auto& tTopo = iRecord.get(m_tTopoToken); auto lorentzAngle = std::make_unique(); diff --git a/RecoLocalCalo/HcalRecAlgos/plugins/HcalChannelPropertiesEP.cc b/RecoLocalCalo/HcalRecAlgos/plugins/HcalChannelPropertiesEP.cc index 426a8cf728443..8f61c772d4c3f 100644 --- a/RecoLocalCalo/HcalRecAlgos/plugins/HcalChannelPropertiesEP.cc +++ b/RecoLocalCalo/HcalRecAlgos/plugins/HcalChannelPropertiesEP.cc @@ -53,10 +53,8 @@ class HcalChannelPropertiesEP : public edm::ESProducer { inline ~HcalChannelPropertiesEP() override {} ReturnType1 produce1(const HcalChannelPropertiesAuxRecord& rcd) { - const auto& htopoRecord = rcd.getRecord(); - const HcalTopology& htopo = htopoRecord.get(topoToken_); - const auto& paramsRecord = rcd.getRecord(); - const HcalRecoParams& params = paramsRecord.get(paramsToken_); + const HcalTopology& htopo = rcd.get(topoToken_); + const HcalRecoParams& params = rcd.get(paramsToken_); ReturnType1 prod = std::make_unique(params); prod->setTopo(&htopo); @@ -74,14 +72,10 @@ class HcalChannelPropertiesEP : public edm::ESProducer { // Retrieve various event setup records and data products const HcalDbRecord& dbRecord = rcd.getRecord(); const HcalDbService& cond = dbRecord.get(condToken_); - const auto& paramsRecord = rcd.getRecord(); - const HcalRecoParams& params = paramsRecord.get(myParamsToken_); - const auto& severityRecord = rcd.getRecord(); - const HcalSeverityLevelComputer& severity = severityRecord.get(sevToken_); - const auto& qualRecord = dbRecord.getRecord(); - const HcalChannelQuality& qual = qualRecord.get(qualToken_); - const auto& geomRecord = rcd.getRecord(); - const CaloGeometry& geom = geomRecord.get(geomToken_); + const HcalRecoParams& params = rcd.get(myParamsToken_); + const HcalSeverityLevelComputer& severity = rcd.get(sevToken_); + const HcalChannelQuality& qual = rcd.get(qualToken_); + const CaloGeometry& geom = rcd.get(geomToken_); // HcalTopology is taken from "params" created by the "produce1" method const HcalTopology& htopo(*params.topo());