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

None Re: Problem with G4Polycone 

Forum: Geometry
Re: None Problem with G4Polycone (Filippo Ambroglini)
Re: Question Re: Problem with G4Polycone (Filippo Ambroglini)
Date: 05 Dec, 2012
From: John Apostolakis <John Apostolakis>

Dear Filippo, 

Can you double check that your points are in ascending order - i.e.  z0 < z1 < z2 < z3 < z4 < z5 < z6 < z7 ...

r_i < R_i  ( where r is r_min and R is r_max for location 'i' )

If this is ok, can you give a well-formatted printout of the values of  < z, Rmin, Rmax > ?

Also, have you tried to test the solid that you created ?

Best regards,
John
===================================================
John Apostolakis, SFT (SoFTware) Group, PH Department, CERN
Email:  john.apostolakis@cern.ch       Office Tel:  +41-22-767-7239
------------------------------------------------------------------------------------------

On Dec 5, 2012, at 3:21 PM, Filippo Ambroglini wrote:

> 
> *** Discussion title: Geometry
> 
> Dear all,
> 
> please some one could try to help me on understand why I had the below
> mentioned problem with G4Polycone?
> 
> Best regards, Filippo On Thu, 15 Nov 2012 10:10:47 GMT, Filippo
> Ambroglini wrote:
> 
>> 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
>> 
> 
> -------------------------------------------------------------
> Visit this GEANT4 at hypernews.slac.stanford.edu message (to reply or unsubscribe) at: 
> http://hypernews.slac.stanford.edu/HyperNews/geant4/get/geometry/1242/1.html 

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

1 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: "Re: 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 ]