34#define INCLXX_IN_GEANT4_MODE 1
62#ifdef INCL_COUNT_RND_CALLS
74 INCL_ERROR(
"INCL random number generator already initialized." <<
'\n');
76#ifdef INCL_COUNT_RND_CALLS
94#ifdef INCL_COUNT_RND_CALLS
102 while( (r=
shoot()) <= 0. )
109 while( (r=
shoot()) >= 1. )
114#ifndef INCLXX_IN_GEANT4_MODE
138 return G4RandGauss::shoot(0.,sigma);
152 return sigma*std::sqrt(-2*std::log(u))*std::cos(v);
157 return sigma*std::sqrt(-2*std::log(u))*std::sin(v);
165 const G4double stheta = std::sqrt(1.-ctheta*ctheta);
168 norm * stheta * std::cos(phi),
169 norm * stheta * std::sin(phi),
185 G4double factor = 1.-corrCoeff*corrCoeff;
188#ifndef INCLXX_IN_GEANT4_MODE
190 const G4double y = corrCoeff * x +
gauss(sigma*std::sqrt(factor)) + x0;
196 return std::make_pair(x, y);
218#ifdef INCL_COUNT_RND_CALLS
220 unsigned long long getNumberOfCalls() {
244#ifdef INCLXX_IN_GEANT4_MODE
247 RNGType rng = theConfig->getRNGType();
#define INCLXX_IN_GEANT4_MODE
std::shared_ptr< HepRandom > theGenerator
Extended Ranecu-type RNG class.
G4double gaussianCDF(const G4double x)
Cumulative distribution function for Gaussian.
G4double pow13(G4double x)
const G4double oneOverSqrtThree
ThreeVector normVector(G4double norm=1.)
G4double gaussWithMemory(G4double sigma=1.)
ThreeVector sphereVector(G4double rmax=1.)
G4double gauss(G4double sigma=1.)
ThreeVector gaussVector(G4double sigma=1.)
Generate Gaussianly-distributed ThreeVectors.
SeedVector getSavedSeeds()
Get the saved status of the random-number generator.
Adapter const & getAdapter()
void setSeeds(const SeedVector &sv)
std::pair< G4double, G4double > correlatedGaussian(const G4double corrCoeff, const G4double x0=0., const G4double sigma=1.)
Generate pairs of correlated Gaussian random numbers.
void setGenerator(G4INCL::IRandomGenerator *aGenerator)
std::pair< G4double, G4double > correlatedUniform(const G4double corrCoeff)
Generate pairs of correlated uniform random numbers.
void saveSeeds()
Save the status of the random-number generator.
void initialize(Config const *const)
Initialize generator according to a Config object.