The message obtained if a user attaches more than one replica to a logical volume is misleading: G4SmartVoxelHeader::BuildNodes - PANIC! Daughter physical volume name = grand_daughter_box_phys is entirely outside mother logical volume name = sub_divided_tube_L *** G4Exception: Aborting execution *** This is because it is not properly trapped in G4SmartVoxelHeader constructor: G4SmartVoxelHeader::G4SmartVoxelHeader(G4LogicalVolume* pVolume, const G4int pSlice) : fminEquivalent(pSlice), fmaxEquivalent(pSlice) { G4int nDaughters; G4VoxelLimits limits; // Create `unlimited' limits object nDaughters=pVolume->GetNoDaughters(); // Determine whether daughter is replicated if (nDaughters!=1||!pVolume->GetDaughter(0)->IsReplicated()) { // Daughter not replicated => conventional voxel Build // where each daughters extents are computed BuildVoxels(pVolume); } else { // Single replicated daughter BuildReplicaVoxels(pVolume); } } should have an extra clause, e.g.: G4SmartVoxelHeader::G4SmartVoxelHeader(G4LogicalVolume* pVolume, const G4int pSlice) : fminEquivalent(pSlice), fmaxEquivalent(pSlice) { G4int nDaughters; G4VoxelLimits limits; // Create `unlimited' limits object nDaughters=pVolume->GetNoDaughters(); // Determine whether daughter is replicated for (G4int i=0; i<nDaughters; i++) { if (pVolume->GetDaughter(i)->IsReplicated()) break; } if (i==nDaughters) { // Daughters are not replicated => conventional voxel Build // where each daughters extents are computed BuildVoxels(pVolume); } else if (nDaughters==1) { // Single replicated daughter BuildReplicaVoxels(pVolume); } else { G4String message ("G4SmartVoxelHeader::G4SmartVoxelHeader: "); message += pVolume->GetName(); message += " has more than one\n daughter of which at least one, "; message += pVolume->GetDaughter(i)->GetName(); message += ",\n is a G4PVReplica - illegal."; G4Exception (message); } }
Our rules for the creation of a geometry do not accept attaching more than one replica to a logical volume. It is also incorrect to mix placements and either a replica or a parameterised volume. It should be the responcibility of G4Replica (its constructor?) to issue an error message about this. We should move to offer this protection. I believe that SmartVoxelHeader operates acceptably in this respect.
Feature of checking placements of replicas in a mother volume is added in tag "geommng-V04-01-01". To be noticed : this bug report went unnoticed for a long time since hidden by the bugzilla system under 'Geant4-dev' product, which by default was not displayed by the system !