From 64f9566ec7d93bea839c0feeefbc78c576646f52 Mon Sep 17 00:00:00 2001 From: Andre Sailer Date: Wed, 4 Dec 2024 15:22:52 +0100 Subject: [PATCH 1/3] Geant4AssemblyVolume: use the same copy ID for the Geant4 Volume as was set in DD4hep geometry construction --- DDG4/src/Geant4AssemblyVolume.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DDG4/src/Geant4AssemblyVolume.cpp b/DDG4/src/Geant4AssemblyVolume.cpp index 331c6aeb0..91bb1883e 100644 --- a/DDG4/src/Geant4AssemblyVolume.cpp +++ b/DDG4/src/Geant4AssemblyVolume.cpp @@ -141,7 +141,7 @@ void Geant4AssemblyVolume::imprint(const Geant4Converter& cnv, triplet.GetVolume(), pMotherLV, false, - numberOfDaughters + i, + node->GetNumber(), surfCheck ); info.g4VolumeImprints[vol].emplace_back(new_chain,pvPlaced.first); From cbf3aa6b747d2c9070f055ebdc57621125e888ac Mon Sep 17 00:00:00 2001 From: Andre Sailer Date: Wed, 4 Dec 2024 15:41:54 +0100 Subject: [PATCH 2/3] Geant4AssemblyVolume: remove no longer used numberOfDaughters --- DDG4/src/Geant4AssemblyVolume.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/DDG4/src/Geant4AssemblyVolume.cpp b/DDG4/src/Geant4AssemblyVolume.cpp index 91bb1883e..fe60c5d40 100644 --- a/DDG4/src/Geant4AssemblyVolume.cpp +++ b/DDG4/src/Geant4AssemblyVolume.cpp @@ -82,10 +82,7 @@ void Geant4AssemblyVolume::imprint(const Geant4Converter& cnv, TGeoVolume* vol = parent->GetVolume(); G4AssemblyVolume* par_ass = pParentAssembly->m_assembly; Geant4GeometryInfo& info = cnv.data(); - unsigned int numberOfDaughters = (copyNumBase == 0) ? pMotherLV->GetNoDaughters() : copyNumBase; - // We start from the first available index - numberOfDaughters++; _Wrap::imprintsCountPlus(par_ass); path = detail::tools::placementPath(chain); From 4447c02c8a05c98f23f5861e730aeb4e7929766a Mon Sep 17 00:00:00 2001 From: Andre Sailer Date: Wed, 4 Dec 2024 15:46:55 +0100 Subject: [PATCH 3/3] Geant4AssemblyVolume::imprint: remove no longer used copyBase argument --- DDG4/include/DDG4/Geant4AssemblyVolume.h | 1 - DDG4/src/Geant4AssemblyVolume.cpp | 3 +-- DDG4/src/Geant4Converter.cpp | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/DDG4/include/DDG4/Geant4AssemblyVolume.h b/DDG4/include/DDG4/Geant4AssemblyVolume.h index da18d7f33..8960b095a 100644 --- a/DDG4/include/DDG4/Geant4AssemblyVolume.h +++ b/DDG4/include/DDG4/Geant4AssemblyVolume.h @@ -71,7 +71,6 @@ namespace dd4hep { Geant4AssemblyVolume* pAssembly, G4LogicalVolume* pMotherLV, G4Transform3D& transformation, - G4int copyNumBase, G4bool surfCheck ); }; } diff --git a/DDG4/src/Geant4AssemblyVolume.cpp b/DDG4/src/Geant4AssemblyVolume.cpp index fe60c5d40..4055636e7 100644 --- a/DDG4/src/Geant4AssemblyVolume.cpp +++ b/DDG4/src/Geant4AssemblyVolume.cpp @@ -71,7 +71,6 @@ void Geant4AssemblyVolume::imprint(const Geant4Converter& cnv, Geant4AssemblyVolume* pParentAssembly, G4LogicalVolume* pMotherLV, G4Transform3D& transformation, - G4int copyNumBase, G4bool surfCheck) { struct _Wrap : public G4AssemblyVolume { @@ -156,7 +155,7 @@ void Geant4AssemblyVolume::imprint(const Geant4Converter& cnv, } else if ( triplet.GetAssembly() ) { // Place volumes in this assembly with composed transformation - imprint(cnv, parent, std::move(new_chain), avol, pMotherLV, Tfinal, i*100+copyNumBase, surfCheck ); + imprint(cnv, parent, std::move(new_chain), avol, pMotherLV, Tfinal, surfCheck ); } else { G4Exception("Geant4AssemblyVolume::imprint(..)", "GeomVol0003", FatalException, diff --git a/DDG4/src/Geant4Converter.cpp b/DDG4/src/Geant4Converter.cpp index 57531caf7..fd4686802 100644 --- a/DDG4/src/Geant4Converter.cpp +++ b/DDG4/src/Geant4Converter.cpp @@ -1000,7 +1000,7 @@ void* Geant4Converter::handlePlacement(const std::string& name, const TGeoNode* Geant4AssemblyVolume* ass = (Geant4AssemblyVolume*)info.g4AssemblyVolumes[node]; Geant4AssemblyVolume::Chain chain; chain.emplace_back(node); - ass->imprint(*this, node, chain, ass, (*volIt).second, transform, copy, checkOverlaps); + ass->imprint(*this, node, chain, ass, (*volIt).second, transform, checkOverlaps); return nullptr; } else if ( node != info.manager->GetTopNode() && volIt == info.g4Volumes.end() ) {