Problem 64 - G4SmartVoxelHeader not smart enough
Summary: G4SmartVoxelHeader not smart enough
Status: RESOLVED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: geometry/management (show other problems)
Version: other
Hardware: All All
: P2 normal
Assignee: Gabriele Cosmo
URL:
Depends on:
Blocks:
 
Reported: 2000-03-08 06:49 CET by John.Allison
Modified: 2002-10-16 10:37 CEST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description John.Allison 2000-03-08 06:49:56 CET
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);
      }
}
Comment 1 John Apostolakis 2000-03-14 09:01:59 CET
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.
Comment 2 John Apostolakis 2000-03-14 09:01:59 CET
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.
Comment 3 Gabriele Cosmo 2002-10-16 10:37:59 CEST
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 !