Message: Re: bug in tracking through concentric spherical layers? Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: bug in tracking through concentric spherical layers? 

Forum: Geometry
Re: Question bug in tracking through concentric spherical layers? (Scott Nutter)
Re: None Re: bug in tracking through concentric spherical layers? (Scott Nutter)
Date: 28 Jan, 2009
From: Vladimir Grichine <Vladimir Grichine>

In example you have provided the geometry is the following:
 for (G4int i = 0; i<NumShells; i++) 
 {
    sprintf(spherenum, "%s%d","sphere",i);

    G4Sphere* sphere = new G4Sphere(spherenum,ShellInnerRadius, 
           ShellOuterRadius[i], 0.*deg, 360.*deg, 0.*deg, 90.*deg );
    sprintf(spherelognum, "%s%d","spherelog",i);
    sphere_log[i]= new G4LogicalVolume(sphere,aMaterial,spherelognum,0,0,0);
    sphere_log[i]->SetUserLimits(userLimits);
    sprintf(spherephysnum, "%s%d","spherephys",i);

    if (i == 0) //set world volume
    {
      sphere_phys[0] = new G4PVPlacement(0, G4ThreeVector(0., 0., 0.),
                 sphere_log[0], spherephysnum, 0, false,0);
    } 
    else 
    {
      sphere_phys[i] = new G4PVPlacement(0, G4ThreeVector(0., 0., 0.),
                       sphere_log[i], spherephysnum,sphere_log[i-1], false, 0);
    }

  sprintf(mothername,"%d%s",0,"\t");
    if (i != 0) sprintf(mothername, "%s%d","spherelog",i-1);
    G4cout << spherephysnum << "\t" << mothername << "\t" << G4BestUnit(ShellInn
erRadius,"Length")
        << "\t" << G4BestUnit(ShellOuterRadius[i],"Length") << "\t"
        << "0.*deg  360.*deg  0.*deg  90.*deg" << G4endl;
  }

which means that all spheres touch the border of the world volume. It is not allowed in Geant4 geometry. You should put all system in a proper external volume like G4Box so that the spheres will not touch it. Another advise is to avoid, if possible, shared surfaces which reduce performance and can provide numerical errors.

 Add Message Add Message
to: "Re: bug in tracking through concentric spherical layers?"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]