From c57742cefdeb71f171bbbef2de4eb01158b7621b Mon Sep 17 00:00:00 2001 From: scott-snyder Date: Wed, 22 Jan 2025 16:54:53 +0000 Subject: [PATCH] Avoid potential use of dangling temporary objects. (#418) --- detectorCommon/src/DetUtils_k4geo.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/detectorCommon/src/DetUtils_k4geo.cpp b/detectorCommon/src/DetUtils_k4geo.cpp index 711118248..624a530f5 100644 --- a/detectorCommon/src/DetUtils_k4geo.cpp +++ b/detectorCommon/src/DetUtils_k4geo.cpp @@ -452,7 +452,7 @@ std::array tubeEtaExtremes(uint64_t aVolumeId) { // check if it is a cylinder centred at z=0 dd4hep::VolumeManager volMgr = dd4hep::Detector::getInstance().volumeManager(); auto detelement = volMgr.lookupDetElement(aVolumeId); - const auto& transformMatrix = detelement.nominal().worldTransformation(); + const auto transformMatrix = detelement.nominal().worldTransformation(); double outGlobal[3]; double inLocal[] = {0, 0, 0}; // to get middle of the volume transformMatrix.LocalToMaster(inLocal, outGlobal); @@ -477,7 +477,7 @@ std::array tubeEtaExtremes(uint64_t aVolumeId) { std::array envelopeEtaExtremes (uint64_t aVolumeId) { dd4hep::VolumeManager volMgr = dd4hep::Detector::getInstance().volumeManager(); auto detelement = volMgr.lookupDetElement(aVolumeId); - const auto& transformMatrix = detelement.nominal().worldTransformation(); + const auto transformMatrix = detelement.nominal().worldTransformation(); // calculate values of eta in all possible corners of the envelope auto dim = envelopeDimensions(aVolumeId); double minEta = 0;