diff --git a/DDG4/include/DDG4/Geant4AssemblyVolume.h b/DDG4/include/DDG4/Geant4AssemblyVolume.h index 7e204068744b60d9dd165f00a1794cfd91797047..d262b0ea3fd61991b1976e6fcb537b2bad0d3051 100644 --- a/DDG4/include/DDG4/Geant4AssemblyVolume.h +++ b/DDG4/include/DDG4/Geant4AssemblyVolume.h @@ -63,21 +63,10 @@ namespace dd4hep { ~Geant4AssemblyVolume() { } - //std::vector<G4AssemblyTriplet>& triplets() { return fTriplets; } - long placeVolume(const TGeoNode* n, G4LogicalVolume* pPlacedVolume, G4Transform3D& transformation) { - size_t id = fTriplets.size(); - m_entries.push_back(n); - this->AddPlacedVolume(pPlacedVolume, transformation); - return (long)id; - } - - long placeAssembly(const TGeoNode* n, Geant4AssemblyVolume* pPlacedVolume, G4Transform3D& transformation) { - size_t id = fTriplets.size(); - m_entries.push_back(n); - this->AddPlacedAssembly(pPlacedVolume, transformation); - return (long)id; - } - + long placeVolume(const TGeoNode* n, G4LogicalVolume* pPlacedVolume, G4Transform3D& transformation); + + long placeAssembly(const TGeoNode* n, Geant4AssemblyVolume* pPlacedVolume, G4Transform3D& transformation); + void imprint(Geant4GeometryInfo& info, const TGeoNode* n, Chain chain, diff --git a/DDG4/src/Geant4AssemblyVolume.cpp b/DDG4/src/Geant4AssemblyVolume.cpp index cf3fdb9580c0182c8060f5c6b41e2d11d14e6972..a5804f4b1d9f71eb611698aa12bf5d4607a751c9 100644 --- a/DDG4/src/Geant4AssemblyVolume.cpp +++ b/DDG4/src/Geant4AssemblyVolume.cpp @@ -27,6 +27,26 @@ using namespace dd4hep::sim; +long Geant4AssemblyVolume::placeVolume(const TGeoNode* n, + G4LogicalVolume* pPlacedVolume, + G4Transform3D& transformation) +{ + size_t id = fTriplets.size(); + m_entries.emplace_back(n); + this->AddPlacedVolume(pPlacedVolume, transformation); + return (long)id; +} + +long Geant4AssemblyVolume::placeAssembly(const TGeoNode* n, + Geant4AssemblyVolume* pPlacedVolume, + G4Transform3D& transformation) +{ + size_t id = fTriplets.size(); + m_entries.emplace_back(n); + this->AddPlacedAssembly(pPlacedVolume, transformation); + return (long)id; +} + void Geant4AssemblyVolume::imprint(Geant4GeometryInfo& info, const TGeoNode* parent, Chain chain, @@ -51,8 +71,9 @@ void Geant4AssemblyVolume::imprint(Geant4GeometryInfo& info, //cout << " Assembly:" << detail::tools::placementPath(chain) << endl; for( unsigned int i = 0; i < triplets.size(); i++ ) { - const TGeoNode* node = pParentAssembly->m_entries[i]; Chain new_chain = chain; + const TGeoNode* node = pParentAssembly->m_entries[i]; + new_chain.emplace_back(node); //cout << " Assembly: Entry: " << detail::tools::placementPath(new_chain) << endl; @@ -91,9 +112,9 @@ void Geant4AssemblyVolume::imprint(Geant4GeometryInfo& info, << ':' << parent->GetNumber() << '#' - << m_entries[i]->GetName() + << node->GetName() << ':' - << m_entries[i]->GetNumber() + << node->GetNumber() << std::ends; // Generate a new physical volume instance inside a mother // (as we allow 3D transformation use G4ReflectionFactory to