Import Geant4 10.2.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-10 14:11:04 +02:00
parent c9b32a6c0a
commit d4af681f38
4886 changed files with 420149 additions and 1023309 deletions
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4RandomTools.hh 67970 2013-03-13 10:10:06Z gcosmo $
// $Id: G4RandomTools.hh 90092 2015-05-13 11:53:25Z gcosmo $
//
//
// ---------------------------------------------------------------------------
@@ -56,9 +56,12 @@ inline G4ThreeVector G4LambertianRand(const G4ThreeVector& normal)
{
G4ThreeVector vect;
G4double ndotv;
G4int count=0;
const G4int max_trials = 1024;
do
{
++count;
vect = G4RandomDirection();
ndotv = normal * vect;
@@ -68,7 +71,7 @@ inline G4ThreeVector G4LambertianRand(const G4ThreeVector& normal)
ndotv = -ndotv;
}
} while (!(G4UniformRand() < ndotv));
} while (!(G4UniformRand() < ndotv) && (count < max_trials));
return vect;
}