Skip to content

Fix duplicate volumes when reading a .db back in

Riccardo Maria Bianchi requested to merge fix-duplicate-volumes into master

When restoring the GeoModel tree from a .db file, a larger number of PhysVols than expected were found.

The problem turned out to be in GeoModelRead, in the caching of the volumes that were built.

The copyNumber was used to create a cache key, together with tableID and volumeID.

But the string tableID-volID-copyN was identifying each volume uniquely... so, when restoring the GeoModel tree from a file, all volumes that should be built as "shared" were created, instead, as unique instances.

I fixed that by removing the copyNumber from the key used for the cache. In that way, all volumes with the same tableID and volID, but with different copyNumber, share the same Volume instance.

Merge request reports