From ded9bf6d841166db1177ed4fe753306babc8787c Mon Sep 17 00:00:00 2001 From: Johannes Junggeburth <johannes.josef.junggeburth@cern.ch> Date: Fri, 24 Jan 2025 15:45:13 +0100 Subject: [PATCH] GeoDeDuplicator - Fix clone method --- GeoModelCore/GeoModelHelpers/src/GeoDeDuplicator.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/GeoModelCore/GeoModelHelpers/src/GeoDeDuplicator.cxx b/GeoModelCore/GeoModelHelpers/src/GeoDeDuplicator.cxx index e4b88500..0e0aba4c 100644 --- a/GeoModelCore/GeoModelHelpers/src/GeoDeDuplicator.cxx +++ b/GeoModelCore/GeoModelHelpers/src/GeoDeDuplicator.cxx @@ -111,18 +111,18 @@ GeoDeDuplicator::GeoIdPtr return newId; } -PVLink GeoDeDuplicator::clone(PVConstLink vol) const { +PVLink GeoDeDuplicator::clone(PVConstLink cloneMe) const { PVLink newVol{}; bool tryPhysVolDeDup{m_deDuplicatePhysVol}; - GeoLogVolPtr logVol{const_cast<GeoLogVol*>(vol->getLogVol())}; - if (dynamic_cast<const GeoPhysVol*>(vol.get())) { + GeoLogVolPtr logVol{const_cast<GeoLogVol*>(cloneMe->getLogVol())}; + if (dynamic_cast<const GeoPhysVol*>(cloneMe.get())) { newVol = make_intrusive<GeoPhysVol>(cacheVolume(logVol)); } else { newVol = make_intrusive<GeoFullPhysVol>(cacheVolume(logVol)); tryPhysVolDeDup = false; } - for(unsigned int chNode =0; chNode < newVol->getNChildNodes(); ++chNode) { - GeoIntrusivePtr<const GeoGraphNode>node{*newVol->getChildNode(chNode)}; + for(unsigned int chNode =0; chNode < cloneMe->getNChildNodes(); ++chNode) { + GeoIntrusivePtr<const GeoGraphNode>node{*cloneMe->getChildNode(chNode)}; /** transform nodes */ if (typeid(*node) == typeid(GeoAlignableTransform)) { const auto geoTrf = dynamic_pointer_cast<const GeoAlignableTransform>(node); @@ -149,7 +149,7 @@ PVLink GeoDeDuplicator::clone(PVConstLink vol) const { newVol->add(const_pointer_cast(node)); } } - if (tryPhysVolDeDup){ + if (tryPhysVolDeDup) { newVol = cacheVolume(dynamic_pointer_cast<GeoPhysVol>(newVol)); } return newVol; -- GitLab