Message: How to score surface current for a ellipsoid Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None How to score surface current for a ellipsoid  

Forum: Biasing and Scoring
Date: 25 Jan, 2011
From: Linxi Shi <Linxi Shi>

Hi,

I want to score the surface current for a ellipsoid shell with innerxsemi=innerysemi=6.6cm, innerzsemi= 10.1cm and outtersemi=outterysemi=7cm,outtersemi= 10.5cm.

I have a gun source outside this geometry and I want to record how many photons will be hitten on the outter surface of the ellipsoid shell.

I can simply do this for sphere by using "G4PSSphereSurfaceCurrent" scorer, selecting direction as 'fCurrent_Out'. I was trying to modify "IsSelectedSurface()" function of "G4PSSphereSurfaceCurrent.cc" by changing the the sphere related parameter to elliptical parameter:

Original Sphere code:
    G4double kCarTolerance = G4GeometryTolerance::GetInstance()->GetSurfaceTolerance();
    G4double localR2 = localpos2.x()*localpos2.x()
                      +localpos2.y()*localpos2.y()
                      +localpos2.z()*localpos2.z();
    G4double InsideRadius = sphereSolid->GetInsideRadius();
    if ( localR2 > (InsideRadius-kCarTolerance)*(InsideRadius-kCarTolerance)
	 &&localR2 < (InsideRadius+kCarTolerance)*(InsideRadius+kCarTolerance)){
      return fCurrent_Out;

And since sllipsoid funtion is (x/xsemi)^2+(y/xysemi)^2+(z/zsemi)^2=1,
What I changed is: 
     G4double localR2 = localpos2.x()*localpos2.x()/(6.6*6.6)
                       +localpos2.y()*localpos2.y()/(6.6*6.6)
                       +localpos2.z()*localpos2.z()/(10.1*10.1);
     G4double InsideRadius = 1.0;//sphereSolid->GetInsideRadius();
     G4double kCarTolerance = 1E-8;
    if ( localR2 > (InsideRadius-kCarTolerance)*(InsideRadius-kCarTolerance)
	 &&localR2 < (InsideRadius+kCarTolerance)*(InsideRadius+kCarTolerance)){
      Passed = TRUE; 
    }
  }

But it recorded nothing,I'm also confuse with how to track G4GeometryTolerance in ellipsoid shape.

I'll be appreciated if anyone can give me some advices on this

Thanks, Linxi

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

1 None: Re: How to score surface current for a ellipsoid   (Tsukasa Aso - 28 Jan, 2011)
 Add Message Add Message
to: "How to score surface current for a ellipsoid "

 Subscribe Subscribe

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