44#ifndef G4RANDOMTOOLS_HH
45#define G4RANDOMTOOLS_HH
63 const G4int max_trials = 1024;
69 ndotv = normal * vect;
94 return cosphi * vec1 + sinphi * vec2;
107 return (rmin <= 0) ? rmax * std::sqrt(k)
108 : std::sqrt(k * rmax * rmax + (1. - k) * rmin * rmin);
117 G4double aa = (a * a == 0) ? 0 : 1 / (a * a);
118 G4double bb = (b * b == 0) ? 0 : 1 / (b * b);
119 for(
G4int i = 0; i < 1000; ++i)
123 if(x * x * aa + y * y * bb <= 1)
140 for(
G4int i = 0; i < 1000; ++i)
145 G4double mu = std::sqrt((
B * x) * (
B * x) + (
A * y) * (
A * y));
162 G4double mu_max = std::max(std::max(
A *
B,
A * C),
B * C);
165 for(
G4int i = 0; i < 1000; ++i)
171 G4double mu = std::sqrt(xbc * xbc + yac * yac + zab * zab);
G4double B(G4double temperature)
G4ThreeVector G4RandomDirection()
CLHEP::Hep3Vector G4ThreeVector
CLHEP::Hep2Vector G4TwoVector
Hep3Vector orthogonal() const
Hep3Vector cross(const Hep3Vector &) const