Import Geant4 8.2.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 14:55:03 +02:00
parent 216a75eeb1
commit fe73f43734
6714 changed files with 118229 additions and 68144 deletions
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4ChargeExchangeProcess.cc,v 1.4 2006/06/29 20:09:21 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: G4ChargeExchangeProcess.cc,v 1.7 2006/08/10 15:44:28 vnivanch Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
//
// Geant4 Hadron Elastic Scattering Process -- header file
@@ -34,6 +34,8 @@
//
// Modified:
// 24-Apr-06 V.Ivanchenko add neutron scattering on hydrogen from CHIPS
// 07-Jun-06 V.Ivanchenko fix problem of rotation of final state
// 25-Jul-06 V.Ivanchenko add 19 MeV low energy for CHIPS
//
//
@@ -55,7 +57,7 @@
G4ChargeExchangeProcess::G4ChargeExchangeProcess(const G4String& procName)
: G4HadronicProcess(procName), first(true)
{
thEnergy = 1.*keV;
thEnergy = 19.*MeV;
verboseLevel= 1;
qCManager = 0;
AddDataSet(new G4HadronElasticDataSet);
@@ -187,7 +189,8 @@ G4double G4ChargeExchangeProcess::GetMicroscopicCrossSection(
if(iz == 1) return x;
// CHIPS cross sections
G4double momentum = dp->GetTotalMomentum();
if(iz <= -2 && (theParticle == theProton || theParticle == theNeutron)) {
if(iz == 2 && dp->GetKineticEnergy() > thEnergy &&
(theParticle == theProton || theParticle == theNeutron)) {
G4double momentum = dp->GetTotalMomentum();
if(verboseLevel>1)
G4cout << "G4ChargeExchangeProcess compute CHIPS CS for Z= 2, N=2 "
@@ -201,6 +204,20 @@ G4double G4ChargeExchangeProcess::GetMicroscopicCrossSection(
<< G4endl;
x = store->GetCrossSection(dp, elm, temp);
}
// NaN finder
if(!(x < 0.0 || x >= 0.0)) {
if (verboseLevel > -1) {
G4cout << "G4ChargeExchangeProcess WARNING: Z= " << iz
<< " pdg= " << pPDG
<< " mom(GeV)= " << dp->GetTotalMomentum()/GeV
<< " cross= " << x
<< " set to zero"
<< G4endl;
}
x = 0.0;
}
if(verboseLevel>1)
G4cout << "G4ChargeExchangeProcess cross(mb)= " << x/millibarn
<< " E(MeV)= " << dp->GetKineticEnergy()
@@ -277,6 +294,7 @@ G4VParticleChange* G4ChargeExchangeProcess::PostStepDoIt(
aParticleChange.Initialize(track);
G4HadFinalState* result = hadi->ApplyYourself(thePro, targetNucleus);
G4ThreeVector indir = track.GetMomentumDirection();
G4int nsec = result->GetNumberOfSecondaries();
if(verboseLevel>1)
@@ -293,6 +311,11 @@ G4VParticleChange* G4ChargeExchangeProcess::PostStepDoIt(
aParticleChange.SetNumberOfSecondaries(nsec);
for(G4int j=0; j<nsec; j++) {
G4DynamicParticle* p = result->GetSecondary(j)->GetParticle();
G4ThreeVector pdir = p->GetMomentumDirection();
// G4cout << "recoil " << pdir << G4endl;
pdir = pdir.rotateUz(indir);
// G4cout << "recoil rotated " << pdir << G4endl;
p->SetMomentumDirection(pdir);
aParticleChange.AddSecondary(p);
}
}