The problem occurs when generating the geometry tree in geant4 by using G3toG4BuildTree(G3VolTable*,G3VolTable*) function. When there is only one copy of a logical volume G3toG4BuildTree works perfectly. But if more than one copies have to be created, G3toG4BuildTree create only the half of it: The error occurs in the loop whic is between line 65 and line 103 of the file G3toG4BuildTree.cc. . .The loop is declared as following (line 65) . for (G4int i=0; i<curVTE->NPCopies(); i++){ In this definition the curVTE->NPCopies() defined the number of logical volume copies in curVTE. At the end of the loop (line 101) we have the following statement curVTE->ClearG3PosCopy(i); By this way the curVTE->NPCopies() is decreased by 1 and the born of the loop in (line 101) is then changing dynamically which produce geant4 to only consider half of the copies of a the same logical volume. I changed the routine as following and it works: 1) I add before line 65 : g4int ilim=curVTE->NPCopies(); 2) I changed line 65 as following : for (G4int i=0; i<ilim; i++){ 3)I changed line 67 as following : G3Pos* theG3Pos = curVTE->GetG3PosCopy(0); 4)I changed line 101 as following : curVTE->ClearG3PosCopy(0); Laurent Desorgher . .
Thanks for the report. A fix for this problem already reported in bug #188, has already been put in place and will be included in future patches or minor relases.