Import Geant4 10.4.0.beta source tree
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4RayleighAngularGenerator.cc 74822 2013-10-22 14:42:13Z gcosmo $
|
||||
// $Id: G4RayleighAngularGenerator.cc 104410 2017-05-30 07:17:09Z gcosmo $
|
||||
// GEANT4 tag $Name: not supported by svn $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
@@ -32,7 +32,7 @@
|
||||
//
|
||||
// File name: G4RayleighAngularGenerator
|
||||
//
|
||||
// Author: Ivanchenko using design of existing
|
||||
// Author: V. Ivanchenko using design of existing
|
||||
// interface
|
||||
//
|
||||
// Creation date: 31 May 2012
|
||||
@@ -84,7 +84,6 @@ G4RayleighAngularGenerator::SampleDirection(const G4DynamicParticle* dp,
|
||||
{
|
||||
G4double ekin = dp->GetKineticEnergy();
|
||||
G4double xx = fFactor*ekin*ekin;
|
||||
G4double cost;
|
||||
|
||||
G4double n0 = PP6[Z] - 1.0;
|
||||
G4double n1 = PP7[Z] - 1.0;
|
||||
@@ -92,30 +91,25 @@ G4RayleighAngularGenerator::SampleDirection(const G4DynamicParticle* dp,
|
||||
G4double b0 = PP3[Z];
|
||||
G4double b1 = PP4[Z];
|
||||
G4double b2 = PP5[Z];
|
||||
G4double w0 = 0.0;
|
||||
G4double w1 = 0.0;
|
||||
G4double w2 = 0.0;
|
||||
|
||||
const G4double numlim = 0.02;
|
||||
G4double x = 2*xx*b0;
|
||||
if(x < numlim) { w0 = n0*x*(1 - 0.5*(n0 - 1)*x*(1 - (n0 - 2)*x/3.)); }
|
||||
else { w0 = 1 - G4Exp(-n0*G4Log(1 + x)); }
|
||||
static const G4double numlim = 0.02;
|
||||
G4double x = 2.*xx*b0;
|
||||
G4double w0 = (x < numlim) ? n0*x*(1.0 - 0.5*(n0 - 1.0)*x*(1.0 - (n0 - 2.0)*x/3.))
|
||||
: 1.0 - G4Exp(-n0*G4Log(1.0 + x));
|
||||
|
||||
if(PP1[Z] > 0.0) {
|
||||
x = 2*xx*b1;
|
||||
if(x < numlim) { w1 = n1*x*(1 - 0.5*(n1 - 1)*x*(1 - (n1 - 2)*x/3.)); }
|
||||
else { w1 = 1 - G4Exp(-n1*G4Log(1 + x)); }
|
||||
}
|
||||
if(PP2[Z] > 0.0) {
|
||||
x = 2*xx*b2;
|
||||
if(x < numlim) { w2 = n2*x*(1 - 0.5*(n2 - 1)*x*(1 - (n2 - 2)*x/3.)); }
|
||||
else { w2 = 1 - G4Exp(-n2*G4Log(1 + x)); }
|
||||
}
|
||||
x = 2.*xx*b1;
|
||||
G4double w1 = (x < numlim) ? n1*x*(1.0 - 0.5*(n1 - 1.0)*x*(1.0 - (n1 - 2.0)*x/3.))
|
||||
: 1.0 - G4Exp(-n1*G4Log(1.0 + x));
|
||||
|
||||
x = 2.*xx*b2;
|
||||
G4double w2 = (x < numlim) ? n2*x*(1.0 - 0.5*(n2 - 1.0)*x*(1.0 - (n2 - 2.0)*x/3.))
|
||||
: 1.0 - G4Exp(-n2*G4Log(1.0 + x));
|
||||
|
||||
G4double x0= w0*PP0[Z]/(b0*n0);
|
||||
G4double x1= w1*PP1[Z]/(b1*n1);
|
||||
G4double x2= w2*PP2[Z]/(b2*n2);
|
||||
|
||||
G4double cost;
|
||||
do {
|
||||
|
||||
G4double w = w0;
|
||||
@@ -139,9 +133,9 @@ G4RayleighAngularGenerator::SampleDirection(const G4DynamicParticle* dp,
|
||||
|
||||
// sampling of angle
|
||||
G4double y = w*G4UniformRand();
|
||||
if(y < numlim) { x = y*n*( 1 + 0.5*(n + 1)*y*(1 - (n + 2)*y/3.)); }
|
||||
if(y < numlim) { x = y*n*( 1. + 0.5*(n + 1.)*y*(1. - (n + 2.)*y/3.)); }
|
||||
//else { x = 1.0/std::pow(1 - y, n) - 1.0; }
|
||||
else { x = G4Exp(-n*G4Log(1 - y)) - 1.0; }
|
||||
else { x = G4Exp(-n*G4Log(1. - y)) - 1.0; }
|
||||
cost = 1.0 - x/(b*xx);
|
||||
//G4cout << "cost = " << cost << " w= " << w << " n= " << n
|
||||
// << " b= " << b << " x= " << x << " xx= " << xx << G4endl;
|
||||
|
||||
Reference in New Issue
Block a user