Import Geant4 9.4.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 16:25:56 +02:00
parent 74cad5e589
commit 89a9605df1
4440 changed files with 379508 additions and 189225 deletions
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4VEmProcess.cc,v 1.79 2009/11/10 20:30:55 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-03 $
// $Id: G4VEmProcess.cc,v 1.88 2010/08/17 17:36:59 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-04 $
//
// -------------------------------------------------------------------
//
@@ -52,6 +52,7 @@
// 12-04-07 remove double call to Clear model manager (V.Ivanchenko)
// 27-10-07 Virtual functions moved to source (V.Ivanchenko)
// 24-06-09 Removed hidden bin in G4PhysicsVector (V.Ivanchenko)
// 17-02-10 Added pointer currentParticle (VI)
//
// Class Description:
//
@@ -97,6 +98,7 @@ G4VEmProcess::G4VEmProcess(const G4String& name, G4ProcessType type):
idxDERegions(0),
currentModel(0),
particle(0),
currentParticle(0),
currentCouple(0)
{
SetVerboseLevel(1);
@@ -164,7 +166,7 @@ void G4VEmProcess::AddEmModel(G4int order, G4VEmModel* p,
{
G4VEmFluctuationModel* fm = 0;
modelManager->AddEmModel(order, p, fm, region);
if(p) p->SetParticleChange(pParticleChange);
if(p) { p->SetParticleChange(pParticleChange); }
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -204,7 +206,7 @@ G4VEmModel* G4VEmProcess::GetModelByIndex(G4int idx, G4bool ver)
void G4VEmProcess::PreparePhysicsTable(const G4ParticleDefinition& part)
{
if(!particle) particle = ∂
if(!particle) { SetParticle(&part); }
if(1 < verboseLevel) {
G4cout << "G4VEmProcess::PreparePhysicsTable() for "
<< GetProcessName()
@@ -213,7 +215,7 @@ void G4VEmProcess::PreparePhysicsTable(const G4ParticleDefinition& part)
<< G4endl;
}
(G4LossTableManager::Instance())->EmConfigurator()->AddModels();
(G4LossTableManager::Instance())->PreparePhysicsTable(&part, this);
if(particle == &part) {
Clear();
@@ -229,7 +231,8 @@ void G4VEmProcess::PreparePhysicsTable(const G4ParticleDefinition& part)
}
}
theCuts = modelManager->Initialise(particle,secondaryParticle,2.,verboseLevel);
theCuts = modelManager->Initialise(particle,secondaryParticle,
2.,verboseLevel);
const G4ProductionCutsTable* theCoupleTable=
G4ProductionCutsTable::GetProductionCutsTable();
theCutsGamma = theCoupleTable->GetEnergyCutsVector(idxG4GammaCut);
@@ -241,7 +244,7 @@ void G4VEmProcess::PreparePhysicsTable(const G4ParticleDefinition& part)
theLambdaTable = G4PhysicsTableHelper::PreparePhysicsTable(theLambdaTable);
}
}
// Sub Cutoff and Deexcitation
// Deexcitation
if (nDERegions>0) {
const G4ProductionCutsTable* theCoupleTable=
@@ -286,6 +289,7 @@ void G4VEmProcess::BuildPhysicsTable(const G4ParticleDefinition& part)
<< G4endl;
}
(G4LossTableManager::Instance())->BuildPhysicsTable(particle);
if(buildLambdaTable) {
BuildLambdaTable();
FindLambdaMax();
@@ -293,7 +297,8 @@ void G4VEmProcess::BuildPhysicsTable(const G4ParticleDefinition& part)
// reduce printout for nuclear stopping
G4bool gproc = true;
if(GetProcessName() == "nuclearStopping" &&
G4int st = GetProcessSubType();
if(st == fCoulombScattering && part.GetParticleType() == "nucleus" &&
partname != "GenericIon" && partname != "alpha") { gproc = false; }
if(gproc && 0 < verboseLevel) { PrintInfoDefinition(); }
@@ -353,9 +358,6 @@ void G4VEmProcess::BuildLambdaTable()
G4cout << "Lambda table is built for "
<< particle->GetParticleName()
<< G4endl;
if(2 < verboseLevel) {
G4cout << *theLambdaTable << G4endl;
}
}
}
@@ -384,7 +386,7 @@ void G4VEmProcess::PrintInfoDefinition()
if(verboseLevel > 2 && buildLambdaTable) {
G4cout << " LambdaTable address= " << theLambdaTable << G4endl;
if(theLambdaTable) G4cout << (*theLambdaTable) << G4endl;
if(theLambdaTable) { G4cout << (*theLambdaTable) << G4endl; }
}
}
@@ -398,9 +400,9 @@ G4double G4VEmProcess::PostStepGetPhysicalInteractionLength(
// condition is set to "Not Forced"
*condition = NotForced;
G4double x = DBL_MAX;
if(previousStepSize <= DBL_MIN) theNumberOfInteractionLengthLeft = -1.0;
if(previousStepSize <= DBL_MIN) { theNumberOfInteractionLengthLeft = -1.0; }
InitialiseStep(track);
if(!currentModel->IsActive(preStepKinEnergy)) return x;
if(!currentModel->IsActive(preStepKinEnergy)) { return x; }
if(preStepKinEnergy < mfpKinEnergy) {
if (integral) ComputeIntegralLambda(preStepKinEnergy);
@@ -427,7 +429,7 @@ G4double G4VEmProcess::PostStepGetPhysicalInteractionLength(
if (verboseLevel>2){
G4cout << "G4VEmProcess::PostStepGetPhysicalInteractionLength ";
G4cout << "[ " << GetProcessName() << "]" << G4endl;
G4cout << " for " << particle->GetParticleName()
G4cout << " for " << currentParticle->GetParticleName()
<< " in Material " << currentMaterial->GetName()
<< " Ekin(MeV)= " << preStepKinEnergy/MeV
<<G4endl;
@@ -460,7 +462,7 @@ G4VParticleChange* G4VEmProcess::PostStepDoIt(const G4Track& track,
// Do not make anything if particle is stopped, the annihilation then
// should be performed by the AtRestDoIt!
if (track.GetTrackStatus() == fStopButAlive) return &fParticleChange;
if (track.GetTrackStatus() == fStopButAlive) { return &fParticleChange; }
G4double finalT = track.GetKineticEnergy();
@@ -468,7 +470,7 @@ G4VParticleChange* G4VEmProcess::PostStepDoIt(const G4Track& track,
if (integral) {
G4double lx = GetLambda(finalT, currentCouple);
if(preStepLambda<lx && 1 < verboseLevel) {
G4cout << "WARING: for " << particle->GetParticleName()
G4cout << "WARING: for " << currentParticle->GetParticleName()
<< " and " << GetProcessName()
<< " E(MeV)= " << finalT/MeV
<< " preLambda= " << preStepLambda << " < " << lx << " (postLambda) "
@@ -482,7 +484,7 @@ G4VParticleChange* G4VEmProcess::PostStepDoIt(const G4Track& track,
}
SelectModel(finalT, currentCoupleIndex);
if(!currentModel->IsActive(finalT)) return &fParticleChange;
if(!currentModel->IsActive(finalT)) { return &fParticleChange; }
if(useDeexcitation) {
currentModel->SetDeexcitationFlag(idxDERegions[currentCoupleIndex]);
}
@@ -513,7 +515,7 @@ G4VParticleChange* G4VEmProcess::PostStepDoIt(const G4Track& track,
for (G4int i=0; i<num; ++i) {
G4DynamicParticle* dp = secParticles[i];
const G4ParticleDefinition* p = dp->GetDefinition();
const G4ParticleDefinition* p = dp->GetParticleDefinition();
G4double e = dp->GetKineticEnergy();
G4bool good = true;
if(applyCuts) {
@@ -661,9 +663,10 @@ G4double G4VEmProcess::CrossSectionPerVolume(G4double kineticEnergy,
} else {
SelectModel(kineticEnergy, currentCoupleIndex);
cross = currentModel->CrossSectionPerVolume(currentMaterial,
particle,kineticEnergy);
currentParticle,kineticEnergy);
}
if(cross < 0.0) { cross = 0.0; }
return cross;
}
@@ -679,6 +682,32 @@ G4double G4VEmProcess::GetMeanFreePath(const G4Track& track,
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double G4VEmProcess::MeanFreePath(const G4Track& track)
{
DefineMaterial(track.GetMaterialCutsCouple());
preStepLambda = GetCurrentLambda(track.GetKineticEnergy());
G4double x = DBL_MAX;
if(DBL_MIN < preStepLambda) x = 1.0/preStepLambda;
return x;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double
G4VEmProcess::ComputeCrossSectionPerAtom(G4double kineticEnergy,
G4double Z, G4double A, G4double cut)
{
SelectModel(kineticEnergy, currentCoupleIndex);
G4double x = 0.0;
if(currentModel) {
x = currentModel->ComputeCrossSectionPerAtom(currentParticle,kineticEnergy,
Z,A,cut);
}
return x;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4VEmProcess::FindLambdaMax()
{
if(1 < verboseLevel) {
@@ -713,7 +742,7 @@ void G4VEmProcess::FindLambdaMax()
}
theEnergyOfCrossSectionMax[i] = emax;
theCrossSectionMax[i] = smax;
if(2 < verboseLevel) {
if(1 < verboseLevel) {
G4cout << "For " << particle->GetParticleName()
<< " Max CS at i= " << i << " emax(MeV)= " << emax/MeV
<< " lambda= " << smax << G4endl;
@@ -732,3 +761,12 @@ G4PhysicsVector* G4VEmProcess::LambdaPhysicsVector(const G4MaterialCutsCouple*)
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
const G4Element* G4VEmProcess::GetCurrentElement() const
{
const G4Element* elm = 0;
if(currentModel) {elm = currentModel->GetCurrentElement(); }
return elm;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....