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

Question How to score surface current for a ellipsoid shell 

Forum: Hits, Digitization and Pileup
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 OutterXsemi=outterYsemi=7cm,outterZsemi= 10.5cm.

I have a gun source outside this geometry and I want to record how many photons will be hit 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. 

Very 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 shell   (Tsukasa Aso - 25 Jan, 2011)
1 None: Re: How to score surface current for a ellipsoid shell   (Linxi Shi - 26 Jan, 2011)
2 None: Re: How to score surface current for a ellipsoid shell   (Tsukasa Aso - 28 Jan, 2011)
 Add Message Add Message
to: "How to score surface current for a ellipsoid shell"

 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 ]