Import Geant4 10.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-10 11:51:14 +02:00
parent e2d2f9810a
commit 286caacf06
12421 changed files with 730077 additions and 502383 deletions
@@ -37,21 +37,77 @@
#include "Randomize.hh"
G4QMDCollision::G4QMDCollision()
: deltar ( 4 )
, bcmax0 ( 1.323142 ) // NN maximum impact parameter
, bcmax1 ( 2.523 ) // others maximum impact parameter
, sig0 ( 55 ) // NN cross section
: fdeltar ( 4.0 )
, fbcmax0 ( 1.323142 ) // NN maximum impact parameter
, fbcmax1 ( 2.523 ) // others maximum impact parameter
// , sig0 ( 55 ) // NN cross section
//110617 fix for gcc 4.6 compilation warnings
//, sig1 ( 200 ) // others cross section
, epse ( 0.0001 )
, fepse ( 0.0001 )
{
//These two pointers will be set through SetMeanField method
theSystem=NULL;
theMeanField=NULL;
theScatterer = new G4Scatterer();
}
/*
G4QMDCollision::G4QMDCollision( const G4QMDCollision& obj )
: fdeltar ( obj.fdeltar )
, fbcmax0 ( obj.fbcmax0 ) // NN maximum impact parameter
, fbcmax1 ( obj.fbcmax1 ) // others maximum impact parameter
, fepse ( obj.fepse )
{
if ( obj.theSystem != NULL ) {
theSystem = new G4QMDSystem;
*theSystem = *obj.theSystem;
} else {
theSystem = NULL;
}
if ( obj.theMeanField != NULL ) {
theMeanField = new G4QMDMeanField;
*theMeanField = *obj.theMeanField;
} else {
theMeanField = NULL;
}
theScatterer = new G4Scatterer();
*theScatterer = *obj.theScatterer;
}
G4QMDCollision & G4QMDCollision::operator= ( const G4QMDCollision& obj)
{
fdeltar = obj.fdeltar;
fbcmax0 = obj.fbcmax1;
fepse = obj.fepse;
if ( obj.theSystem != NULL ) {
delete theSystem;
theSystem = new G4QMDSystem;
*theSystem = *obj.theSystem;
} else {
theSystem = NULL;
}
if ( obj.theMeanField != NULL ) {
delete theMeanField;
theMeanField = new G4QMDMeanField;
*theMeanField = *obj.theMeanField;
} else {
theMeanField = NULL;
}
delete theScatterer;
theScatterer = new G4Scatterer();
*theScatterer = *obj.theScatterer;
return *this;
}
*/
G4QMDCollision::~G4QMDCollision()
{
//if ( theSystem != NULL ) delete theSystem;
//if ( theMeanField != NULL ) delete theMeanField;
delete theScatterer;
}
@@ -155,10 +211,10 @@ void G4QMDCollision::CalKinematicsOfBinaryCollisions( G4double dt )
// EnergyCheck
G4double efin = theMeanField->GetTotalPotential() + et;
//std::cout << std::abs ( eini - efin ) - epse << std::endl;
// std::cout << std::abs ( eini - efin ) - epse*10 << std::endl;
//std::cout << std::abs ( eini - efin ) - fepse << std::endl;
// std::cout << std::abs ( eini - efin ) - fepse*10 << std::endl;
// *10 TK
if ( std::abs ( eini - efin ) < epse*10 )
if ( std::abs ( eini - efin ) < fepse*10 )
{
// Energy OK
isThisEnergyOK = true;
@@ -272,10 +328,10 @@ void G4QMDCollision::CalKinematicsOfBinaryCollisions( G4double dt )
/*
std::cout << "Collision " << i << " " << theSystem->GetParticipant( i )->IsThisProjectile() << std::endl;
std::cout << "Collision " << j << " " << theSystem->GetParticipant( j )->IsThisProjectile() << std::endl;
std::cout << "Collision " << i << " " << theSystem->GetParticipant( i )->IsThisTarget() << std::endl;
std::cout << "Collision " << j << " " << theSystem->GetParticipant( j )->IsThisTarget() << std::endl;
G4cout << "Collision " << i << " " << theSystem->GetParticipant( i )->IsThisProjectile() << G4endl;
G4cout << "Collision " << j << " " << theSystem->GetParticipant( j )->IsThisProjectile() << G4endl;
G4cout << "Collision " << i << " " << theSystem->GetParticipant( i )->IsThisTarget() << G4endl;
G4cout << "Collision " << j << " " << theSystem->GetParticipant( j )->IsThisTarget() << G4endl;
*/
// Only 1 Collision allowed for each particle in a time step.
@@ -306,7 +362,7 @@ void G4QMDCollision::CalKinematicsOfBinaryCollisions( G4double dt )
G4double rr2 = theMeanField->GetRR2( i , j );
// Here we assume elab (beam momentum less than 5 GeV/n )
if ( rr2 > deltar*deltar ) continue;
if ( rr2 > fdeltar*fdeltar ) continue;
//G4double s = (p4i+p4j)*(p4i+p4j);
//G4double srt = std::sqrt ( s );
@@ -314,7 +370,7 @@ void G4QMDCollision::CalKinematicsOfBinaryCollisions( G4double dt )
G4double srt = std::sqrt( (p4i+p4j)*(p4i+p4j) );
G4double cutoff = 0.0;
G4double bcmax = 0.0;
G4double fbcmax = 0.0;
//110617 fix for gcc 4.6 compilation warnings
//G4double sig = 0.0;
@@ -322,14 +378,14 @@ void G4QMDCollision::CalKinematicsOfBinaryCollisions( G4double dt )
{
// nucleon or pion case
cutoff = rmi + rmj + 0.02;
bcmax = bcmax0;
fbcmax = fbcmax0;
//110617 fix for gcc 4.6 compilation warnings
//sig = sig0;
}
else
{
cutoff = rmi + rmj;
bcmax = bcmax1;
fbcmax = fbcmax1;
//110617 fix for gcc compilation warnings
//sig = sig1;
}
@@ -349,7 +405,7 @@ void G4QMDCollision::CalKinematicsOfBinaryCollisions( G4double dt )
G4double cij = rsq + ( pidr / rmi ) * ( pidr / rmi );
G4double brel = std::sqrt ( std::abs ( cij - bij*bij/aij ) );
if ( brel > bcmax ) continue;
if ( brel > fbcmax ) continue;
//std::cout << "collisions3 " << std::endl;
G4double bji = -pjdr/rmj + pidr * rmj /pij;
@@ -359,18 +415,18 @@ void G4QMDCollision::CalKinematicsOfBinaryCollisions( G4double dt )
/*
std::cout << "collisions4 p4i " << p4i << std::endl;
std::cout << "collisions4 ri " << ri << std::endl;
std::cout << "collisions4 p4j " << p4j << std::endl;
std::cout << "collisions4 rj " << rj << std::endl;
std::cout << "collisions4 dr " << dr << std::endl;
std::cout << "collisions4 pij " << pij << std::endl;
std::cout << "collisions4 aij " << aij << std::endl;
std::cout << "collisions4 bij bji " << bij << " " << bji << std::endl;
std::cout << "collisions4 pidr pjdr " << pidr << " " << pjdr << std::endl;
std::cout << "collisions4 p4i.e() p4j.e() " << p4i.e() << " " << p4j.e() << std::endl;
std::cout << "collisions4 rmi rmj " << rmi << " " << rmj << std::endl;
std::cout << "collisions4 " << ti << " " << tj << std::endl;
G4cout << "collisions4 p4i " << p4i << G4endl;
G4cout << "collisions4 ri " << ri << G4endl;
G4cout << "collisions4 p4j " << p4j << G4endl;
G4cout << "collisions4 rj " << rj << G4endl;
G4cout << "collisions4 dr " << dr << G4endl;
G4cout << "collisions4 pij " << pij << G4endl;
G4cout << "collisions4 aij " << aij << G4endl;
G4cout << "collisions4 bij bji " << bij << " " << bji << G4endl;
G4cout << "collisions4 pidr pjdr " << pidr << " " << pjdr << G4endl;
G4cout << "collisions4 p4i.e() p4j.e() " << p4i.e() << " " << p4j.e() << G4endl;
G4cout << "collisions4 rmi rmj " << rmi << " " << rmj << G4endl;
G4cout << "collisions4 " << ti << " " << tj << G4endl;
*/
if ( std::abs ( ti + tj ) > deltaT ) continue;
//std::cout << "collisions4 " << std::endl;
@@ -408,9 +464,9 @@ void G4QMDCollision::CalKinematicsOfBinaryCollisions( G4double dt )
*/
/*
std::cout << "G4QMDRESULT Collsion initial p4 i and j "
G4cout << "G4QMDRESULT Collsion initial p4 i and j "
<< p4i << " " << p4j
<< std::endl;
<< G4endl;
*/
// 081118
//if ( energetically_forbidden == true || pauli_blocked == true )
@@ -458,28 +514,28 @@ void G4QMDCollision::CalKinematicsOfBinaryCollisions( G4double dt )
theSystem->IncrementCollisionCounter();
/*
std::cout << "G4QMDRESULT Collsion Really Happened between "
G4cout << "G4QMDRESULT Collsion Really Happened between "
<< i << " and " << j
<< std::endl;
std::cout << "G4QMDRESULT Collsion initial p4 i and j "
<< G4endl;
G4cout << "G4QMDRESULT Collsion initial p4 i and j "
<< p4i << " " << p4j
<< std::endl;
std::cout << "G4QMDRESULT Collsion after p4 i and j "
<< G4endl;
G4cout << "G4QMDRESULT Collsion after p4 i and j "
<< theSystem->GetParticipant( i )->Get4Momentum()
<< " "
<< theSystem->GetParticipant( j )->Get4Momentum()
<< std::endl;
std::cout << "G4QMDRESULT Collsion Diff "
<< G4endl;
G4cout << "G4QMDRESULT Collsion Diff "
<< p4i + p4j - theSystem->GetParticipant( i )->Get4Momentum() - theSystem->GetParticipant( j )->Get4Momentum()
<< std::endl;
std::cout << "G4QMDRESULT Collsion initial r i and j "
<< G4endl;
G4cout << "G4QMDRESULT Collsion initial r i and j "
<< ri << " " << rj
<< std::endl;
std::cout << "G4QMDRESULT Collsion after r i and j "
<< G4endl;
G4cout << "G4QMDRESULT Collsion after r i and j "
<< theSystem->GetParticipant( i )->GetPosition()
<< " "
<< theSystem->GetParticipant( j )->GetPosition()
<< std::endl;
<< G4endl;
*/
@@ -620,16 +676,16 @@ G4bool G4QMDCollision::CalFinalStateOfTheBinaryCollision( G4int i , G4int j )
G4double efin = epot + p4ix_new.e() + p4jx_new.e();
//std::cout << "Collision NEW epot " << i << " " << j << " " << epot << " " << std::abs ( eini - efin ) - epse << std::endl;
//std::cout << "Collision NEW epot " << i << " " << j << " " << epot << " " << std::abs ( eini - efin ) - fepse << std::endl;
/*
std::cout << "Collision efin " << i << " " << j << " " << efin << std::endl;
std::cout << "Collision " << i << " " << j << " " << std::abs ( eini - efin ) << " " << epse << std::endl;
std::cout << "Collision " << std::abs ( eini - efin ) << " " << epse << std::endl;
G4cout << "Collision efin " << i << " " << j << " " << efin << G4endl;
G4cout << "Collision " << i << " " << j << " " << std::abs ( eini - efin ) << " " << fepse << G4endl;
G4cout << "Collision " << std::abs ( eini - efin ) << " " << fepse << G4endl;
*/
//071031
if ( std::abs ( eini - efin ) < epse )
if ( std::abs ( eini - efin ) < fepse )
{
// Collison OK
//std::cout << "collisions6" << std::endl;
@@ -788,12 +844,12 @@ G4bool G4QMDCollision::CalFinalStateOfTheBinaryCollisionJQMD( G4double sig , G4d
if( std::abs(c1) > 1.0 ) c1 = 2.0 * x - 1.0;
/*
std::cout << "Collision as " << i << " " << j << " " << as << std::endl;
std::cout << "Collision a " << i << " " << j << " " << a << std::endl;
std::cout << "Collision ta " << i << " " << j << " " << ta << std::endl;
std::cout << "Collision x " << i << " " << j << " " << x << std::endl;
std::cout << "Collision t1 " << i << " " << j << " " << t1 << std::endl;
std::cout << "Collision c1 " << i << " " << j << " " << c1 << std::endl;
G4cout << "Collision as " << i << " " << j << " " << as << G4endl;
G4cout << "Collision a " << i << " " << j << " " << a << G4endl;
G4cout << "Collision ta " << i << " " << j << " " << ta << G4endl;
G4cout << "Collision x " << i << " " << j << " " << x << G4endl;
G4cout << "Collision t1 " << i << " " << j << " " << t1 << G4endl;
G4cout << "Collision c1 " << i << " " << j << " " << c1 << G4endl;
*/
t1 = 2.0*pi*G4UniformRand();
// std::cout << "Collision t1 " << i << " " << j << " " << t1 << std::endl;
@@ -831,9 +887,9 @@ G4bool G4QMDCollision::CalFinalStateOfTheBinaryCollisionJQMD( G4double sig , G4d
G4double etwo = p4i.e() + p4j.e();
/*
std::cout << "Collision epot " << i << " " << j << " " << epot << std::endl;
std::cout << "Collision eini " << i << " " << j << " " << eini << std::endl;
std::cout << "Collision etwo " << i << " " << j << " " << etwo << std::endl;
G4cout << "Collision epot " << i << " " << j << " " << epot << G4endl;
G4cout << "Collision eini " << i << " " << j << " " << eini << G4endl;
G4cout << "Collision etwo " << i << " " << j << " " << etwo << G4endl;
*/
@@ -873,15 +929,15 @@ G4bool G4QMDCollision::CalFinalStateOfTheBinaryCollisionJQMD( G4double sig , G4d
G4double efin = epot + pi_new_e + pj_new_e ;
//std::cout << "Collision NEW epot " << i << " " << j << " " << epot << " " << std::abs ( eini - efin ) - epse << std::endl;
//std::cout << "Collision NEW epot " << i << " " << j << " " << epot << " " << std::abs ( eini - efin ) - fepse << std::endl;
/*
std::cout << "Collision efin " << i << " " << j << " " << efin << std::endl;
std::cout << "Collision " << i << " " << j << " " << std::abs ( eini - efin ) << " " << epse << std::endl;
std::cout << "Collision " << std::abs ( eini - efin ) << " " << epse << std::endl;
G4cout << "Collision efin " << i << " " << j << " " << efin << G4endl;
G4cout << "Collision " << i << " " << j << " " << std::abs ( eini - efin ) << " " << fepse << G4endl;
G4cout << "Collision " << std::abs ( eini - efin ) << " " << fepse << G4endl;
*/
//071031
if ( std::abs ( eini - efin ) < epse )
if ( std::abs ( eini - efin ) < fepse )
{
// Collison OK
//std::cout << "collisions6" << std::endl;
@@ -893,7 +949,7 @@ G4bool G4QMDCollision::CalFinalStateOfTheBinaryCollisionJQMD( G4double sig , G4d
}
//071031
if ( std::abs ( eini - efin ) < epse ) return result; // Collison OK
if ( std::abs ( eini - efin ) < fepse ) return result; // Collison OK
G4double cona = ( eini - efin + etwo ) / gamma;
G4double fac2 = 1.0 / ( 4.0 * cona*cona * pr*pr ) *
@@ -36,29 +36,21 @@
#include "Randomize.hh"
G4QMDGroundStateNucleus::G4QMDGroundStateNucleus( G4int z , G4int a )
: r00 ( 1.124 ) // radius parameter for Woods-Saxon [fm]
: maxTrial ( 1000 )
, r00 ( 1.124 ) // radius parameter for Woods-Saxon [fm]
, r01 ( 0.5 ) // radius parameter for Woods-Saxon
, saa ( 0.2 ) // diffuse parameter for initial Woods-Saxon shape
, rada ( 0.9 ) // cutoff parameter
, radb ( 0.3 ) // cutoff parameter
, dsam ( 1.5 ) // minimum distance for same particle [fm]
, ddif ( 1.0 ) // minimum distance for different particle
, edepth ( 0.0 )
, epse ( 0.000001 ) // torelance for energy in [GeV]
, meanfield ( NULL )
{
//std::cout << " G4QMDGroundStateNucleus( G4int z , G4int a ) Begin " << z << " " << a << std::endl;
if ( z == 1 && a == 1 ) // Hydrogen Case or proton primary
{
SetParticipant( new G4QMDParticipant( G4Proton::Proton() , G4ThreeVector( 0.0 ) , G4ThreeVector( 0.0 ) ) );
return;
}
else if ( z == 0 && a == 1 ) // Neutron primary
{
SetParticipant( new G4QMDParticipant( G4Neutron::Neutron() , G4ThreeVector( 0.0 ) , G4ThreeVector( 0.0 ) ) );
return;
}
dsam2 = dsam*dsam;
ddif2 = ddif*ddif;
@@ -77,7 +69,7 @@ G4QMDGroundStateNucleus::G4QMDGroundStateNucleus( G4int z , G4int a )
csp = parameters->Get_csp();
clp = parameters->Get_clp();
edepth = 0.0;
//edepth = 0.0;
for ( int i = 0 ; i < a ; i++ )
{
@@ -106,7 +98,19 @@ G4QMDGroundStateNucleus::G4QMDGroundStateNucleus( G4int z , G4int a )
radm = radious - rada * ( gamm - 1.0 ) + radb;
rmax = 1.0 / ( 1.0 + std::exp ( -rt00/saa ) );
maxTrial = 1000;
//maxTrial = 1000;
//Nucleon primary or target case;
if ( z == 1 && a == 1 ) { // Hydrogen Case or proton primary
SetParticipant( new G4QMDParticipant( G4Proton::Proton() , G4ThreeVector( 0.0 ) , G4ThreeVector( 0.0 ) ) );
return;
}
else if ( z == 0 && a == 1 ) { // Neutron primary
SetParticipant( new G4QMDParticipant( G4Neutron::Neutron() , G4ThreeVector( 0.0 ) , G4ThreeVector( 0.0 ) ) );
return;
}
meanfield = new G4QMDMeanField();
meanfield->SetSystem( this );
@@ -415,7 +419,7 @@ void G4QMDGroundStateNucleus::packNucleons()
if ( isThisOK == false )
{
std::cout << "GroundStateNucleus state cannot be created. Try again with another parameters." << std::endl;
G4cout << "GroundStateNucleus state cannot be created. Try again with another parameters." << G4endl;
}
//std::cout << "packNucleons End" << std::endl;
@@ -451,7 +455,7 @@ void G4QMDGroundStateNucleus::packNucleons()
if ( n0Try > maxTrial )
{
std::cout << "GroundStateNucleus state cannot be created. Try again with another parameters." << std::endl;
G4cout << "GroundStateNucleus state cannot be created. Try again with another parameters." << G4endl;
return;
}
@@ -470,7 +474,7 @@ void G4QMDGroundStateNucleus::packNucleons()
rho_a[ i ] += meanfield->GetRHA( j , i );
G4int k = 0;
if ( participants[i]->GetDefinition() != participants[i]->GetDefinition() )
if ( participants[i]->GetDefinition() != participants[j]->GetDefinition() )
{
k = 1;
}
@@ -527,7 +531,7 @@ void G4QMDGroundStateNucleus::packNucleons()
if ( n1Try > maxTrial )
{
std::cout << "GroundStateNucleus state cannot be created. Try again with another parameters." << std::endl;
G4cout << "GroundStateNucleus state cannot be created. Try again with another parameters." << G4endl;
return;
}
@@ -842,9 +846,9 @@ G4bool G4QMDGroundStateNucleus::samplingMomentum( G4int i )
if ( phase[j] * cpc > 0.2 )
{
/*
std::cout << "TKDB Check Pauli Principle A i , j " << i << " , " << j << std::endl;
std::cout << "TKDB Check Pauli Principle phase[j] " << phase[j] << std::endl;
std::cout << "TKDB Check Pauli Principle phase[j]*cpc > 0.2 " << phase[j]*cpc << std::endl;
G4cout << "TKDB Check Pauli Principle A i , j " << i << " , " << j << G4endl;
G4cout << "TKDB Check Pauli Principle phase[j] " << phase[j] << G4endl;
G4cout << "TKDB Check Pauli Principle phase[j]*cpc > 0.2 " << phase[j]*cpc << G4endl;
*/
isThisOK = false;
break;
@@ -852,10 +856,10 @@ G4bool G4QMDGroundStateNucleus::samplingMomentum( G4int i )
if ( ( phase_g[j] + phase[j] ) * cpc > 0.5 )
{
/*
std::cout << "TKDB Check Pauli Principle B i , j " << i << " , " << j << std::endl;
std::cout << "TKDB Check Pauli Principle B phase_g[j] " << phase_g[j] << std::endl;
std::cout << "TKDB Check Pauli Principle B phase[j] " << phase[j] << std::endl;
std::cout << "TKDB Check Pauli Principle B phase_g[j] + phase[j] ) * cpc > 0.5 " << ( phase_g[j] + phase[j] ) * cpc << std::endl;
G4cout << "TKDB Check Pauli Principle B i , j " << i << " , " << j << G4endl;
G4cout << "TKDB Check Pauli Principle B phase_g[j] " << phase_g[j] << G4endl;
G4cout << "TKDB Check Pauli Principle B phase[j] " << phase[j] << G4endl;
G4cout << "TKDB Check Pauli Principle B phase_g[j] + phase[j] ) * cpc > 0.5 " << ( phase_g[j] + phase[j] ) * cpc << G4endl;
*/
isThisOK = false;
break;
@@ -865,9 +869,9 @@ G4bool G4QMDGroundStateNucleus::samplingMomentum( G4int i )
if ( phase[i] * cpc > 0.3 )
{
/*
std::cout << "TKDB Check Pauli Principle C i , j " << i << " , " << j << std::endl;
std::cout << "TKDB Check Pauli Principle C phase[i] " << phase[i] << std::endl;
std::cout << "TKDB Check Pauli Principle C phase[i] * cpc > 0.3 " << phase[i] * cpc << std::endl;
G4cout << "TKDB Check Pauli Principle C i , j " << i << " , " << j << G4endl;
G4cout << "TKDB Check Pauli Principle C phase[i] " << phase[i] << G4endl;
G4cout << "TKDB Check Pauli Principle C phase[i] * cpc > 0.3 " << phase[i] * cpc << G4endl;
*/
isThisOK = false;
break;
@@ -30,6 +30,7 @@
#include <algorithm>
#include <numeric>
#include <cmath>
#include <CLHEP/Random/Stat.h>
#include "G4QMDMeanField.hh"
@@ -72,6 +73,7 @@ G4QMDMeanField::G4QMDMeanField()
csg = - cs / ( 2.0 * wl );
pag = gamm - 1;
system = NULL; // will be set through SetSystem method
}
@@ -221,14 +223,23 @@ void G4QMDMeanField::Cal2BodyQuantities()
G4int icharge = system->GetParticipant(i)->GetChargeInUnitOfEplus();
G4int jcharge = system->GetParticipant(j)->GetChargeInUnitOfEplus();
G4double erf = 0.0;
G4double xerf = 0.0;
// T. K. add this protection. 5.8 is good enough for double
if ( rrs*c0sw < 5.8 )
erf = CLHEP::HepStat::erf ( rrs*c0sw );
else
erf = 1.0;
if ( rrs*c0sw < 5.8 ) {
//erf = G4RandStat::erf ( rrs*c0sw );
//Restore to CLHEP for avoiding compilation error in MT
//erf = CLHEP::HepStat::erf ( rrs*c0sw );
//Use cmath
#if defined WIN32-VC
xerf = CLHEP::HepStat::erf ( rrs*c0sw );
#else
xerf = erf ( rrs*c0sw );
#endif
} else {
xerf = 1.0;
}
G4double erfij = erf/rrs;
G4double erfij = xerf/rrs;
rhe[i][j] = icharge*jcharge * erfij;
@@ -344,14 +355,21 @@ void G4QMDMeanField::Cal2BodyQuantities( G4int i )
G4int icharge = system->GetParticipant(i)->GetChargeInUnitOfEplus();
G4int jcharge = system->GetParticipant(j)->GetChargeInUnitOfEplus();
G4double erf = 0.0;
G4double xerf = 0.0;
// T. K. add this protection. 5.8 is good enough for double
if ( rrs*c0sw < 5.8 )
erf = CLHEP::HepStat::erf ( rrs*c0sw );
else
erf = 1.0;
if ( rrs*c0sw < 5.8 ) {
//xerf = G4RandStat::erf ( rrs*c0sw );
//Use cmath
#if defined WIN32-VC
xerf = CLHEP::HepStat::erf ( rrs*c0sw );
#else
xerf = erf ( rrs*c0sw );
#endif
} else {
xerf = 1.0;
}
G4double erfij = erf/rrs;
G4double erfij = xerf/rrs;
rhe[i][j] = icharge*jcharge * erfij;
@@ -433,19 +451,19 @@ void G4QMDMeanField::CalGraduate()
ccpp *= mi_R;
/*
std::cout << c0g << " " << c3g << " " << csg << " " << cl << std::endl;
std::cout << "ccpp " << i << " " << j << " " << ccpp << std::endl;
std::cout << "rha[j][i] " << rha[j][i] << std::endl;
std::cout << "rh3d " << rh3d[j] << " " << rh3d[i] << std::endl;
std::cout << "rhc[j][i] " << rhc[j][i] << std::endl;
G4cout << c0g << " " << c3g << " " << csg << " " << cl << G4endl;
G4cout << "ccpp " << i << " " << j << " " << ccpp << G4endl;
G4cout << "rha[j][i] " << rha[j][i] << G4endl;
G4cout << "rh3d " << rh3d[j] << " " << rh3d[i] << G4endl;
G4cout << "rhc[j][i] " << rhc[j][i] << G4endl;
*/
G4double grbb = - rbij[j][i];
G4double ccrr = grbb * ccpp / eij;
/*
std::cout << "ccrr " << ccrr << std::endl;
std::cout << "grbb " << grbb << std::endl;
G4cout << "ccrr " << ccrr << G4endl;
G4cout << "grbb " << grbb << G4endl;
*/
@@ -562,9 +580,9 @@ G4double G4QMDMeanField::calPauliBlockingFactor( G4int i )
{
/*
std::cout << "Pauli i j " << i << " " << j << std::endl;
std::cout << "Pauli icharge " << icharge << std::endl;
std::cout << "Pauli jcharge " << jcharge << std::endl;
G4cout << "Pauli i j " << i << " " << j << G4endl;
G4cout << "Pauli icharge " << icharge << G4endl;
G4cout << "Pauli jcharge " << jcharge << G4endl;
*/
G4double expa = -rr2[i][j]*cpw;
@@ -573,10 +591,10 @@ G4double G4QMDMeanField::calPauliBlockingFactor( G4int i )
{
expa = expa - pp2[i][j]*cph;
/*
std::cout << "Pauli cph " << cph << std::endl;
std::cout << "Pauli pp2 " << pp2[i][j] << std::endl;
std::cout << "Pauli expa " << expa << std::endl;
std::cout << "Pauli epsx " << epsx << std::endl;
G4cout << "Pauli cph " << cph << G4endl;
G4cout << "Pauli pp2 " << pp2[i][j] << G4endl;
G4cout << "Pauli expa " << expa << G4endl;
G4cout << "Pauli epsx " << epsx << G4endl;
*/
if ( expa > epsx )
{
@@ -778,10 +796,10 @@ std::vector< G4QMDNucleus* > G4QMDMeanField::DoClusterJudgment()
{
/*
std::cout << "G4QMDRESULT "
<< i << " " << j << " " << id << " "
<< is_assigned_to [ i ] << " " << is_assigned_to [ j ]
<< std::endl;
G4cout << "G4QMDRESULT "
<< i << " " << j << " " << id << " "
<< is_assigned_to [ i ] << " " << is_assigned_to [ j ]
<< G4endl;
*/
if ( is_assigned_to [ j ] == -1 )
@@ -37,14 +37,18 @@ G4QMDNucleus::G4QMDNucleus()
{
G4QMDParameters* parameters = G4QMDParameters::GetInstance();
hbc = parameters->Get_hbc();
jj = 0; // will be calcualted in CalEnergyAndAngularMomentumInCM;
potentialEnergy = 0.0; // will be set through set method
excitationEnergy = 0.0;
}
G4QMDNucleus::~G4QMDNucleus()
{
;
}
//G4QMDNucleus::~G4QMDNucleus()
//{
// ;
//}
G4LorentzVector G4QMDNucleus::Get4Momentum()
@@ -207,10 +211,10 @@ void G4QMDNucleus::CalEnergyAndAngularMomentumInCM()
totalMass += GetParticipant( i )->GetMass();
}
kineticEnergyPerNucleon = ( std::accumulate ( es.begin() , es.end() , 0.0 ) - totalMass )/n;
//G4double kineticEnergyPerNucleon = ( std::accumulate ( es.begin() , es.end() , 0.0 ) - totalMass )/n;
// Total (not per nucleion ) Binding Energy
bindingEnergy = ( std::accumulate ( es.begin() , es.end() , 0.0 ) -totalMass ) + potentialEnergy;
G4double bindingEnergy = ( std::accumulate ( es.begin() , es.end() , 0.0 ) -totalMass ) + potentialEnergy;
//G4cout << "KineticEnergyPerNucleon in GeV " << kineticEnergyPerNucleon << G4endl;
//G4cout << "KineticEnergySum in GeV " << std::accumulate ( es.begin() , es.end() , 0.0 ) - totalMass << G4endl;
@@ -30,7 +30,7 @@
#include "G4QMDParameters.hh"
#include "G4PhysicalConstants.hh"
G4QMDParameters* G4QMDParameters::parameters = NULL;
G4ThreadLocal G4QMDParameters* G4QMDParameters::parameters = NULL;
G4QMDParameters::G4QMDParameters()
{
@@ -32,6 +32,7 @@ G4QMDParticipant::G4QMDParticipant( G4ParticleDefinition* pd , G4ThreeVector p ,
, position ( r )
, projectile ( false )
, target ( false )
, hit ( false )
{
;
}
@@ -103,7 +103,7 @@ G4HadFinalState* G4QMDReaction::ApplyYourself( const G4HadProjectile & projectil
//migrate to integer A and Z (GetN_asInt returns number of neutrons in the nucleus since this)
G4int targ_Z = target.GetZ_asInt();
G4int targ_A = target.GetA_asInt();
G4ParticleDefinition* targ_pd = G4ParticleTable::GetParticleTable()->GetIon( targ_Z , targ_A , 0.0 );
G4ParticleDefinition* targ_pd = G4IonTable::GetIonTable()->GetIon( targ_Z , targ_A , 0.0 );
//G4NistManager* nistMan = G4NistManager::Instance();
@@ -452,19 +452,19 @@ G4HadFinalState* G4QMDReaction::ApplyYourself( const G4HadProjectile & projectil
{
/*
std::cout << "G4QMDRESULT "
<< (*it)->GetAtomicNumber()
<< " "
<< (*it)->GetMassNumber()
<< " "
<< (*it)->Get4Momentum()
<< " "
<< (*it)->Get4Momentum().vect()
<< " "
<< (*it)->Get4Momentum().restMass()
<< " "
<< (*it)->GetNuclearMass()/GeV
<< std::endl;
G4cout << "G4QMDRESULT "
<< (*it)->GetAtomicNumber()
<< " "
<< (*it)->GetMassNumber()
<< " "
<< (*it)->Get4Momentum()
<< " "
<< (*it)->Get4Momentum().vect()
<< " "
<< (*it)->Get4Momentum().restMass()
<< " "
<< (*it)->GetNuclearMass()/GeV
<< G4endl;
*/
meanField->SetNucleus ( *it );
@@ -489,7 +489,7 @@ G4HadFinalState* G4QMDReaction::ApplyYourself( const G4HadProjectile & projectil
G4int ia = (*it)->GetMassNumber();
G4int iz = (*it)->GetAtomicNumber();
G4LorentzVector lv ( G4ThreeVector( 0.0 ) , (*it)->GetExcitationEnergy()*GeV + G4ParticleTable::GetParticleTable()->GetIonTable()->GetIonMass( iz , ia ) );
G4LorentzVector lv ( G4ThreeVector( 0.0 ) , (*it)->GetExcitationEnergy()*GeV + G4IonTable::GetIonTable()->GetIonMass( iz , ia ) );
G4Fragment* aFragment = new G4Fragment( ia , iz , lv );
@@ -543,7 +543,7 @@ G4HadFinalState* G4QMDReaction::ApplyYourself( const G4HadProjectile & projectil
//090122
/*
std::cout
G4cout
<< "Regist Secondary "
<< (*itt)->GetDefinition()->GetParticleName()
<< " "
@@ -565,14 +565,14 @@ G4HadFinalState* G4QMDReaction::ApplyYourself( const G4HadProjectile & projectil
<< p4_CM
<< " "
<< p4_LAB
<< std::endl;
<< G4endl;
*/
}
if ( notBreak == true )
{
G4ParticleDefinition* pd = G4ParticleTable::GetParticleTable()->GetIon( (*it)->GetAtomicNumber() , (*it)->GetMassNumber(), (*it)->GetExcitationEnergy()*GeV );
G4ParticleDefinition* pd = G4IonTable::GetIonTable()->GetIon( (*it)->GetAtomicNumber() , (*it)->GetMassNumber(), (*it)->GetExcitationEnergy()*GeV );
G4LorentzVector p4_CM = nucleus_p4CM;
G4LorentzVector p4_LAB = CLHEP::boostOf( p4_CM , boostBackToLAB ); // Back to LAB
G4DynamicParticle* dp = new G4DynamicParticle( pd , p4_LAB*GeV );
@@ -81,6 +81,7 @@ void G4QMDSystem::ShowParticipants()
G4ThreeVector p_sum( 0.0 );
std::vector< G4QMDParticipant* >::iterator it;
G4cout << "Momentum and Position of each participant " << G4endl;
G4int orginal = G4cout.precision();
G4int i = 0;
for ( it = participants.begin() ; it != participants.end() ; it++ )
{
@@ -96,7 +97,9 @@ void G4QMDSystem::ShowParticipants()
p_sum += (*it)->GetMomentum();
i++;
}
G4cout << "Sum upped Momentum and mag " << p_sum << " " << p_sum.mag() << G4endl;
G4cout << "Sum upped Momentum and its mag " << p_sum << " " << p_sum.mag() << G4endl;
//restore orginal precision
G4cout << std::setprecision( orginal );
}