Message: Re: random generation of particles in 3D Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Idea Re: random generation of particles in 3D 

Forum: Particles
Re: Question random generation of particles in 3D (valerie)
Date: 14 Jul, 2003
From: Domingo Granero <Domingo Granero>

Instead of the use of
	phi=pi*G4UniformRand()

you must use

    phi= 2.*Pi* G4UniformRand();
    cosTheta = -1. + 2. * G4UniformRand();
    sinTheta = sqrt(1. - cosTheta * cosTheta);

    ux= sinTheta * cos(phi);
    uy= sinTheta * sin(phi);
    uz =cosTheta;

where theta<=pi, phi<=2*pi

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

 Add Message Add Message
to: "Re: random generation of particles in 3D"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]