Import Geant4 10.2.0 source tree
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4PairProductionRelModel.cc 83685 2014-09-09 12:39:00Z gcosmo $
|
||||
// $Id: G4PairProductionRelModel.cc 91726 2015-08-03 15:41:36Z gcosmo $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -358,9 +358,11 @@ G4PairProductionRelModel::SampleSecondaries(std::vector<G4DynamicParticle*>* fve
|
||||
const G4Element* anElement =
|
||||
SelectRandomAtom(aMaterial, theGamma, GammaEnergy);
|
||||
|
||||
CLHEP::HepRandomEngine* rndmEngine = G4Random::getTheEngine();
|
||||
|
||||
if (GammaEnergy < Egsmall) {
|
||||
|
||||
epsil = epsil0 + (0.5-epsil0)*G4UniformRand();
|
||||
epsil = epsil0 + (0.5-epsil0)*rndmEngine->flat();
|
||||
|
||||
} else {
|
||||
// now comes the case with GammaEnergy >= 2. MeV
|
||||
@@ -390,8 +392,8 @@ G4PairProductionRelModel::SampleSecondaries(std::vector<G4DynamicParticle*>* fve
|
||||
G4double NormF2 = max(1.5*F20,0.);
|
||||
|
||||
do {
|
||||
if ( NormF1/(NormF1+NormF2) > G4UniformRand() ) {
|
||||
epsil = 0.5 - epsilrange*nist->GetZ13(G4UniformRand());
|
||||
if ( NormF1/(NormF1+NormF2) > rndmEngine->flat() ) {
|
||||
epsil = 0.5 - epsilrange*nist->GetZ13(rndmEngine->flat());
|
||||
screenvar = screenfac/(epsil*(1-epsil));
|
||||
if (fLPMflag && GammaEnergy>100.*GeV) {
|
||||
CalcLPMFunctions(GammaEnergy,GammaEnergy*epsil);
|
||||
@@ -403,7 +405,7 @@ G4PairProductionRelModel::SampleSecondaries(std::vector<G4DynamicParticle*>* fve
|
||||
}
|
||||
|
||||
} else {
|
||||
epsil = epsilmin + epsilrange*G4UniformRand();
|
||||
epsil = epsilmin + epsilrange*rndmEngine->flat();
|
||||
screenvar = screenfac/(epsil*(1-epsil));
|
||||
if (fLPMflag && GammaEnergy>100.*GeV) {
|
||||
CalcLPMFunctions(GammaEnergy,GammaEnergy*epsil);
|
||||
@@ -415,7 +417,8 @@ G4PairProductionRelModel::SampleSecondaries(std::vector<G4DynamicParticle*>* fve
|
||||
}
|
||||
}
|
||||
|
||||
} while( greject < G4UniformRand() );
|
||||
// Loop checking, 03-Aug-2015, Vladimir Ivanchenko
|
||||
} while( greject < rndmEngine->flat());
|
||||
|
||||
} // end of epsil sampling
|
||||
|
||||
@@ -424,7 +427,7 @@ G4PairProductionRelModel::SampleSecondaries(std::vector<G4DynamicParticle*>* fve
|
||||
//
|
||||
|
||||
G4double ElectTotEnergy, PositTotEnergy;
|
||||
if (G4UniformRand() > 0.5) {
|
||||
if (rndmEngine->flat() > 0.5) {
|
||||
|
||||
ElectTotEnergy = (1.-epsil)*GammaEnergy;
|
||||
PositTotEnergy = epsil*GammaEnergy;
|
||||
@@ -442,17 +445,14 @@ G4PairProductionRelModel::SampleSecondaries(std::vector<G4DynamicParticle*>* fve
|
||||
// (Geant3 manual (1993) Phys211),
|
||||
// derived from Tsai distribution (Rev Mod Phys 49,421(1977))
|
||||
|
||||
G4double u;
|
||||
static const G4double a1 = 0.625;
|
||||
static const G4double a2 = 3.*a1;
|
||||
static const G4double d = 27. ;
|
||||
G4double u = -G4Log(rndmEngine->flat()*rndmEngine->flat());
|
||||
|
||||
if (9./(9.+d) >G4UniformRand()) u= - G4Log(G4UniformRand()*G4UniformRand())/a1;
|
||||
else u= - G4Log(G4UniformRand()*G4UniformRand())/a2;
|
||||
if (9. > 36.*rndmEngine->flat()) { u *= 1.6; }
|
||||
else { u *= 0.53333; }
|
||||
|
||||
G4double TetEl = u*electron_mass_c2/ElectTotEnergy;
|
||||
G4double TetPo = u*electron_mass_c2/PositTotEnergy;
|
||||
G4double Phi = twopi * G4UniformRand();
|
||||
G4double Phi = twopi * rndmEngine->flat();
|
||||
G4double dxEl= sin(TetEl)*cos(Phi),dyEl= sin(TetEl)*sin(Phi),dzEl=cos(TetEl);
|
||||
G4double dxPo=-sin(TetPo)*cos(Phi),dyPo=-sin(TetPo)*sin(Phi),dzPo=cos(TetPo);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user