Re: Evenly distributed source

From: Alberto Fasso' <fasso_at_SLAC.Stanford.EDU>
Date: Fri, 30 Jan 2009 08:38:53 -0800 (PST)

Hi Sebastien,

Be careful, MYRHO begins with an M, it will be interpreted as
an integer. Call it RHOMY.

But I don't think that it is correct to sample a radius between 0 and RADIUS,
as you do. There are many more points at large radii than at small ones,
and your sampling fails to account for this.
You should sample the points in a square of edge 2.D0*RADIUS, and reject if
a point falls outside the circle:
  123 CONTINUE
       XXX = -RADIUS + FLRNDM(XDUMMY) * (TWOTWO*RADIUS)
       YYY = -RADIUS + FLRNDM(YDUMMY) * (TWOTWO*RADIUS)
       IF((XXX**2+YYY**2) .GT. RADIUS**2) GO TO 123
       ................................................
       XFLK (NPFLKA) = XXX
       YFLK (NPFLKA) = YYY

Alberto

On Fri, 30 Jan 2009, Sebastien WURTH wrote:

> Hello,
>
> You have to use the source.f routine.
> You have to describe a circle distribution for (x,y) coordinates and a line
> distribution for z (for example).
> You can do something like that (example for a 500 ml source, normalized SG500
> container) :
> CALL SFECFE(SINT,COST)
> RADIUS = 4.699999D0
> ZMIN = -7.2249999D0
> ZMAX = -0.0250001D0
> RANDY = FLRNDM(XDUMMY)
> MYRHO = RADIUS * SQRT(RANDY)
> XBEAM = MYRHO * COST
> YBEAM = MYRHO * SINT
> ZBEAM = ZMIN - ((ZMIN - ZMAX)*FLRNDM(ZDUMMY))
> XFLK (NPFLKA) = XBEAM
> YFLK (NPFLKA) = YBEAM
> ZFLK (NPFLKA) = ZBEAM
>
> Hope it helps,
> Regards.
> Sebastien.
>
>
> Lior Cahana wrote :
>
>> Good Morning,
>> I would like to simulate a photon source that is evenly distributed insid=
>> e a cylinder.
>> The manual was not clear on how to do that, how can I simulate this distr=
>> ibution?
>> Thank you
>>
>> Lior Cahana
>>
>>
>
Received on Sat Jan 31 2009 - 18:07:57 CET

This archive was generated by hypermail 2.2.0 : Sat Jan 31 2009 - 18:07:58 CET