Import Geant4 4.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 16:18:25 +02:00
parent 36c080dca6
commit 921d3b1cda
3990 changed files with 185376 additions and 82884 deletions
@@ -0,0 +1,93 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * authors in the GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4LowEIonFragmentation.hh,v 1.6 2001/10/06 08:17:01 hpw Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// by H.P. Wellisch
#ifndef G4LowEIonFragmentation_h
#define G4LowEIonFragmentation_h 1
#include "G4PreCompoundModel.hh"
#include "G4HadronicInteraction.hh"
#include "G4ExcitationHandler.hh"
#include "G4Fancy3DNucleus.hh"
class G4LowEIonFragmentation : public G4HadronicInteraction
{
public:
G4LowEIonFragmentation(G4ExcitationHandler * const value)
{
theHandler = value;
theModel = new G4PreCompoundModel(theHandler);
}
G4LowEIonFragmentation()
{
theHandler = new G4ExcitationHandler;
theModel = new G4PreCompoundModel(theHandler);
}
~G4LowEIonFragmentation() {delete theModel;}
private:
G4LowEIonFragmentation(const G4LowEIonFragmentation &right) {};
const G4LowEIonFragmentation& operator=(const G4LowEIonFragmentation &right);
G4bool operator==(const G4LowEIonFragmentation &right) const;
G4bool operator!=(const G4LowEIonFragmentation &right) const;
public:
G4VParticleChange * ApplyYourself(const G4Track & thePrimary, G4Nucleus & theNucleus);
static G4double GetCrossSection()
{
// clog << "area/millibarn = "<<area/millibarn<<G4endl;
// clog << "hits = "<<hits<<G4endl;
// clog << "totalTries = "<<totalTries<<G4endl;
return area*G4double(hits)/G4double(totalTries)/millibarn;
}
private:
G4ParticleChange theResult;
G4PreCompoundModel * theModel;
G4ExcitationHandler * theHandler;
private:
static G4int hits;
static G4int totalTries;
static G4double area;
};
#endif
@@ -14,15 +14,15 @@
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * authors in the GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4PreCompoundAlpha.hh,v 1.6.2.1 2001/06/28 19:13:31 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4PreCompoundAlpha.hh,v 1.8 2001/08/01 17:08:27 hpw Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// by V. Lara
@@ -14,15 +14,15 @@
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * authors in the GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4PreCompoundDeuteron.hh,v 1.6.2.1 2001/06/28 19:13:31 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4PreCompoundDeuteron.hh,v 1.8 2001/08/01 17:08:28 hpw Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// by V. Lara
@@ -14,15 +14,14 @@
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * authors in the GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4PreCompoundEmission.hh,v 1.3.2.1 2001/06/28 19:13:32 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4PreCompoundEmission.hh,v 1.8 2001/12/13 12:04:18 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// Hadronic Process: Nuclear Preequilibrium
// by V. Lara
@@ -77,7 +76,7 @@ private:
G4double rho(const G4double p, const G4double h, const G4double g,
const G4double E, const G4double Ef) const;
G4double bessi0(const G4double x) const;
// G4double bessi0(const G4double x) const;
// A vector with the allowed emission fragments
G4PreCompoundFragmentVector theFragmentsVector;
@@ -85,5 +84,9 @@ private:
// Projectile energy
G4double ProjEnergy;
// Projectile direction
G4ThreeVector theIncidentDirection;
};
#endif
@@ -14,15 +14,15 @@
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * authors in the GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4PreCompoundFragmentVector.hh,v 1.2.2.1 2001/06/28 19:13:33 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4PreCompoundFragmentVector.hh,v 1.4 2001/08/01 17:08:28 hpw Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// Hadronic Process: Nuclear Preequilibrium
// by V. Lara
@@ -14,15 +14,15 @@
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * authors in the GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4PreCompoundHe3.hh,v 1.6.2.1 2001/06/28 19:13:33 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4PreCompoundHe3.hh,v 1.8 2001/08/01 17:08:28 hpw Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// by V. Lara
@@ -14,15 +14,15 @@
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * authors in the GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4PreCompoundModel.hh,v 1.9.2.1 2001/06/28 19:13:33 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4PreCompoundModel.hh,v 1.11 2001/08/01 17:08:28 hpw Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// by V. Lara
@@ -14,15 +14,15 @@
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * authors in the GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4PreCompoundNeutron.hh,v 1.5.2.1 2001/06/28 19:13:33 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4PreCompoundNeutron.hh,v 1.7 2001/08/01 17:08:29 hpw Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// by V. Lara
@@ -14,15 +14,15 @@
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * authors in the GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4PreCompoundParameters.hh,v 1.5.2.1 2001/06/28 19:13:33 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4PreCompoundParameters.hh,v 1.7 2001/08/01 17:08:29 hpw Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// by V. Lara
@@ -14,15 +14,15 @@
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * authors in the GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4PreCompoundProton.hh,v 1.6.2.1 2001/06/28 19:13:33 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4PreCompoundProton.hh,v 1.8 2001/08/01 17:08:29 hpw Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// by V. Lara
@@ -14,15 +14,15 @@
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * authors in the GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4PreCompoundTransitions.hh,v 1.5.2.1 2001/06/28 19:13:33 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4PreCompoundTransitions.hh,v 1.7 2001/08/01 17:08:29 hpw Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// by V. Lara
@@ -14,15 +14,15 @@
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * authors in the GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4PreCompoundTriton.hh,v 1.6.2.1 2001/06/28 19:13:33 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4PreCompoundTriton.hh,v 1.8 2001/08/01 17:08:29 hpw Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// by V. Lara
@@ -14,15 +14,15 @@
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * authors in the GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4VPreCompoundFragment.hh,v 1.6.2.1 2001/06/28 19:13:34 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4VPreCompoundFragment.hh,v 1.8 2001/08/01 17:08:29 hpw Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// by V. Lara
@@ -14,15 +14,15 @@
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * authors in the GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4VPreCompoundIon.hh,v 1.6.2.1 2001/06/28 19:13:34 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4VPreCompoundIon.hh,v 1.8 2001/08/01 17:08:30 hpw Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// by V. Lara
@@ -14,15 +14,15 @@
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * authors in the GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4VPreCompoundNucleon.hh,v 1.5.2.1 2001/06/28 19:13:34 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4VPreCompoundNucleon.hh,v 1.7 2001/08/01 17:08:30 hpw Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// by V. Lara
@@ -0,0 +1,202 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * authors in the GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#include "G4LowEIonFragmentation.hh"
#include "g4std/algorithm"
G4int G4LowEIonFragmentation::hits = 0;
G4int G4LowEIonFragmentation::totalTries = 0;
G4double G4LowEIonFragmentation::area = 0;
G4VParticleChange * G4LowEIonFragmentation::
ApplyYourself(const G4Track & thePrimary, G4Nucleus & theNucleus)
{
area = 0;
// initialize the particle change
// theResult.Initialize(thePrimary);
theResult.SetStatusChange( fStopAndKill );
theResult.SetEnergyChange( 0.0 );
// Get Target A, Z
G4double aTargetA = theNucleus.GetN();
G4double aTargetZ = theNucleus.GetZ();
// Get Projectile A, Z
G4double aProjectileA = thePrimary.GetDynamicParticle()->GetDefinition()->GetBaryonNumber();
G4double aProjectileZ = thePrimary.GetDynamicParticle()->GetDefinition()->GetPDGCharge();
// Get Maximum radius of both
G4Fancy3DNucleus aPrim;
aPrim.Init(aProjectileA, aProjectileZ);
G4double projectileOuterRadius = aPrim.GetOuterRadius();
G4Fancy3DNucleus aTarg;
aTarg.Init(aTargetA, aTargetZ);
G4double targetOuterRadius = aTarg.GetOuterRadius();
// Get the Impact parameter
G4int particlesFromProjectile = 0;
G4int chargedFromProjectile = 0;
G4double impactParameter = 0;
G4double x,y;
G4Nucleon * pNucleon;
// need at lease one particle from the projectile model beyond the
// projectileHorizon.
while(0==particlesFromProjectile)
{
do
{
x = 2*G4UniformRand() - 1;
y = 2*G4UniformRand() - 1;
}
while(x*x + y*y > 1);
impactParameter = sqrt(x*x+y*y)*(targetOuterRadius+projectileOuterRadius);
totalTries++;
area = pi*(targetOuterRadius+projectileOuterRadius)*
(targetOuterRadius+projectileOuterRadius);
G4double projectileHorizon = impactParameter-targetOuterRadius;
// Empirical boundary transparency.
G4double empirical = G4UniformRand();
if(projectileHorizon/projectileOuterRadius>empirical) continue;
// Calculate the number of nucleons involved in collision
// From projectile
aPrim.StartLoop();
while((pNucleon = aPrim.GetNextNucleon()))
{
if(pNucleon->GetPosition().y()>projectileHorizon)
{
// We have one
particlesFromProjectile++;
if(pNucleon->GetParticleType()==G4Proton::ProtonDefinition())
{
chargedFromProjectile++;
}
}
}
}
hits ++;
// From target:
G4double targetHorizon = impactParameter-projectileOuterRadius;
G4int chargedFromTarget = 0;
G4int particlesFromTarget = 0;
aTarg.StartLoop();
while((pNucleon = aTarg.GetNextNucleon()))
{
if(pNucleon->GetPosition().y()>targetHorizon)
{
// We have one
particlesFromTarget++;
if(pNucleon->GetParticleType()==G4Proton::ProtonDefinition())
{
chargedFromTarget++;
}
}
}
// Energy sharing between projectile and target. Note that this is a quite simplistic kinetically.
G4ThreeVector exciton3Momentum = thePrimary.GetMomentum();
exciton3Momentum *= particlesFromProjectile/aProjectileA;
G4double compoundEnergy = thePrimary.GetTotalEnergy()*particlesFromProjectile/aProjectileA;
G4double targetMass = G4ParticleTable::GetParticleTable()
->GetIonTable()->GetIonMass(aTargetZ ,aTargetA);
compoundEnergy += targetMass;
G4LorentzVector fragment4Momentum(exciton3Momentum, compoundEnergy);
// take the nucleons and fill the Fragments
G4Fragment anInitialState;
anInitialState.SetA(aTargetA+particlesFromProjectile);
anInitialState.SetZ(aTargetZ+chargedFromProjectile);
anInitialState.SetNumberOfParticles(particlesFromProjectile);
anInitialState.SetNumberOfHoles(particlesFromTarget);
anInitialState.SetNumberOfCharged(chargedFromProjectile + chargedFromTarget);
anInitialState.SetMomentum(fragment4Momentum);
// Fragment the Fragment using Pre-compound
G4ReactionProductVector* thePreCompoundResult;
thePreCompoundResult = theModel->DeExcite(anInitialState);
// De-excite the projectile using ExcitationHandler
G4ReactionProductVector * theExcitationResult = 0;
if(particlesFromProjectile != aProjectileA)
{
G4ThreeVector residual3Momentum = thePrimary.GetMomentum();
residual3Momentum -= exciton3Momentum;
G4double residualEnergy = thePrimary.GetTotalEnergy()*(1.-particlesFromProjectile/aProjectileA);
G4LorentzVector residual4Momentum(residual3Momentum, residualEnergy);
G4Fragment initialState2;
initialState2.SetA(aProjectileA-particlesFromProjectile);
initialState2.SetZ(aProjectileZ-chargedFromProjectile);
initialState2.SetNumberOfHoles((aProjectileA-particlesFromProjectile)/2.);
initialState2.SetNumberOfParticles((aProjectileZ-chargedFromProjectile)/2.);
initialState2.SetNumberOfCharged((aProjectileZ-chargedFromProjectile)/2.);
initialState2.SetMomentum(residual4Momentum);
theExcitationResult = theHandler->BreakItUp(initialState2);
}
// Fill the particle change
G4int nSecondaries = 0;
if(theExcitationResult) nSecondaries+=theExcitationResult->size();
if(thePreCompoundResult) nSecondaries+=thePreCompoundResult->size();
theResult.SetNumberOfSecondaries(nSecondaries);
unsigned int k;
if(theExcitationResult!=0)
{
for(k=0; k<theExcitationResult->size(); k++)
{
G4DynamicParticle* p0 = new G4DynamicParticle;
p0->SetDefinition( theExcitationResult->operator[](k)->GetDefinition() );
p0->SetMomentum( theExcitationResult->operator[](k)->GetMomentum() );
theResult.AddSecondary(p0);
}
}
for(k=0; k<thePreCompoundResult->size(); k++)
{
G4DynamicParticle* p0 = new G4DynamicParticle;
p0->SetDefinition(thePreCompoundResult->operator[](k)->GetDefinition());
p0->SetMomentum(thePreCompoundResult->operator[](k)->GetMomentum());
theResult.AddSecondary(p0);
}
// clean up
G4std::for_each(thePreCompoundResult->begin(), thePreCompoundResult->end(), DeleteReactionProduct());
if(theExcitationResult)
{
G4std::for_each(theExcitationResult->begin(), theExcitationResult->end(), DeleteReactionProduct());
}
delete thePreCompoundResult;
if(theExcitationResult) delete theExcitationResult;
// return the particle change
return &theResult;
}
@@ -14,15 +14,37 @@
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * authors in the GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4PreCompoundEmission.cc,v 1.3.2.1 2001/06/28 19:13:34 gunter Exp $
// GEANT4 tag $Name: $
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * authors in the GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4PreCompoundEmission.cc,v 1.7 2001/09/27 16:51:56 larazb Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// Hadronic Process: Nuclear Preequilibrium
// by V. Lara
@@ -52,6 +74,7 @@ G4PreCompoundEmission::G4PreCompoundEmission(const G4Fragment& aFragment)
{
// Assume that projectile is a proton
ProjEnergy = aFragment.GetExcitationEnergy();
theIncidentDirection = aFragment.GetMomentum().vect().unit();
}
@@ -173,18 +196,22 @@ G4ThreeVector G4PreCompoundEmission::AngularDistribution(G4VPreCompoundFragment
G4double an = 3.0*sqrt((ProjEnergy+Ef)*(KineticEnergyOfEmittedFragment+Bemission+Ef))/
(zeta*2.0*aFragment.GetNumberOfExcitons()*Eav);
// (zeta*(aFragment.GetNumberOfExcitons()-1.0)*Eav);
// (zeta*(aFragment.GetNumberOfExcitons()-1.0)*Eav);
G4double normalization = pi*bessi0(an);
// G4double normalization = pi*bessi0(an);
// Normalization is expesive to calculate
// And rejection method is selfnormalized
// So, I only need the maximum
G4double normalization = exp(an);
G4double theta = 0.0;
G4double distrib = 0.0;
do {
theta = pi*G4UniformRand();
distrib = exp(an*cos(theta))/normalization;
} while ( G4UniformRand() > distrib );
// distrib = exp(an*cos(theta))/normalization;
distrib = exp(an*cos(theta));
} while ( G4UniformRand()*normalization > distrib );
G4double phi = twopi*G4UniformRand();
@@ -192,11 +219,15 @@ G4ThreeVector G4PreCompoundEmission::AngularDistribution(G4VPreCompoundFragment
G4double EmittedMass = theFragment->GetNuclearMass();
G4double pmag = sqrt(KineticEnergyOfEmittedFragment*(KineticEnergyOfEmittedFragment+2.0*EmittedMass));
G4double sinTheta = sin(theta);
G4double cosTheta = sqrt(1.0-sinTheta*sinTheta);
G4ThreeVector momentum = G4ParticleMomentum(pmag*cos(phi)*sinTheta,pmag*sin(phi)*sinTheta,pmag*cosTheta);
G4double sinTheta = sin(theta);
// G4double cosTheta = sqrt(1.0-sinTheta*sinTheta);
G4double cosTheta = cos(theta);
G4ThreeVector momentum(pmag*cos(phi)*sinTheta,pmag*sin(phi)*sinTheta,pmag*cosTheta);
// theta is the angle wrt the incident direction
momentum.rotateUz(theIncidentDirection);
return momentum;
}
@@ -227,31 +258,31 @@ G4double G4PreCompoundEmission::rho(const G4double p, const G4double h, const G4
return tot;
}
G4double G4PreCompoundEmission::bessi0(const G4double x) const
// Returns the modified Bessel function I_0(x) for any real x.
{
G4double ax,ans;
G4double y;
// G4double G4PreCompoundEmission::bessi0(const G4double x) const
// // Returns the modified Bessel function I_0(x) for any real x.
// {
// G4double ax,ans;
// G4double y;
if ((ax=fabs(x)) < 3.75) { /* Polynomial fit. */
y=x/3.75;
y*=y;
ans=1.0+y*(3.5156229+y*(3.0899424+
y*(1.2067492+
y*(0.2659732+
y*(0.360768e-1+
y*0.45813e-2)))));
} else {
y=3.75/ax;
ans=(exp(ax)/sqrt(ax))*(0.39894228+y*(0.1328592e-1+
y*(0.225319e-2+
y*(-0.157565e-2+
y*(0.916281e-2+
y*(-0.2057706e-1+
y*(0.2635537e-1+
y*(-0.1647633e-1+
y*0.392377e-2))))))));
}
return ans;
// if ((ax=fabs(x)) < 3.75) { /* Polynomial fit. */
// y=x/3.75;
// y*=y;
// ans=1.0+y*(3.5156229+y*(3.0899424+
// y*(1.2067492+
// y*(0.2659732+
// y*(0.360768e-1+
// y*0.45813e-2)))));
// } else {
// y=3.75/ax;
// ans=(exp(ax)/sqrt(ax))*(0.39894228+y*(0.1328592e-1+
// y*(0.225319e-2+
// y*(-0.157565e-2+
// y*(0.916281e-2+
// y*(-0.2057706e-1+
// y*(0.2635537e-1+
// y*(-0.1647633e-1+
// y*0.392377e-2))))))));
// }
// return ans;
}
// }
@@ -14,15 +14,15 @@
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * authors in the GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4PreCompoundFragmentVector.cc,v 1.3.2.1 2001/06/28 19:13:35 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4PreCompoundFragmentVector.cc,v 1.5 2001/08/01 17:08:32 hpw Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// Hadronic Process: Nuclear Preequilibrium
// by V. Lara
@@ -14,15 +14,15 @@
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * authors in the GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4PreCompoundModel.cc,v 1.11.2.1 2001/06/28 19:13:35 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4PreCompoundModel.cc,v 1.16 2001/10/04 20:00:30 hpw Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// by V. Lara
@@ -96,14 +96,14 @@ G4VParticleChange * G4PreCompoundModel::ApplyYourself(const G4Track & thePrimary
// fill particle change
theResult.SetStatusChange(fStopAndKill);
theResult.SetNumberOfSecondaries(result->length());
for(G4int i=0; i<result->length(); i++)
theResult.SetNumberOfSecondaries(result->size());
for(unsigned int i=0; i<result->size(); i++)
{
G4DynamicParticle * aNew =
new G4DynamicParticle(result->at(i)->GetDefinition(),
result->at(i)->GetTotalEnergy(),
result->at(i)->GetMomentum());
delete result->at(i);
new G4DynamicParticle(result->operator[](i)->GetDefinition(),
result->operator[](i)->GetTotalEnergy(),
result->operator[](i)->GetMomentum());
delete result->operator[](i);
theResult.AddSecondary(aNew);
}
delete result;
@@ -124,6 +124,16 @@ G4ReactionProductVector* G4PreCompoundModel::DeExcite(const G4Fragment & theInit
// Copy of the initial state
G4Fragment aFragment(theInitialState);
if (aFragment.GetA() < 5) {
G4ReactionProduct * theRP = new G4ReactionProduct(G4ParticleTable::GetParticleTable()->
GetIon(aFragment.GetZ(),aFragment.GetA(),
aFragment.GetExcitationEnergy()));
theRP->SetMomentum(aFragment.GetMomentum().vect());
theRP->SetTotalEnergy(aFragment.GetMomentum().e());
Result->push_back(theRP);
return Result;
}
G4PreCompoundEmission aEmission(theInitialState);
// Main loop. It is performed until equilibrium deexcitation.
@@ -178,7 +188,7 @@ G4ReactionProductVector* G4PreCompoundModel::DeExcite(const G4Fragment & theInit
ThereIsTransition = false;
// Perform the emission and Add emitted fragment to Result
Result->insert(aEmission.PerformEmission(aFragment));
Result->push_back(aEmission.PerformEmission(aFragment));
}
} else {
// Perform Equilibrium Emission
@@ -201,8 +211,11 @@ void G4PreCompoundModel::PerformEquilibriumEmission(const G4Fragment & aFragment
G4ReactionProductVector * theEquilibriumResult;
theEquilibriumResult = GetExcitationHandler()->BreakItUp(aFragment);
while (theEquilibriumResult->entries() > 0) Result->insert(theEquilibriumResult->removeFirst());
while (theEquilibriumResult->size() > 0)
{
Result->push_back(*theEquilibriumResult->begin());
theEquilibriumResult->erase(theEquilibriumResult->begin());
}
delete theEquilibriumResult;
return;
}
@@ -14,15 +14,15 @@
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * authors in the GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4PreCompoundNeutron.cc,v 1.7.2.1 2001/06/28 19:13:35 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4PreCompoundNeutron.cc,v 1.9 2001/08/01 17:08:32 hpw Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// by V. Lara
@@ -14,15 +14,15 @@
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * authors in the GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4PreCompoundParameters.cc,v 1.4.2.1 2001/06/28 19:13:35 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4PreCompoundParameters.cc,v 1.6 2001/08/01 17:08:32 hpw Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// by V. Lara
@@ -14,15 +14,15 @@
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * authors in the GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4PreCompoundProton.cc,v 1.6.2.1 2001/06/28 19:13:35 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4PreCompoundProton.cc,v 1.8 2001/08/01 17:08:32 hpw Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// by V. Lara
@@ -14,15 +14,15 @@
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * authors in the GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4PreCompoundTransitions.cc,v 1.6.2.1 2001/06/28 19:13:35 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4PreCompoundTransitions.cc,v 1.9 2001/08/01 17:08:32 hpw Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// by V. Lara
@@ -159,7 +159,13 @@ G4Fragment G4PreCompoundTransitions::PerformTransition(const G4Fragment & aFragm
if ((deltaN > 0 || result.GetNumberOfCharged() > 0) &&
(G4UniformRand() <= result.GetZ()/result.GetA())){
result.SetNumberOfCharged(result.GetNumberOfCharged()+deltaN/2);
}
}
// Number of charged can not be greater that number of particles
if ( result.GetNumberOfParticles() < result.GetNumberOfCharged() ) {
result.SetNumberOfCharged(result.GetNumberOfParticles());
}
return result;
}
@@ -14,15 +14,15 @@
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * authors in the GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4VPreCompoundFragment.cc,v 1.8.2.1 2001/06/28 19:13:35 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4VPreCompoundFragment.cc,v 1.11.2.1 2001/12/04 15:32:46 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// by V. Lara
@@ -48,8 +48,9 @@ G4VPreCompoundFragment::G4VPreCompoundFragment(const G4VPreCompoundFragment & ri
G4VPreCompoundFragment::G4VPreCompoundFragment(const G4double anA,
const G4double aZ, G4VCoulombBarrier* aCoulombBarrier):
theA(anA),theZ(aZ), theCoulombBarrierPtr(aCoulombBarrier),
theA(anA),theZ(aZ),
theRestNucleusA(0.0),theRestNucleusZ(0.0),theCoulombBarrier(0.0),
theCoulombBarrierPtr(aCoulombBarrier),theBindingEnergy(0.0),
theMaximalKineticEnergy(-1.0),theExcitonLevelDensityRatio(0.0),theEmissionProbability(0.0),
theCondensationProbability(0.0),theMomentum(0.0,0.0,0.0,0.0),theFragmentName("No Name")
{}
@@ -57,8 +58,9 @@ G4VPreCompoundFragment::G4VPreCompoundFragment(const G4double anA,
G4VPreCompoundFragment::G4VPreCompoundFragment(const G4double anA,
const G4double aZ, G4VCoulombBarrier* aCoulombBarrier,
const G4String & aName):
theA(anA),theZ(aZ), theCoulombBarrierPtr(aCoulombBarrier),
theA(anA),theZ(aZ),
theRestNucleusA(0.0),theRestNucleusZ(0.0),theCoulombBarrier(0.0),
theCoulombBarrierPtr(aCoulombBarrier), theBindingEnergy(0.0),
theMaximalKineticEnergy(-1.0),theExcitonLevelDensityRatio(0.0),theEmissionProbability(0.0),
theCondensationProbability(0.0),theMomentum(0.0,0.0,0.0,0.0),theFragmentName(aName)
{}
@@ -109,7 +111,12 @@ G4std::ostream& operator << (G4std::ostream &out, const G4VPreCompoundFragment &
G4std::ostream& operator << (G4std::ostream &out, const G4VPreCompoundFragment *theFragment)
{
#ifdef G4USE_STD_NAMESPACE
G4std::ios::fmtflags old_floatfield = out.flags();
out.setf(G4std::ios::floatfield);
#else
long old_floatfield = out.setf(0,G4std::ios::floatfield);
#endif
out
<< "PreCompound Model Emitted Fragment: A = " << G4std::setprecision(3) << theFragment->theA
@@ -14,15 +14,15 @@
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * authors in the GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4VPreCompoundIon.cc,v 1.8.2.1 2001/06/28 19:13:36 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4VPreCompoundIon.cc,v 1.10 2001/08/01 17:08:32 hpw Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// by V. Lara