Go to the source code of this file.
◆ G4LambertianRand()
Definition at line 58 of file G4RandomTools.hh.
59{
63 const G4int max_trials = 1024;
64
65 do
66 {
67 ++count;
69 ndotv = normal * vect;
70
71 if(ndotv < 0.0)
72 {
73 vect = -vect;
74 ndotv = -ndotv;
75 }
76
78
79 return vect;
80}
G4ThreeVector G4RandomDirection()
CLHEP::Hep3Vector G4ThreeVector
◆ G4PlaneVectorRand()
Definition at line 85 of file G4RandomTools.hh.
86{
89
93
94 return cosphi * vec1 + sinphi * vec2;
95}
Hep3Vector orthogonal() const
Hep3Vector cross(const Hep3Vector &) const
◆ G4RandomPointInEllipse()
Definition at line 115 of file G4RandomTools.hh.
116{
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)
120 {
123 if(x * x * aa + y * y * bb <= 1)
125 }
127}
CLHEP::Hep2Vector G4TwoVector
◆ G4RandomPointOnEllipse()
Definition at line 133 of file G4RandomTools.hh.
134{
138
140 for(
G4int i = 0; i < 1000; ++i)
141 {
143 x = std::cos(phi);
144 y = std::sin(phi);
145 G4double mu = std::sqrt((
B * x) * (
B * x) + (
A * y) * (
A * y));
147 break;
148 }
150}
G4double B(G4double temperature)
◆ G4RandomPointOnEllipsoid()
Definition at line 156 of file G4RandomTools.hh.
158{
163
165 for(
G4int i = 0; i < 1000; ++i)
166 {
171 G4double mu = std::sqrt(xbc * xbc + yac * yac + zab * zab);
173 break;
174 }
176}
G4double C(G4double temp)
◆ G4RandomRadiusInRing()
Definition at line 100 of file G4RandomTools.hh.
101{
102 if(rmin == rmax)
103 {
104 return rmin;
105 }
107 return (rmin <= 0) ? rmax * std::sqrt(k)
108 :
std::sqrt(k * rmax * rmax + (1. - k) * rmin * rmin);
109}