Skip to content

Commit

Permalink
Avoid potential use of dangling temporary objects. (#418)
Browse files Browse the repository at this point in the history
scott-snyder authored Jan 22, 2025
1 parent d7fec08 commit c57742c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions detectorCommon/src/DetUtils_k4geo.cpp
Original file line number Diff line number Diff line change
@@ -452,7 +452,7 @@ std::array<double, 2> 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<double, 2> tubeEtaExtremes(uint64_t aVolumeId) {
std::array<double, 2> 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;

0 comments on commit c57742c

Please sign in to comment.