From: Juan Blanco Sancho <juan.blanco.sancho_at_cern.ch>

Date: Mon, 24 Nov 2008 15:12:34 +0100

Date: Mon, 24 Nov 2008 15:12:34 +0100

Hi Markus,

That was exactly what I was looking for.

Cheers,

Juan.

-----Original Message-----

From: Markus Brugger=20

Sent: Monday, November 24, 2008 2:02 PM

To: Juan Blanco Sancho; fluka-discuss_at_fluka.org

Subject: RE: special beams in FLUKA

Hi Juan,

=20

sampling different values for beam divergence (e.g., xz, yz) requires

the use of an external source-routine, as the current set of cards BEAM,

BEAMPOS, BEAMAXES allows you to set the following:

- a transversal profile and a divergence (including a 2pi divergence,

i.e. an isotropic source) is available by a simple command (BEAM)

- in addition there is the option, which allows to

define a "beam reference frame" different from the normal coordinate

system

used in the problem geometry. This 'frame' is defined through the

command BEAMAXES, the user can define profile/divergence/polarization

in the frame of the beam, which is relatively easy, and the program

will do

the transformation to the normal reference frame

- it is possible to define any transversal profile,

a divergence or a polarization by means of a source routine. But it

is

the user's responsibility to code a sampling scheme for this purpose.

The values of variables such as DIVBM, XSPOT, YSPOT, UBMPOL, VBMPOL,

WBMPOL,

defined by commands BEAM and POLARIZA, are available in subroutine

SOURCE

=20

In your case you need to directly sample the angular distribution of the

particle source by using something similar to:

=20

define XDIVBM, YDIVBM + possible width (Gaussian or rectangular: XFWHM,

YFWHM) and then sample your beam direction accordingly -> the following

is NOT a full implementation and only intended as a hint, please check

carefully and add the missing parts):

=20

e.g., for a rectangular-like distribution=20

-> the problem here is to properly sample the Cosines, depending on the

angle (e.g., if also big) you have to introduce appropriate cuts!

=20

COSDIV =3D COS ( HLFHLF * XDIVBM )

THETAX =3D ACOS ( ( ONEONE - COSDIV ) * FLRNDM (COSDIV) + =

COSDIV

) ... and similar for Y

=20

or a Gaussian like situation:=20

=20

123 CONTINUE

CALL FLNRRN (DUM)

THETAX =3D XDIVBM * DUM / XFWHM

IF ( ABS (THETAX) .GT. PIPIPI ) THEN

ISGTHE =3D NINT ( SIGN ( ONEONE, THETAX ) )

THETAX =3D ABS (THETAX)

MOD2PI =3D INT ( ONEMNS * ( THETAX - PIPIPI ) / TWOPIP ) + 1

THETAX =3D ISGTHE * ( THETAX - MOD2PI * TWOPIP )

END IF

... and similar for Y

=20

and then set the cosines accordingly:

=20

* Cosines (tx,ty,tz)

TXFLK (NPFLKA) =3D ...

TYFLK (NPFLKA) =3D ...

TZFLK (NPFLKA) =3D SQRT ( ONEONE - TXFLK (NPFLKA)**2 - TYFLK =

(NPFLKA)**2

)

don't forget protecting against possibly unphysical situations

(consequence of projected angles, etc...)

=20

e.g. THETAX and THETAY have to be in the same half-plane,=20

IF ( ABS (THETAX) .GT. PIHALF .NEQV.

& ABS (THETAY) .GT. PIHALF ) GO TO 123

* (123 see above!)

=20

or angles (ANGLGB set to 'zero' according to machine accuracy ->

available in DBLPRC)

=20

IF (ABS (THETAX).LT. ANGLGB ) THEN ...

IF (ABS (THETAY).LT. ANGLGB ) THEN ...

IF ( ABS ( ABS (THETAX) - PIHALF ) .LT. ANGLGB ) THEN ...

IF ( ABS ( ABS (THETAY) - PIHALF ) .LT. ANGLGB ) THEN ...

=20

hope this helps, cheers

=20

Markus

=20

*> -----Original Message-----
*

*> From: owner-fluka-discuss_at_mi.infn.it [mailto:owner-fluka-=20
*

*> discuss_at_mi.infn.it] On Behalf Of Juan Blanco Sancho
*

*> Sent: Freitag, 21. November 2008 14:36
*

*> To: fluka-discuss_at_fluka.org
*

*> Subject: divergence + convergence
*

*>=20
*

*> Hi all,
*

*> I wonder how can I set a beam that converges with the BEAM card or=20
*

*> with the source.f+DIVBM.
*

*> I also want to set a different value of divergence for xz and yz=20
*

*> planes.
*

*>=20
*

*> Cheers,
*

*> Juan.
*

*>=20
*

Received on Mon Nov 24 2008 - 22:59:21 CET

*
This archive was generated by hypermail 2.2.0
: Mon Nov 24 2008 - 22:59:21 CET
*