[fluka-discuss]: Re: Fluka, proton beam divergence

From: Luigi Salvatore Esposito <luigi.salvatore.esposito_at_cern.ch>
Date: Mon, 16 Jul 2018 22:05:35 +0000

Dear Boris,
I forward your email to the list.
Best, luigi

On Jul 16, 2018 19:41, "B.Odlozilik" <B.Odlozilik_at_seznam.cz> wrote:
Dear Mr. Salvatore,

I have found your email in the discussion thread about fluka and decided to ask for your help (i hope that it is all right and i am not going to bother you too much). I am trying to write a user routine which samples proton beam spectrum according to my specifications (this works just fine) and divergence (along z axis, for now) also given by my specification.

This is the proton spectrum part that works just fine without the divergence part:

AAA = 0.000203D+00
BBB = 0.999797D+00
COEFF = 0.1417D+00
XYZ=FLRNDM(XYZ)
RANDN = AAA + (BBB)*XYZ
EEEMEV = -(LOG(RANDN)/COEFF)
TKEFLK(NPFLKA) = -(LOG(RANDN)/COEFF)/1.0D+03

And this is the divergence part that does not compile:

FWHM = -0.2045D+00*EEEMEV+14.08D+00 (I know the divergence at FWHM for all energies)
SIGMA = FWHM/2.3548D+00 (Here i calculate sigma)
CALL FLNRRN (RGAUSS) (Gaussian angle distribution is assumed)
ANGLEA = RGAUSS*SIGMA (One spherical angle generation)
ANGLEB = 2D+00*PIPIPI*XYZ (The other angle)
XXX = SIN(ANGLEA)*COS(ANGLEB) (Carthesian coordinate for x)
YYY = SIN(ANGLEA)*SIN(ANGLEB)
ZZZ = COS(ANGLEA)
VECTNORM = SQRT (XXX**2 + YYY**2 + ZZZ**2)
TXFLK (NPFLKA) = XXX/VECTNORM (Directional cosine for axis x)
TYFLK (NPFLKA) = YYY/VECTNORM
TZFLK (NPFLKA) = SQRT ( ONEONE - TXFLK (NPFLKA)**2
& - TYFLK (NPFLKA)**2 )

I would be grateful for any insight on what i might be doing wrong. I am not an experienced Fluka user and this is my first user routine so i am sure that there are much better ways of doing what i am trying to do... The routine is enclosed if you want to have a closer look.

Thank you for your time! Have a nice day!

Boris Odložilík


__________________________________________________________________________
You can manage unsubscription from this mailing list at https://www.fluka.org/fluka.php?id=acc_info
Received on Tue Jul 17 2018 - 01:21:37 CEST

This archive was generated by hypermail 2.3.0 : Tue Jul 17 2018 - 01:21:51 CEST