Message: Problem with G4Polycone Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Problem with G4Polycone 

Forum: Geometry
Date: 15 Nov, 2012
From: Filippo Ambroglini <Filippo Ambroglini>

Dear G4 expert,

I had a problem with a G4Polycone object that I create in order to 
simulate a complex volume like an elliptical torus with an elliptical 
hole in the central part.

This is the implementation:

  std::vector<G4double> tempZ, tempInner,tempOuter;

     for(int j=0; j<9;j++){
       tempZ.push_back((2-0.1*j)*rplanet);
tempInner.push_back((2.5-sqrt(1-((1.9-0.1*j)*(1.9-0.1*j))/4)*2.5)*rplanet);
tempOuter.push_back((2.5+sqrt(1-((1.9-0.1*j)*(1.9-0.1*j))/4)*2.5)*rplanet);
     }
     for(int j=0;j<23;j++){
       tempZ.push_back((1.1-0.1*j)*rplanet);
tempInner.push_back((sqrt(1-((1.1-0.1*j)*(1.1-0.1*j))/(1.2*1.2))*1.2)*rplanet);
tempOuter.push_back((2.5+sqrt(1-((1.1-0.1*j)*(1.1-0.1*j))/4)*2.5)*rplanet);
     }
     for(int j=0; j<9;j++){
       tempZ.push_back((-1.1-0.1*j)*rplanet);
tempInner.push_back((2.5-sqrt(1-((1.1+0.1*j)*(1.1+0.1*j))/4)*2.5)*rplanet);
tempOuter.push_back((2.5+sqrt(1-((1.1+0.1*j)*(1.1+0.1*j))/4)*2.5)*rplanet);
     }
     G4double rInner[41],rOuter[41],zPlane[41];
     for(int i=0;i<41;i++){
       rInner[i]=tempInner[i];
       rOuter[i]=tempOuter[i];
       zPlane[i]=tempZ[i];
     }
     G4Polycone* VanAllenBelt = new 
G4Polycone("VanAllenBelt",0,2*pi,41,zPlane,rInner,rOuter);
     logicVanAllenBelt = new 
G4LogicalVolume(VanAllenBelt,Vacuum,"VanAllenBelt",0,0,0);

   logicVanAllenBelt->SetVisAttributes(VisAttInvisible);
   logicVanAllenBelt->SetUserLimits(theMagnetosphereUserLimits);

   G4VPhysicalVolume* physiVanAllenBelt= new 
G4PVPlacement(0,G4ThreeVector(),"VanAllenBeltPV",logicVanAllenBelt,physiMagnetosphere,false,0);

If I try to visualize it everything seams ok but when I try to use it in 
my program and I will try to transport a particle inside this volume
accessing the volume name with 
aStep->GetPreStepPoint()->GetPhysicalVolume()->GetName(); I always get 
the name of the mother volume.


If instead of G4Polycone I will use this definition

     G4Torus* outerInnerVAB = new 
G4Torus("ExternInnerVAB",0,1.25*rplanet,0.75*rplanet+ZpositionForAtmosphereBottom,0,2*pi);
     G4Orb* innerInnerVAB = new 
G4Orb("InnerInnerVAB",0.2*rplanet+ZpositionForAtmosphereBottom);
     G4SubtractionSolid* VanAllenBelt = new 
G4SubtractionSolid("VanAllenBelt",outerInnerVAB,innerInnerVAB);

everything is ok.

Someone could explain me why and where is my mistake?

Best regards,
Filippo

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 Question: Re: Problem with G4Polycone   (Filippo Ambroglini - 05 Dec, 2012)
(_ None: Re: Problem with G4Polycone   (John Apostolakis - 05 Dec, 2012)
(_ None: Re: Problem with G4Polycone   (Filippo Ambroglini - 05 Dec, 2012)
(_ None: Re: Problem with G4Polycone   (Filippo Ambroglini - 14 Jan, 2013)
(_ None: Re: Problem with G4Polycone   (John Allison - 14 Jan, 2013)
(_ None: Re: Problem with G4Polycone   (Filippo Ambroglini - 15 Jan, 2013)
(_ None: Re: Problem with G4Polycone   (John Allison - 15 Jan, 2013)
 Add Message Add Message
to: "Problem with G4Polycone"

 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 ]