RE: questions with source & USRBIN

From: Mario Santana Leitner (Mario.Santana@cern.ch)
Date: Tue Mar 20 2007 - 01:19:46 CET

• Next message: Vadim Talanov: "Jtrack value equal to -7 and -8"

Hello

Concerning the first question, from the source file that you attach, I can't see where you do the random generation within the sphere, you seem to use the 6 coordinates of the beam:

TXFLK (NPFLKA) = UBEAM
TYFLK (NPFLKA) = VBEAM
TZFLK (NPFLKA) = WBEAM
* TZFLK (NPFLKA) = SQRT ( ONEONE - TXFLK (NPFLKA)**2
* & - TYFLK (NPFLKA)**2 )
* Polarization cosines:
TXPOL (NPFLKA) = -TWOTWO
TYPOL (NPFLKA) = +ZERZER
TZPOL (NPFLKA) = +ZERZER
* Particle coordinates
XBEAM = 0.D0
YBEAM = 0.D0
ZBEAM = 8.D2
XFLK (NPFLKA) = XBEAM
YFLK (NPFLKA) = YBEAM
ZFLK (NPFLKA) = ZBEAM

---------------------------------

I would suggest doing something like this, in the input file, you use the BEAMPOS card as follows:
WHAT(1)-WHAT(3):x,y,z coordinates of the center of the sphere (XBEAM-ZBEAM)
WHAT(4): radius of the sphere (UBEAM)

If you want to generate in the VOLUME of the sphere:

r = UBEAM * (FLRNDM(dummy) ** (ONETHI))
alpha = PIPIPI * (FLRNDM(dummy))
beta = TWOPIP * (FLRNDM(dummy))

If you would want to generate only in the surface of the sphere, you would use something like this instead:

r = UBEAM
alpha = ACOS (ONEONE - TWOTWO * FLRNDM(dummy))
beta = TWOPIP * (FLRNDM(dummy))

In any case,

XFLK (NPFLKA) = XBEAM + r * SIN(alpha) * COS(beta)
YFLK (NPFLKA) = YBEAM + r * SIN(alpha) * SIN(beta)
ZFLK (NPFLKA) = ZBEAM + r * COS(alpha)

If the particles are pointing the center of the sphere, as you wrote, then:

TXFLK (NPFLKA) = -SIN(alpha) * COS(beta)
TZFLK (NPFLKA) = -COS(alpha)
TYFLK (NPFLKA) = SQRT ( ONEONE - TXFLK (NPFLKA)**2
& - TZFLK (NPFLKA)**2 )

Hope this helps,

Mario

• Next message: Vadim Talanov: "Jtrack value equal to -7 and -8"

This archive was generated by hypermail 2.1.6 : Tue Mar 20 2007 - 09:08:35 CET