Import Geant4 10.7.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2020-06-26 10:23:25 +02:00
parent c02c370437
commit 67ba86d073
1871 changed files with 174422 additions and 131884 deletions
@@ -25,9 +25,9 @@
//
//
//
//
//
// ------------------------------------------------------------
// GEANT 4 class header file
// GEANT 4 class header file
// ------------------------------------------------------------
// Class description:
//
@@ -50,29 +50,30 @@
#include <CLHEP/Units/PhysicalConstants.h>
#include "globals.hh"
#include "Randomize.hh"
#include "G4ThreeVector.hh"
#include "Randomize.hh"
#include "globals.hh"
// G.Marsaglia (1972) method
inline G4ThreeVector G4RandomDirection()
{
G4double u, v, b;
do {
u = 2.*G4UniformRand() - 1.;
v = 2.*G4UniformRand() - 1.;
b = u*u + v*v;
} while (b > 1.);
G4double a = 2.*std::sqrt(1. - b);
return G4ThreeVector(a*u, a*v, 2.*b - 1.);
do
{
u = 2. * G4UniformRand() - 1.;
v = 2. * G4UniformRand() - 1.;
b = u * u + v * v;
} while(b > 1.);
G4double a = 2. * std::sqrt(1. - b);
return G4ThreeVector(a * u, a * v, 2. * b - 1.);
}
inline G4ThreeVector G4RandomDirection(G4double cosTheta)
{
G4double z = (1. - cosTheta)*G4UniformRand() + cosTheta;
G4double rho = std::sqrt((1.+z)*(1.-z));
G4double phi = CLHEP::twopi*G4UniformRand();
return G4ThreeVector(rho*std::cos(phi), rho*std::sin(phi), z);
G4double z = (1. - cosTheta) * G4UniformRand() + cosTheta;
G4double rho = std::sqrt((1. + z) * (1. - z));
G4double phi = CLHEP::twopi * G4UniformRand();
return G4ThreeVector(rho * std::cos(phi), rho * std::sin(phi), z);
}
#endif /* G4RANDOMDIR_HH */
#endif /* G4RANDOMDIR_HH */