Message: distribution uniform Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None distribution uniform 

Forum: Event and Track Management
Date: 11 Jul, 2011
From: Chaw <Chaw>

Hi,

I have a litle problem. I would like to have a distribution uniform between 0 and 4pi.

 G4double phi = 2*pi*G4UniformRand();
  G4double cosTheta = G4UniformRand();
  G4double sinTheta = std::sqrt(1. - cosTheta*cosTheta);
  G4double ux = sinTheta*std::cos(phi),
           uy = sinTheta*std::sin(phi),
           uz = -cosTheta;
It's distribution uniform in 2*pi?

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

1 Idea: Re: distribution uniform   (Zach Hartwig - 11 Jul, 2011)
2 None: Re: distribution uniform   (michel maire - 12 Jul, 2011)
 Add Message Add Message
to: "distribution uniform"

 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 ]