Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Geant4AssemblyVolume: use the same copy ID for the Geant4 Volume as w… #1362

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion DDG4/include/DDG4/Geant4AssemblyVolume.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ namespace dd4hep {
Geant4AssemblyVolume* pAssembly,
G4LogicalVolume* pMotherLV,
G4Transform3D& transformation,
G4int copyNumBase,
G4bool surfCheck );
};
}
Expand Down
8 changes: 2 additions & 6 deletions DDG4/src/Geant4AssemblyVolume.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ void Geant4AssemblyVolume::imprint(const Geant4Converter& cnv,
Geant4AssemblyVolume* pParentAssembly,
G4LogicalVolume* pMotherLV,
G4Transform3D& transformation,
G4int copyNumBase,
G4bool surfCheck)
{
struct _Wrap : public G4AssemblyVolume {
Expand All @@ -82,10 +81,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);
Expand Down Expand Up @@ -141,7 +137,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);
Expand All @@ -159,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,
Expand Down
2 changes: 1 addition & 1 deletion DDG4/src/Geant4Converter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() ) {
Expand Down
Loading