33 #define INCLXX_IN_GEANT4_MODE 1
60 INCL_ERROR(
"INCL random number generator already initialized." << std::endl);
80 while( (r=
shoot()) <= 0. )
87 while( (r=
shoot()) >= 1. )
94 return static_cast<T
>(
shoot1() *
n);
108 return sigma*std::sqrt(-2*std::log(u))*std::cos(v);
113 return sigma*std::sqrt(-2*std::log(u))*std::sin(v);
120 const G4double stheta = std::sqrt(1.-ctheta*ctheta);
123 norm * stheta * std::cos(phi),
124 norm * stheta * std::sin(phi),
140 G4double factor = 1.-corrCoeff*corrCoeff;
144 const G4double y = corrCoeff * x +
gauss(sigma*std::sqrt(factor)) + x0;
145 return std::make_pair(x, y);
ThreeVector gaussVector(G4double sigma=1.)
Generate Gaussianly-distributed ThreeVectors.
ThreeVector sphereVector(G4double rmax=1.)
shared_ptr< HepRandom > theGenerator
ThreeVector normVector(G4double norm=1.)
std::pair< G4double, G4double > correlatedUniform(const G4double corrCoeff)
Generate pairs of correlated uniform random numbers.
const G4double oneOverSqrtThree
void setGenerator(G4INCL::IRandomGenerator *aGenerator)
G4double gauss(G4double sigma=1.)
G4double pow13(G4double x)
std::pair< G4double, G4double > correlatedGaussian(const G4double corrCoeff, const G4double x0=0., const G4double sigma=1.)
Generate pairs of correlated Gaussian random numbers.
double Random(double min=0.0, double max=1.0)
G4double gaussianCDF(const G4double x)
Cumulative distribution function for Gaussian.
void setSeeds(const SeedVector &sv)