Skip to content

Commit

Permalink
[GCC13] Redo fix for Wdangling-reference following suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
iarspider committed Aug 21, 2024
1 parent d34e3af commit 1370641
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 26 deletions.
3 changes: 1 addition & 2 deletions CalibCalorimetry/CaloTPG/plugins/CaloTPGTranscoderULUTs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<HcalLutMetadataRcd>();
const auto& topo = topoRecord.get(topoToken);
const auto& topo = iRecord.get(topoToken);

HcalLutMetadata fullLut{lutMetadata};
fullLut.setTopo(&topo);
Expand Down
3 changes: 1 addition & 2 deletions CalibCalorimetry/HcalTPGEventSetup/src/HcalTPGCoderULUT.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<HcalDbRecord>();
const auto& delay = delayRcd.get(delayToken_);
const auto& delay = iRecord.get(delayToken_);
if (read_Ascii_ || read_XML_) {
buildCoder(&topo, &delay, host.get());
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ namespace fakeOTLA {

std::unique_ptr<SiPhase2OuterTrackerLorentzAngle> SiPhase2OuterTrackerFakeLorentzAngleESSource::produceOTLA(
const SiPhase2OuterTrackerLorentzAngleRcd& rcd) {
const auto& geomDet = rcd.getRecord<TrackerTopologyRcd>().get(m_geomDetToken);
const auto& geomDet = rcd.get(m_geomDetToken);
return fakeOTLA::produceRecord<SiPhase2OuterTrackerLorentzAngle>(LAvalue_, geomDet);
}

std::unique_ptr<SiPhase2OuterTrackerLorentzAngle> SiPhase2OuterTrackerFakeLorentzAngleESSource::produceOTSimLA(
const SiPhase2OuterTrackerLorentzAngleSimRcd& rcd) {
const auto& geomDet = rcd.getRecord<TrackerTopologyRcd>().get(m_geomDetToken);
const auto& geomDet = rcd.get(m_geomDetToken);
return fakeOTLA::produceRecord<SiPhase2OuterTrackerLorentzAngle>(LAvalue_, geomDet);
}

Expand Down
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
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ SiStripBackPlaneCorrectionFakeESSource::ReturnType SiStripBackPlaneCorrectionFak
const SiStripBackPlaneCorrectionRcd& iRecord) {
using namespace edm::es;

const auto& geomDetRcd = iRecord.getRecord<TrackerTopologyRcd>();
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<SiStripBackPlaneCorrection>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ std::unique_ptr<SiStripHashedDetId> SiStripHashedDetIdFakeESSource::produce(cons
edm::LogVerbatim("HashedDetId") << "[SiStripHashedDetIdFakeESSource::" << __func__ << "]"
<< " Building \"fake\" hashed DetId map from IdealGeometry";

const auto& geomDetRcd = record.getRecord<TrackerDigiGeometryRecord>();
const auto& geomDet = geomDetRcd.get(geomDetToken_);
const auto& geomDet = record.get(geomDetToken_);

const std::vector<uint32_t> dets = TrackerGeometryUtils::getSiStripDetIds(geomDet);
edm::LogVerbatim("HashedDetId") << "[SiStripHashedDetIdFakeESSource::" << __func__ << "]"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,7 @@ SiStripLorentzAngleFakeESSource::ReturnType SiStripLorentzAngleFakeESSource::pro
const SiStripLorentzAngleRcd& iRecord) {
using namespace edm::es;

const auto& geomDetRcd = iRecord.getRecord<TrackerTopologyRcd>();
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<SiStripLorentzAngle>();
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 = rcd.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 1370641

Please sign in to comment.