I imported my model into GEANT4 using GDML file. My model consists about 1000 volumes except for world volume. Then I constructed a new volume by means of hard-coded programing(i.e., G4Sphere…). I want to set all the volumes in the gdml file(except world volume) as daughter volumes of this new volume. In other words, I want to change the mother volume of those cells from world volume to this new volume. Can anyone tell me how to achieve this?
I have tried
SetMotherLogical(G4LogicalVolume pMother) in G4VPhysicalVolume.hh file
AddDaughter(G4VPhysicalVolume p) in G4LogicalVolume.hh file,
but it doesn’t work.
Can anyone help me?
Thank you very much.