# Re: Source.f problem...?

From: Marco Mauri (marco.mauri@cern.ch)
Date: Tue Mar 20 2007 - 11:47:48 CET

• Next message: Giuseppe Battistoni: "Re: Jtrack value equal to -7 and -8"

Hi Preeksingh!

In your source.f file the coordinates of the source particle are set by:

XFLK(NPFLKA) = 425.00
YFLK(NPFLKA) = 0.0
ZFLK(NPFLKA) = 150.00

This is a point-like source.
If you want to sample the coordinates of the source particle in a circle
of radius 157 cm and center in (125,0,150) I think you should use
something like this:

r = 157d0 * SQRT(FLRNDM(dummy))
alpha = TWOTWO * PIPIPI * (FLRNDM(dummy))
XFLK (NPFLKA) = 125d0 + r * COS(alpha)
YFLK (NPFLKA) = r * SIN(alpha)
ZFLK (NPFLKA) = 150d0

Moreover in your source file you read an energy value from the data file
each time source routine is called.
This force you to have a maximum number of histories equal to the lines
of the file.
I think it would be better to load all the data into an array at the
first call of the routine and then choose a random event each time a
source particle is generated.

Regards,
Marco

>Dear Markus
>want to explain my problem first, I knew a number
>of neutron for each KE. Then, I "approximated" it
>as the annular beam above my monitor and let's my
>input read the KE for each neutron from file by
>used the Source.f which I change it for made the
>annular beam at radius = 157cm and the position
>x,y,z = 125,0,150. I also attached input, source.f
>and for mgdraw.f, i just added the line at USDRAW
>
> if(icode.eq.300.and.mmtrck.eq.5)then
> write(61,*)icode,np,mmtrck,ktrack
> endif
>
>regards,
> Preeksingh...
>
>

• Next message: Giuseppe Battistoni: "Re: Jtrack value equal to -7 and -8"

This archive was generated by hypermail 2.1.6 : Tue Mar 20 2007 - 12:04:33 CET