Import Geant4 9.6.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 17:01:34 +02:00
parent b1eb5424d2
commit e2d2f9810a
10384 changed files with 698580 additions and 628834 deletions
@@ -24,11 +24,12 @@
// ********************************************************************
//
//
// $Id: G4RPGKPlusInelastic.cc,v 1.1 2007-07-18 21:04:20 dennis Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
#include "G4RPGKPlusInelastic.hh"
#include "G4PhysicalConstants.hh"
#include "G4SystemOfUnits.hh"
#include "Randomize.hh"
G4HadFinalState*
@@ -164,9 +165,9 @@ void G4RPGKPlusInelastic::Cascade(
static G4double protmul[numMul], protnorm[numSec]; // proton constants
static G4double neutmul[numMul], neutnorm[numSec]; // neutron constants
// np = number of pi+, nm = number of pi-, nz = number of pi0
// np = number of pi+, nneg = number of pi-, nz = number of pi0
G4int nt=0, np=0, nm=0, nz=0;
G4int nt=0, np=0, nneg=0, nz=0;
const G4double c = 1.25;
const G4double b[] = { 0.70, 0.70 };
if( first ) // compute normalization constants, this will only be Done once
@@ -178,16 +179,16 @@ void G4RPGKPlusInelastic::Cascade(
G4int counter = -1;
for( np=0; np<(numSec/3); ++np )
{
for( nm=std::max(0,np-2); nm<=np; ++nm )
for( nneg=std::max(0,np-2); nneg<=np; ++nneg )
{
for( nz=0; nz<numSec/3; ++nz )
{
if( ++counter < numMul )
{
nt = np+nm+nz;
nt = np+nneg+nz;
if( nt > 0 )
{
protmul[counter] = Pmltpc(np,nm,nz,nt,b[0],c);
protmul[counter] = Pmltpc(np,nneg,nz,nt,b[0],c);
protnorm[nt-1] += protmul[counter];
}
}
@@ -199,16 +200,16 @@ void G4RPGKPlusInelastic::Cascade(
counter = -1;
for( np=0; np<numSec/3; ++np )
{
for( nm=std::max(0,np-1); nm<=(np+1); ++nm )
for( nneg=std::max(0,np-1); nneg<=(np+1); ++nneg )
{
for( nz=0; nz<numSec/3; ++nz )
{
if( ++counter < numMul )
{
nt = np+nm+nz;
nt = np+nneg+nz;
if( (nt>0) && (nt<=numSec) )
{
neutmul[counter] = Pmltpc(np,nm,nz,nt,b[1],c);
neutmul[counter] = Pmltpc(np,nneg,nz,nt,b[1],c);
neutnorm[nt-1] += neutmul[counter];
}
}
@@ -236,7 +237,7 @@ void G4RPGKPlusInelastic::Cascade(
// suppress high multiplicity events at low momentum
// only one pion will be produced
nm = np = nz = 0;
nneg = np = nz = 0;
if( targetParticle.GetDefinition() == aProton )
{
test = std::exp( std::min( expxu, std::max( expxl, -sqr(1.0+b[0])/(2.0*c*c) ) ) );
@@ -262,7 +263,7 @@ void G4RPGKPlusInelastic::Cascade(
else if( ran < wp/wt )
np = 1;
else
nm = 1;
nneg = 1;
}
}
else
@@ -276,13 +277,13 @@ void G4RPGKPlusInelastic::Cascade(
G4int counter = -1;
for( np=0; (np<numSec/3) && (ran>=excs); ++np )
{
for( nm=std::max(0,np-2); (nm<=np) && (ran>=excs); ++nm )
for( nneg=std::max(0,np-2); (nneg<=np) && (ran>=excs); ++nneg )
{
for( nz=0; (nz<numSec/3) && (ran>=excs); ++nz )
{
if( ++counter < numMul )
{
nt = np+nm+nz;
nt = np+nneg+nz;
if( nt > 0 )
{
test = std::exp( std::min( expxu, std::max( expxl, -(pi/4.0)*(nt*nt)/(n*n) ) ) );
@@ -299,20 +300,20 @@ void G4RPGKPlusInelastic::Cascade(
}
}
if( ran >= excs )return; // 3 previous loops continued to the end
np--; nm--; nz--;
np--; nneg--; nz--;
}
else // target must be a neutron
{
G4int counter = -1;
for( np=0; (np<numSec/3) && (ran>=excs); ++np )
{
for( nm=std::max(0,np-1); (nm<=(np+1)) && (ran>=excs); ++nm )
for( nneg=std::max(0,np-1); (nneg<=(np+1)) && (ran>=excs); ++nneg )
{
for( nz=0; (nz<numSec/3) && (ran>=excs); ++nz )
{
if( ++counter < numMul )
{
nt = np+nm+nz;
nt = np+nneg+nz;
if( (nt>=1) && (nt<=numSec) )
{
test = std::exp( std::min( expxu, std::max( expxl, -(pi/4.0)*(nt*nt)/(n*n) ) ) );
@@ -329,13 +330,13 @@ void G4RPGKPlusInelastic::Cascade(
}
}
if( ran >= excs )return; // 3 previous loops continued to the end
np--; nm--; nz--;
np--; nneg--; nz--;
}
}
if( targetParticle.GetDefinition() == aProton )
{
switch( np-nm )
switch( np-nneg )
{
case 1:
if( G4UniformRand() < 0.5 )
@@ -368,7 +369,7 @@ void G4RPGKPlusInelastic::Cascade(
}
else // target is a neutron
{
switch( np-nm )
switch( np-nneg )
{
case 0:
if( G4UniformRand() < 0.25 )
@@ -389,13 +390,14 @@ void G4RPGKPlusInelastic::Cascade(
currentParticle.SetDefinitionAndUpdateE( aKaonZL );
incidentHasChanged = true;
break;
default: // assumes nm = np+1 so charge is conserved
default: // assumes nneg = np+1 so charge is conserved
targetParticle.SetDefinitionAndUpdateE( aProton );
targetHasChanged = true;
break;
}
}
SetUpPions( np, nm, nz, vec, vecLen );
SetUpPions(np, nneg, nz, vec, vecLen);
return;
}