Import Geant4 1.1.0 source tree
This commit is contained in:
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4LightMedia.cc,v 1.1.10.1 1999/12/07 20:52:44 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
// $Id: G4LightMedia.cc,v 1.1.10.1.2.1 1999/12/10 15:42:17 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-01 $
|
||||
//
|
||||
// Hadronic Process: Light Media Charge and/or Strangeness Exchange
|
||||
// J.L. Chuma, TRIUMF, 21-Feb-1997
|
||||
@@ -34,7 +34,7 @@
|
||||
// for pi+ n reactions, change some of the elastic cross section to pi0 p
|
||||
|
||||
const G4double cech[] = {0.33,0.27,0.29,0.31,0.27,0.18,0.13,0.10,0.09,0.07};
|
||||
G4int iplab = G4int(min( 9.0, incidentParticle->GetTotalMomentum()/GeV*5.0 ));
|
||||
G4int iplab = G4int(G4std::min( 9.0, incidentParticle->GetTotalMomentum()/GeV*5.0 ));
|
||||
if( G4UniformRand() > cech[iplab]/pow(atomicNumber,0.42) ) {
|
||||
G4DynamicParticle* resultant = new G4DynamicParticle;
|
||||
resultant->SetDefinition( aPiZero );
|
||||
@@ -75,7 +75,7 @@
|
||||
// for k+ n reactions, change some of the elastic cross section to k0 p
|
||||
|
||||
const G4double cech[] = {0.33,0.27,0.29,0.31,0.27,0.18,0.13,0.10,0.09,0.07};
|
||||
G4int iplab = G4int( min( 9.0, incidentParticle->GetTotalMomentum()/GeV*5.0 ) );
|
||||
G4int iplab = G4int( G4std::min( 9.0, incidentParticle->GetTotalMomentum()/GeV*5.0 ) );
|
||||
if( G4UniformRand() <= cech[iplab]/pow(atomicNumber,0.42) ) {
|
||||
G4DynamicParticle* resultant = new G4DynamicParticle;
|
||||
if( G4UniformRand() < 0.5 )
|
||||
@@ -111,7 +111,7 @@
|
||||
// for k0 p reactions, change some of the elastic cross section to k+ n
|
||||
|
||||
const G4double cech[] = {0.33,0.27,0.29,0.31,0.27,0.18,0.13,0.10,0.09,0.07};
|
||||
G4int iplab = G4int( min( 9.0, incidentParticle->GetTotalMomentum()/GeV*5.0 ) );
|
||||
G4int iplab = G4int( G4std::min( 9.0, incidentParticle->GetTotalMomentum()/GeV*5.0 ) );
|
||||
if( G4UniformRand() > cech[iplab]/pow(atomicNumber,0.42) ) {
|
||||
G4DynamicParticle* resultant = new G4DynamicParticle;
|
||||
resultant->SetDefinition( aKaonPlus );
|
||||
@@ -169,7 +169,7 @@
|
||||
|
||||
if( targetParticle->GetDefinition() == aNeutron ) {
|
||||
const G4double cech[] = {0.50,0.45,0.40,0.35,0.30,0.25,0.06,0.04,0.005,0.};
|
||||
G4int iplab = G4int( min( 9.0, incidentParticle->GetTotalMomentum()/GeV*2.5 ) );
|
||||
G4int iplab = G4int( G4std::min( 9.0, incidentParticle->GetTotalMomentum()/GeV*2.5 ) );
|
||||
if( G4UniformRand() <= cech[iplab]/pow(atomicNumber,0.42) ) {
|
||||
G4DynamicParticle* resultant = new G4DynamicParticle;
|
||||
resultant->SetDefinition( aNeutron );
|
||||
@@ -228,7 +228,7 @@
|
||||
|
||||
if( targetParticle->GetDefinition() == aProton ) {
|
||||
const G4double cech[] = {0.50,0.45,0.40,0.35,0.30,0.25,0.06,0.04,0.005,0.};
|
||||
G4int iplab = G4int( min( 9.0, incidentParticle->GetTotalMomentum()/GeV*2.5 ) );
|
||||
G4int iplab = G4int( G4std::min( 9.0, incidentParticle->GetTotalMomentum()/GeV*2.5 ) );
|
||||
if( G4UniformRand() > cech[iplab]/pow(atomicNumber,0.42) ) {
|
||||
G4DynamicParticle* resultant = new G4DynamicParticle;
|
||||
resultant->SetDefinition( aProton );
|
||||
@@ -257,7 +257,7 @@
|
||||
|
||||
if( targetParticle->GetDefinition() == aNeutron ) {
|
||||
const G4double cech[] = {0.50,0.45,0.40,0.35,0.30,0.25,0.06,0.04,0.005,0.0};
|
||||
G4int iplab = min( 9, G4int( incidentParticle->GetTotalMomentum()/GeV*2.5 ) );
|
||||
G4int iplab = G4std::min( 9, G4int( incidentParticle->GetTotalMomentum()/GeV*2.5 ) );
|
||||
if( G4UniformRand() <= cech[iplab]/pow(atomicNumber,0.75) ) {
|
||||
G4DynamicParticle* resultant = new G4DynamicParticle;
|
||||
resultant->SetDefinition( anAntiProton );
|
||||
@@ -288,7 +288,7 @@
|
||||
G4DynamicParticle* targetParticle = targetNucleus.ReturnTargetParticle();
|
||||
|
||||
const G4double cech[] = {0.50,0.45,0.40,0.35,0.30,0.25,0.06,0.04,0.005,0.0};
|
||||
G4int iplab = G4int( min( 9.0, incidentParticle->GetTotalMomentum()/GeV*2.5 ) );
|
||||
G4int iplab = G4int( G4std::min( 9.0, incidentParticle->GetTotalMomentum()/GeV*2.5 ) );
|
||||
if( G4UniformRand() <= cech[iplab]/pow(atomicNumber,0.42) ) {
|
||||
G4DynamicParticle* resultant = new G4DynamicParticle;
|
||||
G4int irn = G4int( G4UniformRand()/0.2 );
|
||||
@@ -368,7 +368,7 @@
|
||||
G4DynamicParticle* targetParticle = targetNucleus.ReturnTargetParticle();
|
||||
|
||||
const G4double cech[] = {0.50,0.45,0.40,0.35,0.30,0.25,0.06,0.04,0.005,0.0};
|
||||
G4int iplab = G4int( min( 9.0, incidentParticle->GetTotalMomentum()/GeV*2.5 ) );
|
||||
G4int iplab = G4int( G4std::min( 9.0, incidentParticle->GetTotalMomentum()/GeV*2.5 ) );
|
||||
if( G4UniformRand() <= cech[iplab]/pow(atomicNumber,0.42) ) {
|
||||
G4DynamicParticle* resultant = new G4DynamicParticle;
|
||||
G4int irn = G4int( G4UniformRand()/0.2 );
|
||||
@@ -449,7 +449,7 @@
|
||||
G4DynamicParticle* targetParticle = targetNucleus.ReturnTargetParticle();
|
||||
|
||||
const G4double cech[] = {0.50,0.45,0.40,0.35,0.30,0.25,0.06,0.04,0.005,0.0};
|
||||
G4int iplab = G4int( min( 9.0, incidentParticle->GetTotalMomentum()/GeV*2.5 ) );
|
||||
G4int iplab = G4int( G4std::min( 9.0, incidentParticle->GetTotalMomentum()/GeV*2.5 ) );
|
||||
if( G4UniformRand() <= cech[iplab]/pow(atomicNumber,0.42) ) {
|
||||
G4DynamicParticle* resultant = new G4DynamicParticle;
|
||||
|
||||
@@ -513,7 +513,7 @@
|
||||
G4DynamicParticle* targetParticle = targetNucleus.ReturnTargetParticle();
|
||||
|
||||
const G4double cech[] = {0.50,0.45,0.40,0.35,0.30,0.25,0.06,0.04,0.005,0.0};
|
||||
G4int iplab = G4int( min( 9.0, incidentParticle->GetTotalMomentum()/GeV*2.5 ) );
|
||||
G4int iplab = G4int( G4std::min( 9.0, incidentParticle->GetTotalMomentum()/GeV*2.5 ) );
|
||||
if( G4UniformRand() <= cech[iplab]/pow(atomicNumber,0.42) ) {
|
||||
G4DynamicParticle* resultant = new G4DynamicParticle;
|
||||
|
||||
@@ -577,7 +577,7 @@
|
||||
G4DynamicParticle* targetParticle = targetNucleus.ReturnTargetParticle();
|
||||
|
||||
const G4double cech[] = {0.50,0.45,0.40,0.35,0.30,0.25,0.06,0.04,0.005,0.0};
|
||||
G4int iplab = G4int( min( 9.0, incidentParticle->GetTotalMomentum()/GeV*2.5 ) );
|
||||
G4int iplab = G4int( G4std::min( 9.0, incidentParticle->GetTotalMomentum()/GeV*2.5 ) );
|
||||
if( G4UniformRand() <= cech[iplab]/pow(atomicNumber,0.42) ) {
|
||||
G4DynamicParticle* resultant = new G4DynamicParticle;
|
||||
G4int irn = G4int( G4UniformRand()/0.2 );
|
||||
@@ -638,7 +638,7 @@
|
||||
G4DynamicParticle* targetParticle = targetNucleus.ReturnTargetParticle();
|
||||
|
||||
const G4double cech[] = {0.50,0.45,0.40,0.35,0.30,0.25,0.06,0.04,0.005,0.0};
|
||||
G4int iplab = G4int( min( 9.0, incidentParticle->GetTotalMomentum()/GeV*2.5 ) );
|
||||
G4int iplab = G4int( G4std::min( 9.0, incidentParticle->GetTotalMomentum()/GeV*2.5 ) );
|
||||
if( G4UniformRand() <= cech[iplab]/pow(atomicNumber,0.42) ) {
|
||||
G4DynamicParticle* resultant = new G4DynamicParticle;
|
||||
G4int irn = G4int( G4UniformRand()/0.2 );
|
||||
@@ -703,7 +703,7 @@
|
||||
G4DynamicParticle* targetParticle = targetNucleus.ReturnTargetParticle();
|
||||
|
||||
const G4double cech[] = {0.50,0.45,0.40,0.35,0.30,0.25,0.06,0.04,0.005,0.0};
|
||||
G4int iplab = G4int( min( 9.0, incidentParticle->GetTotalMomentum()/GeV*2.5 ) );
|
||||
G4int iplab = G4int( G4std::min( 9.0, incidentParticle->GetTotalMomentum()/GeV*2.5 ) );
|
||||
if( G4UniformRand() <= cech[iplab]/pow(atomicNumber,0.42) ) {
|
||||
G4DynamicParticle* resultant = new G4DynamicParticle;
|
||||
if( targetParticle->GetDefinition() == aNeutron ) {
|
||||
@@ -789,7 +789,7 @@
|
||||
G4DynamicParticle* targetParticle = targetNucleus.ReturnTargetParticle();
|
||||
|
||||
const G4double cech[] = {0.50,0.45,0.40,0.35,0.30,0.25,0.06,0.04,0.005,0.0};
|
||||
G4int iplab = G4int( min( 9.0, incidentParticle->GetTotalMomentum()/GeV*2.5 ) );
|
||||
G4int iplab = G4int( G4std::min( 9.0, incidentParticle->GetTotalMomentum()/GeV*2.5 ) );
|
||||
if( G4UniformRand() <= cech[iplab]/pow(atomicNumber,0.42) ) {
|
||||
G4DynamicParticle* resultant = new G4DynamicParticle;
|
||||
if( targetParticle->GetDefinition() == aNeutron ) {
|
||||
@@ -880,7 +880,7 @@
|
||||
G4DynamicParticle* targetParticle = targetNucleus.ReturnTargetParticle();
|
||||
|
||||
const G4double cech[] = {0.50,0.45,0.40,0.35,0.30,0.25,0.06,0.04,0.005,0.0};
|
||||
G4int iplab = G4int( min( 9.0, incidentParticle->GetTotalMomentum()/GeV*2.5 ) );
|
||||
G4int iplab = G4int( G4std::min( 9.0, incidentParticle->GetTotalMomentum()/GeV*2.5 ) );
|
||||
if( G4UniformRand() <= cech[iplab]/pow(atomicNumber,0.42) ) {
|
||||
G4DynamicParticle* resultant = new G4DynamicParticle;
|
||||
if( targetParticle->GetDefinition() == aNeutron ) {
|
||||
@@ -970,7 +970,7 @@
|
||||
G4DynamicParticle* targetParticle = targetNucleus.ReturnTargetParticle();
|
||||
|
||||
const G4double cech[] = {0.50,0.45,0.40,0.35,0.30,0.25,0.06,0.04,0.005,0.0};
|
||||
G4int iplab = G4int( min( 9.0, incidentParticle->GetTotalMomentum()/GeV*2.5 ) );
|
||||
G4int iplab = G4int( G4std::min( 9.0, incidentParticle->GetTotalMomentum()/GeV*2.5 ) );
|
||||
if( G4UniformRand() <= cech[iplab]/pow(atomicNumber,0.42) ) {
|
||||
G4DynamicParticle* resultant = new G4DynamicParticle;
|
||||
if( targetParticle->GetDefinition() == aNeutron ) {
|
||||
@@ -1058,7 +1058,7 @@
|
||||
G4DynamicParticle* targetParticle = targetNucleus.ReturnTargetParticle();
|
||||
|
||||
const G4double cech[] = {0.50,0.45,0.40,0.35,0.30,0.25,0.06,0.04,0.005,0.0};
|
||||
G4int iplab = G4int( min( 9.0, incidentParticle->GetTotalMomentum()/GeV*2.5 ) );
|
||||
G4int iplab = G4int( G4std::min( 9.0, incidentParticle->GetTotalMomentum()/GeV*2.5 ) );
|
||||
if( G4UniformRand() <= cech[iplab]/pow(atomicNumber,0.42) ) {
|
||||
G4DynamicParticle* resultant = new G4DynamicParticle;
|
||||
|
||||
@@ -1161,7 +1161,7 @@
|
||||
G4DynamicParticle* targetParticle = targetNucleus.ReturnTargetParticle();
|
||||
|
||||
const G4double cech[] = {0.50,0.45,0.40,0.35,0.30,0.25,0.06,0.04,0.005,0.0};
|
||||
G4int iplab = G4int( min( 9.0, incidentParticle->GetTotalMomentum()/GeV*2.5 ) );
|
||||
G4int iplab = G4int( G4std::min( 9.0, incidentParticle->GetTotalMomentum()/GeV*2.5 ) );
|
||||
if( G4UniformRand() <= cech[iplab]/pow(atomicNumber,0.42) ) {
|
||||
G4DynamicParticle* resultant = new G4DynamicParticle;
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4Nucleus.cc,v 1.3.8.1 1999/12/07 20:52:44 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
// $Id: G4Nucleus.cc,v 1.3.8.1.2.1 1999/12/10 15:42:18 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-01 $
|
||||
//
|
||||
// original by H.P. Wellisch
|
||||
// modified by J.L. Chuma, TRIUMF, 19-Nov-1996
|
||||
@@ -173,17 +173,17 @@
|
||||
return 0.0;
|
||||
}
|
||||
G4double ek = kineticEnergy/GeV;
|
||||
G4float ekin = min( 4.0, max( 0.1, ek ) );
|
||||
const G4float atno = min( 120., aEff );
|
||||
G4float ekin = G4std::min( 4.0, G4std::max( 0.1, ek ) );
|
||||
const G4float atno = G4std::min( 120., aEff );
|
||||
const G4float gfa = 2.0*((aEff-1.0)/70.)*exp(-(aEff-1.0)/70.);
|
||||
//
|
||||
// 0.35 value at 1 GeV
|
||||
// 0.05 value at 0.1 GeV
|
||||
//
|
||||
G4float cfa = max( 0.15, 0.35 + ((0.35-0.05)/2.3)*log(ekin) );
|
||||
G4float cfa = G4std::max( 0.15, 0.35 + ((0.35-0.05)/2.3)*log(ekin) );
|
||||
G4float exnu = 7.716 * cfa * exp(-cfa)
|
||||
* ((atno-1.0)/120.)*exp(-(atno-1.0)/120.);
|
||||
G4float fpdiv = max( 0.5, 1.0-0.25*ekin*ekin );
|
||||
G4float fpdiv = G4std::max( 0.5, 1.0-0.25*ekin*ekin );
|
||||
//
|
||||
// pnBlackTrackEnergy is the kinetic energy (in GeV) available for
|
||||
// proton/neutron black track particles
|
||||
@@ -207,8 +207,8 @@
|
||||
pnBlackTrackEnergy *= 1.0 + ran1*gfa;
|
||||
dtaBlackTrackEnergy *= 1.0 + ran2*gfa;
|
||||
}
|
||||
pnBlackTrackEnergy = max( 0.0, pnBlackTrackEnergy );
|
||||
dtaBlackTrackEnergy = max( 0.0, dtaBlackTrackEnergy );
|
||||
pnBlackTrackEnergy = G4std::max( 0.0, pnBlackTrackEnergy );
|
||||
dtaBlackTrackEnergy = G4std::max( 0.0, dtaBlackTrackEnergy );
|
||||
while( pnBlackTrackEnergy+dtaBlackTrackEnergy >= ek )
|
||||
{
|
||||
pnBlackTrackEnergy *= 1.0 - 0.5*G4UniformRand();
|
||||
@@ -231,9 +231,9 @@
|
||||
G4double ek = kineticEnergy/GeV;
|
||||
G4double ekLog = log( ek );
|
||||
G4double aLog = log( aEff );
|
||||
G4double em = min( 1.0, 0.2390 + 0.0408*aLog*aLog );
|
||||
G4double temp1 = -ek * min( 0.15, 0.0019*aLog*aLog*aLog );
|
||||
G4double temp2 = exp( max( expxl, min( expxu, -(ekLog-em)*(ekLog-em)*2.0 ) ) );
|
||||
G4double em = G4std::min( 1.0, 0.2390 + 0.0408*aLog*aLog );
|
||||
G4double temp1 = -ek * G4std::min( 0.15, 0.0019*aLog*aLog*aLog );
|
||||
G4double temp2 = exp( G4std::max( expxl, G4std::min( expxu, -(ekLog-em)*(ekLog-em)*2.0 ) ) );
|
||||
G4double result = 0.0;
|
||||
if( abs( temp1 ) < 1.0 )
|
||||
{
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
#include "G4AntiProton.hh"
|
||||
#include "G4AntiNeutron.hh"
|
||||
#include "Randomize.hh"
|
||||
#include <iostream.h>
|
||||
#include "g4std/iostream"
|
||||
// #include "DumpFrame.hh"
|
||||
//#include "../../alpha_test/cxx/NametoGheishNumber.cc"
|
||||
|
||||
@@ -118,7 +118,7 @@
|
||||
currentMass = currentParticle.GetMass()/GeV;
|
||||
targetMass = targetParticle.GetMass()/GeV;
|
||||
}
|
||||
const G4double afc = min( 0.75,
|
||||
const G4double afc = G4std::min( 0.75,
|
||||
0.312+0.200*log(log(centerofmassEnergy*centerofmassEnergy))+
|
||||
pow(centerofmassEnergy*centerofmassEnergy,1.5)/6000.0 );
|
||||
|
||||
@@ -172,7 +172,7 @@
|
||||
while( (momentumBin < 6) &&
|
||||
(modifiedOriginal.GetTotalMomentum()/GeV > psup[momentumBin]) )
|
||||
++momentumBin;
|
||||
momentumBin = min( 5, momentumBin );
|
||||
momentumBin = G4std::min( 5, momentumBin );
|
||||
//
|
||||
// NOTE: in GENXPT, these new particles were given negative codes
|
||||
// here I use NewlyAdded = true instead
|
||||
@@ -402,7 +402,7 @@
|
||||
pt = sqrt( pow( ran, 1.5 ) );
|
||||
}
|
||||
}
|
||||
pt = max( 0.001, pt );
|
||||
pt = G4std::max( 0.001, pt );
|
||||
vec[i]->SetMomentum( pt*cos(phi)*GeV, pt*sin(phi)*GeV );
|
||||
for( G4int j=0; j<20; ++j )binl[j] = j/(19.*pt);
|
||||
if( vec[i]->GetSide() > 0 )
|
||||
@@ -421,7 +421,7 @@
|
||||
for( l=1; l<20; ++l )
|
||||
{
|
||||
x = (binl[l]+binl[l-1])/2.;
|
||||
pt = max( 0.001, pt );
|
||||
pt = G4std::max( 0.001, pt );
|
||||
if( x > 1.0/pt )
|
||||
dndl[l] += dndl[l-1]; // changed from just = on 02 April 98
|
||||
else
|
||||
@@ -439,8 +439,8 @@
|
||||
ran = G4UniformRand()*dndl[19];
|
||||
l = 1;
|
||||
while( ( ran >= dndl[l] ) && ( l < 20 ) )l++;
|
||||
l = min( 19, l );
|
||||
x = min( 1.0, pt*(binl[l-1] + G4UniformRand()*(binl[l]-binl[l-1])/2.) );
|
||||
l = G4std::min( 19, l );
|
||||
x = G4std::min( 1.0, pt*(binl[l-1] + G4UniformRand()*(binl[l]-binl[l-1])/2.) );
|
||||
if( vec[i]->GetSide() < 0 )x *= -1.;
|
||||
vec[i]->SetMomentum( x*et*GeV ); // set the z-momentum
|
||||
totalEnergy = sqrt( x*et*x*et + pt*pt + vecMass*vecMass );
|
||||
@@ -530,7 +530,7 @@
|
||||
{
|
||||
G4double tempMass = vec[l]->GetMass()/MeV;
|
||||
totalEnergy = 0.95*vec[l]->GetTotalEnergy()/MeV + 0.05*tempMass;
|
||||
totalEnergy = max( tempMass, totalEnergy );
|
||||
totalEnergy = G4std::max( tempMass, totalEnergy );
|
||||
vec[l]->SetTotalEnergy( totalEnergy*MeV );
|
||||
pp = sqrt( abs( totalEnergy*totalEnergy - tempMass*tempMass ) );
|
||||
pp1 = vec[l]->GetMomentum().mag()/MeV;
|
||||
@@ -547,7 +547,7 @@
|
||||
}
|
||||
G4double px = vec[l]->GetMomentum().x()/MeV;
|
||||
G4double py = vec[l]->GetMomentum().y()/MeV;
|
||||
pt = max( 1.0, sqrt( px*px + py*py ) )/GeV;
|
||||
pt = G4std::max( 1.0, sqrt( px*px + py*py ) )/GeV;
|
||||
if( vec[l]->GetSide() > 0 )
|
||||
{
|
||||
forwardKinetic += vec[l]->GetKineticEnergy()/GeV;
|
||||
@@ -631,8 +631,8 @@
|
||||
ran = G4UniformRand()*dndl[19];
|
||||
l = 1;
|
||||
while( (ran>dndl[l]) && (l<20) )l++;
|
||||
l = min( 19, l );
|
||||
x = min( 1.0, pt*(binl[l-1] + G4UniformRand()*(binl[l]-binl[l-1])/2.) );
|
||||
l = G4std::min( 19, l );
|
||||
x = G4std::min( 1.0, pt*(binl[l-1] + G4UniformRand()*(binl[l]-binl[l-1])/2.) );
|
||||
currentParticle.SetMomentum( x*et*GeV ); // set the z-momentum
|
||||
if( forwardEnergy < forwardKinetic )
|
||||
totalEnergy = vecMass + 0.04*fabs(normal());
|
||||
@@ -670,7 +670,7 @@
|
||||
vecMass = targetParticle.GetMass()/GeV;
|
||||
ran = -log(1.0-G4UniformRand());
|
||||
aspar = 0.40;
|
||||
pt = max( 0.001, sqrt( pow( ran/4.0, 1.2 ) ) );
|
||||
pt = G4std::max( 0.001, sqrt( pow( ran/4.0, 1.2 ) ) );
|
||||
targetParticle.SetMomentum( pt*cos(phi)*GeV, pt*sin(phi)*GeV );
|
||||
for( G4int j=0; j<20; ++j )binl[j] = (j-1.)/(19.*pt);
|
||||
et = pseudoParticle[1].GetTotalEnergy()/GeV;
|
||||
@@ -696,8 +696,8 @@
|
||||
l = 1;
|
||||
ran = G4UniformRand()*dndl[19];
|
||||
while( ( ran >= dndl[l] ) && ( l < 20 ) )l++;
|
||||
l = min( 19, l );
|
||||
x = min( 1.0, pt*(binl[l-1] + G4UniformRand()*(binl[l]-binl[l-1])/2.) );
|
||||
l = G4std::min( 19, l );
|
||||
x = G4std::min( 1.0, pt*(binl[l-1] + G4UniformRand()*(binl[l]-binl[l-1])/2.) );
|
||||
if( targetParticle.GetSide() < 0 )x *= -1.;
|
||||
targetParticle.SetMomentum( x*et*GeV ); // set the z-momentum
|
||||
totalEnergy = sqrt( x*et*x*et + pt*pt + vecMass*vecMass );
|
||||
@@ -786,7 +786,7 @@
|
||||
{
|
||||
G4double tempMass = vec[l]->GetMass()/GeV;
|
||||
totalEnergy =
|
||||
max( tempMass, 0.95*vec[l]->GetTotalEnergy()/GeV + 0.05*tempMass );
|
||||
G4std::max( tempMass, 0.95*vec[l]->GetTotalEnergy()/GeV + 0.05*tempMass );
|
||||
vec[l]->SetTotalEnergy( totalEnergy*GeV );
|
||||
pp = sqrt( abs( totalEnergy*totalEnergy - tempMass*tempMass ) )*GeV;
|
||||
pp1 = vec[l]->GetMomentum().mag()/MeV;
|
||||
@@ -802,7 +802,7 @@
|
||||
else
|
||||
vec[l]->SetMomentum( vec[l]->GetMomentum() * (pp/pp1) );
|
||||
|
||||
pt = max( 0.001*GeV, sqrt( sqr(vec[l]->GetMomentum().x()/MeV) +
|
||||
pt = G4std::max( 0.001*GeV, sqrt( sqr(vec[l]->GetMomentum().x()/MeV) +
|
||||
sqr(vec[l]->GetMomentum().y()/MeV) ) )/GeV;
|
||||
if( vec[l]->GetSide() > 0)
|
||||
{
|
||||
@@ -818,7 +818,7 @@
|
||||
} // closes outer loop
|
||||
if( eliminateThisParticle ) // not enough energy, eliminate target
|
||||
{
|
||||
G4cerr << "eliminating target particle" << endl;
|
||||
G4cerr << "eliminating target particle" << G4endl;
|
||||
exit( EXIT_FAILURE );
|
||||
}
|
||||
}
|
||||
@@ -832,7 +832,7 @@
|
||||
if( backwardNucleonCount == 1 ) // target particle is the only backward nucleon
|
||||
{
|
||||
G4double ekin =
|
||||
min( backwardEnergy-backwardKinetic, centerofmassEnergy/2.0-protonMass/GeV );
|
||||
G4std::min( backwardEnergy-backwardKinetic, centerofmassEnergy/2.0-protonMass/GeV );
|
||||
if( ekin < 0.04 )ekin = 0.04 * fabs( normal() );
|
||||
vecMass = targetParticle.GetMass()/GeV;
|
||||
totalEnergy = ekin+vecMass;
|
||||
@@ -857,7 +857,7 @@
|
||||
const G4double cpar[] = { 0.6, 0.6, 0.35, 0.15, 0.10 };
|
||||
const G4double gpar[] = { 2.6, 2.6, 1.80, 1.30, 1.20 };
|
||||
// Replaced the following min function to get correct behaviour on DEC.
|
||||
// G4int tempCount = min( 5, backwardNucleonCount ) - 1;
|
||||
// G4int tempCount = G4std::min( 5, backwardNucleonCount ) - 1;
|
||||
G4int tempCount;
|
||||
if (backwardNucleonCount < 5)
|
||||
{
|
||||
@@ -868,8 +868,8 @@
|
||||
tempCount = 5;
|
||||
}
|
||||
tempCount--;
|
||||
//cout << "backwardNucleonCount " << backwardNucleonCount << endl;
|
||||
//cout << "tempCount " << tempCount << endl;
|
||||
//cout << "backwardNucleonCount " << backwardNucleonCount << G4endl;
|
||||
//cout << "tempCount " << tempCount << G4endl;
|
||||
G4double rmb0 = 0.0;
|
||||
if( targetParticle.GetSide() == -3 )
|
||||
rmb0 += targetParticle.GetMass()/GeV;
|
||||
@@ -879,7 +879,7 @@
|
||||
}
|
||||
rmb = rmb0 + pow(-log(1.0-G4UniformRand()),cpar[tempCount]) / gpar[tempCount];
|
||||
totalEnergy = pseudoParticle[6].GetTotalEnergy()/GeV;
|
||||
vecMass = min( rmb, totalEnergy );
|
||||
vecMass = G4std::min( rmb, totalEnergy );
|
||||
pseudoParticle[6].SetMass( vecMass*GeV );
|
||||
pp = sqrt( abs( totalEnergy*totalEnergy - vecMass*vecMass ) )*GeV;
|
||||
pp1 = pseudoParticle[6].GetMomentum().mag()/MeV;
|
||||
@@ -905,13 +905,13 @@
|
||||
}
|
||||
if( tempLen != backwardNucleonCount )
|
||||
{
|
||||
G4cerr << "tempLen is not the same as backwardNucleonCount" << endl;
|
||||
G4cerr << "tempLen is not the same as backwardNucleonCount" << G4endl;
|
||||
G4cerr << "tempLen = " << tempLen;
|
||||
G4cerr << ", backwardNucleonCount = " << backwardNucleonCount << endl;
|
||||
G4cerr << "targetParticle side = " << targetParticle.GetSide() << endl;
|
||||
G4cerr << "currentParticle side = " << currentParticle.GetSide() << endl;
|
||||
G4cerr << ", backwardNucleonCount = " << backwardNucleonCount << G4endl;
|
||||
G4cerr << "targetParticle side = " << targetParticle.GetSide() << G4endl;
|
||||
G4cerr << "currentParticle side = " << currentParticle.GetSide() << G4endl;
|
||||
for( i=0; i<vecLen; ++i )
|
||||
G4cerr << "particle #" << i << " side = " << vec[i]->GetSide() << endl;
|
||||
G4cerr << "particle #" << i << " side = " << vec[i]->GetSide() << G4endl;
|
||||
exit( EXIT_FAILURE );
|
||||
}
|
||||
constantCrossSection = true;
|
||||
@@ -962,7 +962,7 @@
|
||||
vec[i]->Lorentz( *vec[i], pseudoParticle[1] );
|
||||
}
|
||||
// DEBUGGING --> DumpFrames::DumpFrame(vec, vecLen);
|
||||
numberofFinalStateNucleons = max( 1, numberofFinalStateNucleons );
|
||||
numberofFinalStateNucleons = G4std::max( 1, numberofFinalStateNucleons );
|
||||
//
|
||||
// leadFlag will be true
|
||||
// iff original particle is at least as heavy as K+ and not a proton or neutron AND
|
||||
@@ -1177,18 +1177,18 @@
|
||||
const G4double kineticFactor = -0.010;
|
||||
G4double sprob = 0.0; // sprob = probability of self-absorption in heavy molecules
|
||||
const G4double ekIncident = originalIncident->GetKineticEnergy()/GeV;
|
||||
if( ekIncident >= 5.0 )sprob = min( 1.0, 0.6*log(ekIncident-4.0) );
|
||||
if( ekIncident >= 5.0 )sprob = G4std::min( 1.0, 0.6*log(ekIncident-4.0) );
|
||||
if( epnb >= pnCutOff )
|
||||
{
|
||||
npnb = Poisson((1.5+1.25*numberofFinalStateNucleons)*epnb/(epnb+edta));
|
||||
if( numberofFinalStateNucleons + npnb > atomicWeight )
|
||||
npnb = G4int(atomicWeight+0.00001 - numberofFinalStateNucleons);
|
||||
npnb = min( npnb, 127-vecLen );
|
||||
npnb = G4std::min( npnb, 127-vecLen );
|
||||
}
|
||||
if( edta >= dtaCutOff )
|
||||
{
|
||||
ndta = Poisson( (1.5+1.25*numberofFinalStateNucleons)*edta/(epnb+edta) );
|
||||
ndta = min( ndta, 127-vecLen );
|
||||
ndta = G4std::min( ndta, 127-vecLen );
|
||||
}
|
||||
G4double spall = numberofFinalStateNucleons;
|
||||
// DEBUGGING --> DumpFrames::DumpFrame(vec, vecLen);
|
||||
@@ -1388,7 +1388,7 @@
|
||||
G4double extraNucleonMass = 0.0;
|
||||
if( nuclearExcitationCount > 0 )
|
||||
{
|
||||
G4int momentumBin = min( 4, G4int(pOriginal/3.0) );
|
||||
G4int momentumBin = G4std::min( 4, G4int(pOriginal/3.0) );
|
||||
const G4double nucsup[] = { 1.0, 0.8, 0.6, 0.5, 0.4 };
|
||||
//
|
||||
// NOTE: in TWOCLU, these new particles were given negative codes
|
||||
@@ -1537,15 +1537,15 @@
|
||||
if( forwardCount == 1 )rmc = forwardMass;
|
||||
else
|
||||
{
|
||||
// G4int ntc = min(5,forwardCount); // check if offset by 1 @@
|
||||
G4int ntc = max(1, min(5,forwardCount)); // check if offset by 1 @@
|
||||
// G4int ntc = G4std::min(5,forwardCount); // check if offset by 1 @@
|
||||
G4int ntc = G4std::max(1, G4std::min(5,forwardCount)); // check if offset by 1 @@
|
||||
rmc = forwardMass + pow(-log(1.0-G4UniformRand()),cpar[ntc-1])/gpar[ntc-1];
|
||||
}
|
||||
if( backwardCount == 1 )rmd = backwardMass;
|
||||
else
|
||||
{
|
||||
// G4int ntc = min(5,backwardCount); // check, if offfset by 1 @@
|
||||
G4int ntc = max(1, min(5,backwardCount)); // check, if offfset by 1 @@
|
||||
// G4int ntc = G4std::min(5,backwardCount); // check, if offfset by 1 @@
|
||||
G4int ntc = G4std::max(1, G4std::min(5,backwardCount)); // check, if offfset by 1 @@
|
||||
rmd = backwardMass + pow(-log(1.0-G4UniformRand()),cpar[ntc-1])/gpar[ntc-1];
|
||||
}
|
||||
while( rmc+rmd > centerofmassEnergy )
|
||||
@@ -1568,7 +1568,7 @@
|
||||
//else if( nuclearExcitationCount == 1 )rme = extraMass;
|
||||
//else
|
||||
//{
|
||||
// G4int ntc = min(5,nuclearExcitationCount)-1;
|
||||
// G4int ntc = G4std::min(5,nuclearExcitationCount)-1;
|
||||
// rme = extraMass + pow(-log(1.-G4UniformRand()),cpar[ntc])/gpar[ntc];
|
||||
//}
|
||||
//
|
||||
@@ -1595,7 +1595,7 @@
|
||||
G4double pf = (centerofmassEnergy*centerofmassEnergy+rmd*rmd-rmc*rmc);
|
||||
pf *= pf;
|
||||
pf -= 4*centerofmassEnergy*centerofmassEnergy*rmd*rmd;
|
||||
pf = sqrt( max(pf,pfMin) )/(2.0*centerofmassEnergy);
|
||||
pf = sqrt( G4std::max(pf,pfMin) )/(2.0*centerofmassEnergy);
|
||||
//
|
||||
// set final state masses and energies in centre of mass system
|
||||
//
|
||||
@@ -1610,7 +1610,7 @@
|
||||
const G4double bMin = 0.01;
|
||||
const G4double b1 = 4.0;
|
||||
const G4double b2 = 1.6;
|
||||
G4double t = log( 1.0-G4UniformRand() ) / max( bMin, b1+b2*log(pOriginal) );
|
||||
G4double t = log( 1.0-G4UniformRand() ) / G4std::max( bMin, b1+b2*log(pOriginal) );
|
||||
G4double t1 =
|
||||
pseudoParticle[1].GetTotalEnergy()/GeV - pseudoParticle[3].GetTotalEnergy()/GeV;
|
||||
G4double pin = pseudoParticle[1].GetMomentum().mag()/GeV;
|
||||
@@ -1621,8 +1621,8 @@
|
||||
const G4double smallValue = 1.0e-10;
|
||||
G4double dumnve = 4.0*pin*pf;
|
||||
if( dumnve == 0.0 )dumnve = smallValue;
|
||||
G4double ctet = max( -1.0, min( 1.0, 1.0+2.0*(t-tacmin)/dumnve ) );
|
||||
dumnve = max( 0.0, 1.0-ctet*ctet );
|
||||
G4double ctet = G4std::max( -1.0, G4std::min( 1.0, 1.0+2.0*(t-tacmin)/dumnve ) );
|
||||
dumnve = G4std::max( 0.0, 1.0-ctet*ctet );
|
||||
G4double stet = sqrt(dumnve);
|
||||
G4double phi = G4UniformRand() * twopi;
|
||||
//
|
||||
@@ -1657,8 +1657,8 @@
|
||||
G4double vMass = vec[i]->GetMass()/MeV;
|
||||
G4double totalE = kineticE + vMass;
|
||||
pp = sqrt( abs(totalE*totalE-vMass*vMass) );
|
||||
G4double cost = min( 1.0, max( -1.0, log(2.23*G4UniformRand()+0.383)/0.96 ) );
|
||||
G4double sint = sqrt( max( 0.0, (1.0-cost*cost) ) );
|
||||
G4double cost = G4std::min( 1.0, G4std::max( -1.0, log(2.23*G4UniformRand()+0.383)/0.96 ) );
|
||||
G4double sint = sqrt( G4std::max( 0.0, (1.0-cost*cost) ) );
|
||||
phi = twopi*G4UniformRand();
|
||||
vec[i]->SetMomentum( pp*sint*sin(phi)*MeV,
|
||||
pp*sint*cos(phi)*MeV,
|
||||
@@ -1779,7 +1779,7 @@
|
||||
vec[i]->Lorentz( *vec[i], pseudoParticle[2] );
|
||||
}
|
||||
// DEBUGGING --> DumpFrames::DumpFrame(vec, vecLen);
|
||||
numberofFinalStateNucleons = max( 1, numberofFinalStateNucleons );
|
||||
numberofFinalStateNucleons = G4std::max( 1, numberofFinalStateNucleons );
|
||||
//
|
||||
// sometimes the leading strange particle is lost, set it back
|
||||
//
|
||||
@@ -2000,19 +2000,19 @@
|
||||
|
||||
G4double sprob = 0.0; // sprob = probability of self-absorption in heavy molecules
|
||||
const G4double ekIncident = originalIncident->GetKineticEnergy()/GeV;
|
||||
if( ekIncident >= 5.0 )sprob = min( 1.0, 0.6*log(ekIncident-4.0) );
|
||||
if( ekIncident >= 5.0 )sprob = G4std::min( 1.0, 0.6*log(ekIncident-4.0) );
|
||||
|
||||
if( epnb >= pnCutOff )
|
||||
{
|
||||
npnb = Poisson((1.5+1.25*numberofFinalStateNucleons)*epnb/(epnb+edta));
|
||||
if( numberofFinalStateNucleons + npnb > atomicWeight )
|
||||
npnb = G4int(atomicWeight - numberofFinalStateNucleons);
|
||||
npnb = min( npnb, 127-vecLen );
|
||||
npnb = G4std::min( npnb, 127-vecLen );
|
||||
}
|
||||
if( edta >= dtaCutOff )
|
||||
{
|
||||
ndta = Poisson( (1.5+1.25*numberofFinalStateNucleons)*edta/(epnb+edta) );
|
||||
ndta = min( ndta, 127-vecLen );
|
||||
ndta = G4std::min( ndta, 127-vecLen );
|
||||
}
|
||||
G4double spall = numberofFinalStateNucleons;
|
||||
// DEBUGGING --> DumpFrames::DumpFrame(vec, vecLen);
|
||||
@@ -2181,11 +2181,11 @@
|
||||
//
|
||||
// Calculate slope b for elastic scattering on proton/neutron
|
||||
//
|
||||
G4double b = max( cb, b1+b2*log(pOriginal) );
|
||||
G4double b = G4std::max( cb, b1+b2*log(pOriginal) );
|
||||
G4double btrang = b * 4.0 * pf * pseudoParticle[0].GetMomentum().mag()/GeV;
|
||||
|
||||
G4double exindt = -1.0;
|
||||
exindt += exp(max(-btrang,expxl));
|
||||
exindt += exp(G4std::max(-btrang,expxl));
|
||||
//
|
||||
// Calculate sqr(sin(teta/2.) and cos(teta), set azimuth angle phi
|
||||
//
|
||||
@@ -2231,7 +2231,7 @@
|
||||
if( pp1 >= 1.0 )
|
||||
{
|
||||
ekin = currentParticle.GetKineticEnergy()/MeV - cfa*(1.0+0.5*normal())*GeV;
|
||||
ekin = max( 0.0001*GeV, ekin );
|
||||
ekin = G4std::max( 0.0001*GeV, ekin );
|
||||
currentParticle.SetKineticEnergy( ekin*MeV );
|
||||
pp = currentParticle.GetTotalMomentum()/MeV;
|
||||
currentParticle.SetMomentum( currentParticle.GetMomentum() * (pp/pp1) );
|
||||
@@ -2240,7 +2240,7 @@
|
||||
if( pp1 >= 1.0 )
|
||||
{
|
||||
ekin = targetParticle.GetKineticEnergy()/MeV - cfa*(1.0+normal()/2.)*GeV;
|
||||
ekin = max( 0.0001*GeV, ekin );
|
||||
ekin = G4std::max( 0.0001*GeV, ekin );
|
||||
targetParticle.SetKineticEnergy( ekin*MeV );
|
||||
pp = targetParticle.GetTotalMomentum()/MeV;
|
||||
targetParticle.SetMomentum( targetParticle.GetMomentum() * (pp/pp1) );
|
||||
@@ -2275,12 +2275,12 @@
|
||||
npnb = Poisson( epnb/0.02 );
|
||||
if( npnb > atomicWeight )npnb = G4int(atomicWeight);
|
||||
if( (epnb > pnCutOff) && (npnb <= 0) )npnb = 1;
|
||||
npnb = min( npnb, 127-vecLen );
|
||||
npnb = G4std::min( npnb, 127-vecLen );
|
||||
}
|
||||
if( edta >= dtaCutOff )
|
||||
{
|
||||
ndta = G4int(2.0 * log(atomicWeight));
|
||||
ndta = min( ndta, 127-vecLen );
|
||||
ndta = G4std::min( ndta, 127-vecLen );
|
||||
}
|
||||
G4double spall = 0.0;
|
||||
// DEBUGGING --> DumpFrames::DumpFrame(vec, vecLen);
|
||||
@@ -2314,9 +2314,9 @@
|
||||
const G4double expxl = -expxu; // lower bound for arg. of exp
|
||||
if( vecLen < 2 )
|
||||
{
|
||||
G4cerr << "*** Error in G4ReactionDynamics::GenerateNBodyEvent" << endl;
|
||||
G4cerr << " number of particles < 2" << endl;
|
||||
G4cerr << "totalEnergy = " << totalEnergy << "MeV, vecLen = " << vecLen << endl;
|
||||
G4cerr << "*** Error in G4ReactionDynamics::GenerateNBodyEvent" << G4endl;
|
||||
G4cerr << " number of particles < 2" << G4endl;
|
||||
G4cerr << "totalEnergy = " << totalEnergy << "MeV, vecLen = " << vecLen << G4endl;
|
||||
return -1.0;
|
||||
}
|
||||
G4double mass[18]; // mass of each particle
|
||||
@@ -2346,9 +2346,9 @@
|
||||
G4double totalE = totalEnergy/GeV;
|
||||
if( totalMass > totalE )
|
||||
{
|
||||
//G4cerr << "*** Error in G4ReactionDynamics::GenerateNBodyEvent" << endl;
|
||||
//G4cerr << "*** Error in G4ReactionDynamics::GenerateNBodyEvent" << G4endl;
|
||||
//G4cerr << " total mass (" << totalMass*GeV << "MeV) > total energy ("
|
||||
// << totalEnergy << "MeV)" << endl;
|
||||
// << totalEnergy << "MeV)" << G4endl;
|
||||
totalE = totalMass;
|
||||
//delete [] mass;
|
||||
//delete [] energy;
|
||||
@@ -2440,7 +2440,7 @@
|
||||
wtmax += log( pd[i] );
|
||||
}
|
||||
G4double weight = 0.0; // weight is returned by GenerateNBodyEvent
|
||||
if( lzero )weight = exp( max(min(wtmax,expxu),expxl) );
|
||||
if( lzero )weight = exp( G4std::max(G4std::min(wtmax,expxu),expxl) );
|
||||
|
||||
G4double bang, cb, sb, s0, s1, s2, c, s, esys, a, b, gama, beta;
|
||||
pcm[0][0] = 0.0;
|
||||
@@ -2522,7 +2522,7 @@
|
||||
G4double ran;
|
||||
|
||||
if( x > 9.9 ) // use normal distribution with sigma^2 = <x>
|
||||
iran = max( 0.0, x+normal()*sqrt(x) );
|
||||
iran = G4std::max( 0.0, x+normal()*sqrt(x) );
|
||||
else {
|
||||
G4int mm = G4int(5.0*x);
|
||||
if( mm <= 0 ) // for very small x try iran=1,2,3
|
||||
@@ -2568,7 +2568,7 @@
|
||||
G4int
|
||||
G4ReactionDynamics::Factorial( G4int n )
|
||||
{ // calculates factorial( n ) = n*(n-1)*(n-2)*...*1
|
||||
G4int m = min(n,10);
|
||||
G4int m = G4std::min(n,10);
|
||||
G4int result = 1;
|
||||
if( m <= 1 )return result;
|
||||
for( G4int i=2; i<=m; ++i )result *= i;
|
||||
@@ -2770,7 +2770,7 @@
|
||||
}
|
||||
const G4double cfa = 0.025*((atomicWeight-1.)/120.)*exp(-(atomicWeight-1.)/120.);
|
||||
ekin = currentParticle.GetKineticEnergy()/GeV - cfa*(1+normal()/2.0);
|
||||
ekin = max( 1.0e-6, ekin );
|
||||
ekin = G4std::max( 1.0e-6, ekin );
|
||||
xxh = 1.0;
|
||||
if( ( (modifiedOriginal.GetDefinition() == aPiPlus) ||
|
||||
(modifiedOriginal.GetDefinition() == aPiMinus) ) &&
|
||||
@@ -2799,7 +2799,7 @@
|
||||
else
|
||||
currentParticle.SetMomentum( currentParticle.GetMomentum() * (pp/pp1) );
|
||||
ekin = targetParticle.GetKineticEnergy()/GeV - cfa*(1+normal()/2.0);
|
||||
ekin = max( 1.0e-6, ekin );
|
||||
ekin = G4std::max( 1.0e-6, ekin );
|
||||
xxh = 1.0;
|
||||
if( ( (modifiedOriginal.GetDefinition() == aPiPlus) ||
|
||||
(modifiedOriginal.GetDefinition() == aPiMinus) ) &&
|
||||
@@ -2830,7 +2830,7 @@
|
||||
for( i=0; i<vecLen; ++i )
|
||||
{
|
||||
ekin = vec[i]->GetKineticEnergy()/GeV - cfa*(1+normal()/2.0);
|
||||
ekin = max( 1.0e-6, ekin );
|
||||
ekin = G4std::max( 1.0e-6, ekin );
|
||||
xxh = 1.0;
|
||||
if( ( (modifiedOriginal.GetDefinition() == aPiPlus) ||
|
||||
(modifiedOriginal.GetDefinition() == aPiMinus) ) &&
|
||||
@@ -2871,7 +2871,7 @@
|
||||
(currentParticle.GetDefinition() == aPiMinus) )
|
||||
{
|
||||
currentParticle.SetKineticEnergy(
|
||||
max( 0.001*MeV, dekin*currentParticle.GetKineticEnergy() ) );
|
||||
G4std::max( 0.001*MeV, dekin*currentParticle.GetKineticEnergy() ) );
|
||||
pp = currentParticle.GetTotalMomentum()/MeV;
|
||||
pp1 = currentParticle.GetMomentum().mag()/MeV;
|
||||
if( pp1 < 0.001 )
|
||||
@@ -2890,7 +2890,7 @@
|
||||
(targetParticle.GetDefinition() == aPiMinus) )
|
||||
{
|
||||
targetParticle.SetKineticEnergy(
|
||||
max( 0.001*MeV, dekin*targetParticle.GetKineticEnergy() ) );
|
||||
G4std::max( 0.001*MeV, dekin*targetParticle.GetKineticEnergy() ) );
|
||||
pp = targetParticle.GetTotalMomentum()/MeV;
|
||||
pp1 = targetParticle.GetMomentum().mag()/MeV;
|
||||
if( pp1 < 0.001 )
|
||||
@@ -2910,7 +2910,7 @@
|
||||
(vec[i]->GetDefinition() == aPiZero) ||
|
||||
(vec[i]->GetDefinition() == aPiMinus) )
|
||||
{
|
||||
vec[i]->SetKineticEnergy( max( 0.001*MeV, dekin*vec[i]->GetKineticEnergy() ) );
|
||||
vec[i]->SetKineticEnergy( G4std::max( 0.001*MeV, dekin*vec[i]->GetKineticEnergy() ) );
|
||||
pp = vec[i]->GetTotalMomentum()/MeV;
|
||||
pp1 = vec[i]->GetMomentum().mag()/MeV;
|
||||
if( pp1 < 0.001 )
|
||||
@@ -2990,7 +2990,7 @@
|
||||
if( kinetic < 0.0 )kinetic = -0.010*log(ran);
|
||||
backwardKinetic += kinetic;
|
||||
if( backwardKinetic > epnb )
|
||||
kinetic = max( kineticMinimum, epnb-(backwardKinetic-kinetic) );
|
||||
kinetic = G4std::max( kineticMinimum, epnb-(backwardKinetic-kinetic) );
|
||||
if( G4UniformRand() > (1.0-atomicNumber/atomicWeight) )
|
||||
p1->SetDefinition( aProton );
|
||||
else
|
||||
@@ -3013,7 +3013,7 @@
|
||||
G4double ekw = ekOriginal/GeV;
|
||||
G4int ika, kk = 0;
|
||||
if( ekw > 1.0 )ekw *= ekw;
|
||||
ekw = max( 0.1, ekw );
|
||||
ekw = G4std::max( 0.1, ekw );
|
||||
ika = G4int(ika1*exp((atomicNumber*atomicNumber/atomicWeight-ika2)/ika3)/ekw);
|
||||
if( ika > 0 )
|
||||
{
|
||||
@@ -3053,7 +3053,7 @@
|
||||
if( backwardKinetic > edta )kinetic = edta-(backwardKinetic-kinetic);
|
||||
if( kinetic < 0.0 )kinetic = kineticMinimum;
|
||||
G4double cost = 2.0*G4UniformRand() - 1.0;
|
||||
G4double sint = sqrt(max(0.0,(1.0-cost*cost)));
|
||||
G4double sint = sqrt(G4std::max(0.0,(1.0-cost*cost)));
|
||||
G4double phi = twopi*G4UniformRand();
|
||||
ran = G4UniformRand();
|
||||
if( ran <= 0.60 )
|
||||
@@ -3471,7 +3471,7 @@
|
||||
energyCheck -= vec[i]->GetMass()/GeV;
|
||||
if( energyCheck < 0.0 ) // chop off the secondary List
|
||||
{
|
||||
vecLen = max( 0, --i ); // looks like a memory leak @@@@@@@@@@@@
|
||||
vecLen = G4std::max( 0, --i ); // looks like a memory leak @@@@@@@@@@@@
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -3516,7 +3516,7 @@
|
||||
if( pp <= 0.001*MeV )
|
||||
{
|
||||
G4double phinve = twopi*G4UniformRand();
|
||||
G4double rthnve = acos( max( -1.0, min( 1.0, -1.0 + 2.0*G4UniformRand() ) ) );
|
||||
G4double rthnve = acos( G4std::max( -1.0, G4std::min( 1.0, -1.0 + 2.0*G4UniformRand() ) ) );
|
||||
currentParticle.SetMomentum( p*sin(rthnve)*cos(phinve),
|
||||
p*sin(rthnve)*sin(phinve),
|
||||
p*cos(rthnve) );
|
||||
@@ -3576,7 +3576,7 @@
|
||||
|
||||
G4double ke = currentParticle.GetKineticEnergy()/GeV;
|
||||
G4int nt = 2;
|
||||
if( (index>=6) || (G4UniformRand()<min(0.5,ke*10.0)) )nt = 3;
|
||||
if( (index>=6) || (G4UniformRand()<G4std::min(0.5,ke*10.0)) )nt = 3;
|
||||
|
||||
G4ReactionProduct *v = new G4ReactionProduct [3];
|
||||
v[0].SetMass( mass[index]*MeV );
|
||||
@@ -3670,13 +3670,13 @@
|
||||
particleIsDefined = true;
|
||||
}
|
||||
currentParticle.SetKineticEnergy(
|
||||
max( 0.001, currentParticle.GetKineticEnergy()/MeV ) );
|
||||
G4std::max( 0.001, currentParticle.GetKineticEnergy()/MeV ) );
|
||||
p = currentParticle.GetTotalMomentum();
|
||||
pp = currentParticle.GetMomentum().mag();
|
||||
if( pp <= 0.001*MeV )
|
||||
{
|
||||
G4double phinve = twopi*G4UniformRand();
|
||||
G4double rthnve = acos( max( -1.0, min( 1.0, -1.0 + 2.0*G4UniformRand() ) ) );
|
||||
G4double rthnve = acos( G4std::max( -1.0, G4std::min( 1.0, -1.0 + 2.0*G4UniformRand() ) ) );
|
||||
currentParticle.SetMomentum( p*sin(rthnve)*cos(phinve),
|
||||
p*sin(rthnve)*sin(phinve),
|
||||
p*cos(rthnve) );
|
||||
@@ -3687,13 +3687,13 @@
|
||||
if( particleIsDefined )
|
||||
{
|
||||
v[0].SetKineticEnergy(
|
||||
max( 0.001, 0.5*G4UniformRand()*v[0].GetKineticEnergy()/MeV ) );
|
||||
G4std::max( 0.001, 0.5*G4UniformRand()*v[0].GetKineticEnergy()/MeV ) );
|
||||
p = v[0].GetTotalMomentum();
|
||||
pp = v[0].GetMomentum().mag();
|
||||
if( pp <= 0.001*MeV )
|
||||
{
|
||||
G4double phinve = twopi*G4UniformRand();
|
||||
G4double rthnve = acos( max(-1.0,min(1.0,-1.0+2.0*G4UniformRand())) );
|
||||
G4double rthnve = acos( G4std::max(-1.0,G4std::min(1.0,-1.0+2.0*G4UniformRand())) );
|
||||
v[0].SetMomentum( p*sin(rthnve)*cos(phinve),
|
||||
p*sin(rthnve)*sin(phinve),
|
||||
p*cos(rthnve) );
|
||||
@@ -3705,16 +3705,16 @@
|
||||
(v[1].GetDefinition() == aTriton) ||
|
||||
(v[1].GetDefinition() == anAlpha) )
|
||||
v[1].SetKineticEnergy(
|
||||
max( 0.001, 0.5*G4UniformRand()*v[1].GetKineticEnergy()/MeV ) );
|
||||
G4std::max( 0.001, 0.5*G4UniformRand()*v[1].GetKineticEnergy()/MeV ) );
|
||||
else
|
||||
v[1].SetKineticEnergy( max( 0.001, v[1].GetKineticEnergy()/MeV ) );
|
||||
v[1].SetKineticEnergy( G4std::max( 0.001, v[1].GetKineticEnergy()/MeV ) );
|
||||
|
||||
p = v[1].GetTotalMomentum();
|
||||
pp = v[1].GetMomentum().mag();
|
||||
if( pp <= 0.001*MeV )
|
||||
{
|
||||
G4double phinve = twopi*G4UniformRand();
|
||||
G4double rthnve = acos( max(-1.0,min(1.0,-1.0+2.0*G4UniformRand())) );
|
||||
G4double rthnve = acos( G4std::max(-1.0,G4std::min(1.0,-1.0+2.0*G4UniformRand())) );
|
||||
v[1].SetMomentum( p*sin(rthnve)*cos(phinve),
|
||||
p*sin(rthnve)*sin(phinve),
|
||||
p*cos(rthnve) );
|
||||
@@ -3728,16 +3728,16 @@
|
||||
(v[2].GetDefinition() == aTriton) ||
|
||||
(v[2].GetDefinition() == anAlpha) )
|
||||
v[2].SetKineticEnergy(
|
||||
max( 0.001, 0.5*G4UniformRand()*v[2].GetKineticEnergy()/MeV ) );
|
||||
G4std::max( 0.001, 0.5*G4UniformRand()*v[2].GetKineticEnergy()/MeV ) );
|
||||
else
|
||||
v[2].SetKineticEnergy( max( 0.001, v[2].GetKineticEnergy()/MeV ) );
|
||||
v[2].SetKineticEnergy( G4std::max( 0.001, v[2].GetKineticEnergy()/MeV ) );
|
||||
|
||||
p = v[2].GetTotalMomentum();
|
||||
pp = v[2].GetMomentum().mag();
|
||||
if( pp <= 0.001*MeV )
|
||||
{
|
||||
G4double phinve = twopi*G4UniformRand();
|
||||
G4double rthnve = acos( max(-1.0,min(1.0,-1.0+2.0*G4UniformRand())) );
|
||||
G4double rthnve = acos( G4std::max(-1.0,G4std::min(1.0,-1.0+2.0*G4UniformRand())) );
|
||||
v[2].SetMomentum( p*sin(rthnve)*cos(phinve),
|
||||
p*sin(rthnve)*sin(phinve),
|
||||
p*cos(rthnve) );
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4ReactionKinematics.cc,v 1.1.10.1 1999/12/07 20:52:46 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
// GEANT4 tag $Name: geant4-01-01 $
|
||||
//
|
||||
// CERN Geneva Switzerland
|
||||
//
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4ReactionProduct.cc,v 1.1.10.1 1999/12/07 20:52:46 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
// GEANT4 tag $Name: geant4-01-01 $
|
||||
//
|
||||
// J.L. Chuma, TRIUMF, 31-Oct-1996
|
||||
// last modified: 19-Dec-1996
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4StableIsotopes.cc,v 1.1.10.1 1999/12/07 20:52:47 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
// GEANT4 tag $Name: geant4-01-01 $
|
||||
//
|
||||
#include "G4StableIsotopes.hh"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user