Import Geant4 10.5.0 source tree
This commit is contained in:
@@ -23,7 +23,6 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4VEmProcess.hh 109178 2018-04-03 07:13:58Z gcosmo $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -36,29 +35,11 @@
|
||||
//
|
||||
// Creation date: 01.10.2003
|
||||
//
|
||||
// Modifications:
|
||||
// 30-06-04 make destructor virtual (V.Ivanchenko)
|
||||
// 09-08-04 optimise integral option (V.Ivanchenko)
|
||||
// 11-08-04 add protected methods to access cuts (V.Ivanchenko)
|
||||
// 09-09-04 Bug fix for the integral mode with 2 peaks (V.Ivanchneko)
|
||||
// 16-09-04 Add flag for LambdaTable and method RecalculateLambda (VI)
|
||||
// 08-11-04 Migration to new interface of Store/Retrieve tables (V.Ivantchenko)
|
||||
// 08-04-05 Major optimisation of internal interfaces (V.Ivantchenko)
|
||||
// 18-04-05 Use G4ParticleChangeForGamma (V.Ivantchenko)
|
||||
// 09-05-05 Fix problem in logic when path boundary between materials (VI)
|
||||
// 11-01-06 add A to parameters of ComputeCrossSectionPerAtom (VI)
|
||||
// 01-02-06 put default value A=0. to keep compatibility with v5.2 (mma)
|
||||
// 13-05-06 Add method to access model by index (V.Ivanchenko)
|
||||
// 12-09-06 add SetModel() (mma)
|
||||
// 25-09-07 More accurate handling zero xsect in
|
||||
// PostStepGetPhysicalInteractionLength (V.Ivanchenko)
|
||||
// 27-10-07 Virtual functions moved to source (V.Ivanchenko)
|
||||
// 15-07-08 Reorder class members for further multi-thread development (VI)
|
||||
// 17-02-10 Added pointer currentParticle (VI)
|
||||
// Modifications: Vladimir Ivanchenko
|
||||
//
|
||||
// Class Description:
|
||||
//
|
||||
// It is the unified Discrete process
|
||||
// It is the base class - EM discrete and rest/discrete process
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -77,6 +58,7 @@
|
||||
#include "G4UnitsTable.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4ParticleChangeForGamma.hh"
|
||||
#include "G4EmDataHandler.hh"
|
||||
#include "G4EmParameters.hh"
|
||||
|
||||
class G4Step;
|
||||
@@ -112,7 +94,7 @@ public:
|
||||
|
||||
protected:
|
||||
|
||||
virtual void StreamProcessInfo(std::ostream&, G4String) const {};
|
||||
virtual void StreamProcessInfo(std::ostream&) const {};
|
||||
|
||||
virtual void InitialiseProcess(const G4ParticleDefinition*) = 0;
|
||||
|
||||
@@ -169,17 +151,17 @@ public:
|
||||
|
||||
// It returns the cross section per volume for energy/ material
|
||||
G4double CrossSectionPerVolume(G4double kineticEnergy,
|
||||
const G4MaterialCutsCouple* couple);
|
||||
const G4MaterialCutsCouple* couple);
|
||||
|
||||
// It returns the cross section of the process per atom
|
||||
G4double ComputeCrossSectionPerAtom(G4double kineticEnergy,
|
||||
G4double Z, G4double A=0.,
|
||||
G4double cut=0.0);
|
||||
G4double Z, G4double A=0.,
|
||||
G4double cut=0.0);
|
||||
|
||||
G4double MeanFreePath(const G4Track& track);
|
||||
|
||||
// It returns cross section per volume
|
||||
inline G4double GetLambda(G4double& kinEnergy,
|
||||
inline G4double GetLambda(G4double kinEnergy,
|
||||
const G4MaterialCutsCouple* couple);
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
@@ -215,12 +197,12 @@ public:
|
||||
|
||||
protected:
|
||||
// Select model in run time
|
||||
inline G4VEmModel* SelectModel(G4double& kinEnergy, size_t index);
|
||||
inline G4VEmModel* SelectModel(G4double kinEnergy, size_t index);
|
||||
|
||||
public:
|
||||
// Select model by energy and region index
|
||||
inline G4VEmModel* SelectModelForMaterial(G4double kinEnergy,
|
||||
size_t& idxRegion) const;
|
||||
size_t idxRegion) const;
|
||||
|
||||
// Add model for region, smaller value of order defines which
|
||||
// model will be selected for a given energy interval
|
||||
@@ -259,11 +241,15 @@ public:
|
||||
|
||||
void ActivateSecondaryBiasing(const G4String& region, G4double factor,
|
||||
G4double energyLimit);
|
||||
|
||||
inline void SetEmMasterProcess(const G4VEmProcess*);
|
||||
|
||||
inline void SetIntegral(G4bool val);
|
||||
|
||||
inline void SetBuildTableFlag(G4bool val);
|
||||
|
||||
inline void CurrentSetup(const G4MaterialCutsCouple*, G4double energy);
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// Other generic methods
|
||||
//------------------------------------------------------------------------
|
||||
@@ -321,15 +307,15 @@ private:
|
||||
void BuildLambdaTable();
|
||||
|
||||
void StreamInfo(std::ostream& outFile, const G4ParticleDefinition&,
|
||||
G4String endOfLine=G4String("\n")) const;
|
||||
G4bool rst=false) const;
|
||||
|
||||
void FindLambdaMax();
|
||||
|
||||
void PrintWarning(G4String tit, G4double val);
|
||||
|
||||
inline void DefineMaterial(const G4MaterialCutsCouple* couple);
|
||||
void ComputeIntegralLambda(G4double kinEnergy);
|
||||
|
||||
inline void ComputeIntegralLambda(G4double kinEnergy);
|
||||
inline void DefineMaterial(const G4MaterialCutsCouple* couple);
|
||||
|
||||
inline G4double GetLambdaFromTable(G4double kinEnergy);
|
||||
|
||||
@@ -345,8 +331,6 @@ private:
|
||||
|
||||
// ======== Parameters of the class fixed at construction =========
|
||||
|
||||
G4LossTableManager* lManager;
|
||||
G4EmParameters* theParameters;
|
||||
G4EmModelManager* modelManager;
|
||||
const G4ParticleDefinition* thePositron;
|
||||
const G4ParticleDefinition* secondaryParticle;
|
||||
@@ -397,12 +381,17 @@ private:
|
||||
|
||||
protected:
|
||||
|
||||
G4LossTableManager* lManager;
|
||||
G4EmParameters* theParameters;
|
||||
|
||||
G4EmBiasingManager* biasManager;
|
||||
const G4ParticleDefinition* theGamma;
|
||||
const G4ParticleDefinition* theElectron;
|
||||
G4ParticleChangeForGamma fParticleChange;
|
||||
std::vector<G4DynamicParticle*> secParticles;
|
||||
const G4MaterialCutsCouple* currentCouple;
|
||||
const G4Material* currentMaterial;
|
||||
size_t currentCoupleIndex;
|
||||
|
||||
G4int mainSecondaries;
|
||||
G4int secID;
|
||||
@@ -410,8 +399,16 @@ protected:
|
||||
G4int augerID;
|
||||
G4int biasID;
|
||||
|
||||
G4bool isTheMaster;
|
||||
|
||||
G4double mfpKinEnergy;
|
||||
G4double preStepKinEnergy;
|
||||
G4double preStepLambda;
|
||||
|
||||
private:
|
||||
|
||||
const G4VEmProcess* masterProc;
|
||||
G4EmDataHandler* theData;
|
||||
G4VEmModel* currentModel;
|
||||
|
||||
const G4ParticleDefinition* particle;
|
||||
@@ -419,13 +416,8 @@ private:
|
||||
|
||||
// cache
|
||||
const G4Material* baseMaterial;
|
||||
const G4Material* currentMaterial;
|
||||
size_t currentCoupleIndex;
|
||||
size_t basedCoupleIndex;
|
||||
|
||||
G4double mfpKinEnergy;
|
||||
G4double preStepKinEnergy;
|
||||
G4double preStepLambda;
|
||||
G4double fFactor;
|
||||
G4bool biasFlag;
|
||||
G4bool weightFlag;
|
||||
@@ -473,12 +465,13 @@ inline void G4VEmProcess::DefineMaterial(const G4MaterialCutsCouple* couple)
|
||||
if(couple != currentCouple) {
|
||||
currentCouple = couple;
|
||||
currentMaterial = couple->GetMaterial();
|
||||
baseMaterial = currentMaterial->GetBaseMaterial();
|
||||
baseMaterial = (currentMaterial->GetBaseMaterial())
|
||||
? currentMaterial->GetBaseMaterial() : currentMaterial;
|
||||
currentCoupleIndex = couple->GetIndex();
|
||||
basedCoupleIndex = (*theDensityIdx)[currentCoupleIndex];
|
||||
fFactor = biasFactor*(*theDensityFactor)[currentCoupleIndex];
|
||||
if(!baseMaterial) { baseMaterial = currentMaterial; }
|
||||
mfpKinEnergy = DBL_MAX;
|
||||
preStepKinEnergy = 0.0;
|
||||
idxLambda = idxLambdaPrim = 0;
|
||||
}
|
||||
}
|
||||
@@ -486,7 +479,7 @@ inline void G4VEmProcess::DefineMaterial(const G4MaterialCutsCouple* couple)
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline
|
||||
G4VEmModel* G4VEmProcess::SelectModel(G4double& kinEnergy, size_t index)
|
||||
G4VEmModel* G4VEmProcess::SelectModel(G4double kinEnergy, size_t index)
|
||||
{
|
||||
if(1 < numberOfModels) {
|
||||
currentModel = modelManager->SelectModel(kinEnergy, index);
|
||||
@@ -499,7 +492,7 @@ G4VEmModel* G4VEmProcess::SelectModel(G4double& kinEnergy, size_t index)
|
||||
|
||||
inline
|
||||
G4VEmModel* G4VEmProcess::SelectModelForMaterial(G4double kinEnergy,
|
||||
size_t& idxRegion) const
|
||||
size_t idxRegion) const
|
||||
{
|
||||
return modelManager->SelectModel(kinEnergy, idxRegion);
|
||||
}
|
||||
@@ -530,21 +523,29 @@ inline G4double G4VEmProcess::ComputeCurrentLambda(G4double e)
|
||||
|
||||
inline G4double G4VEmProcess::GetCurrentLambda(G4double e)
|
||||
{
|
||||
G4double x;
|
||||
G4double x(0.0);
|
||||
if(e >= minKinEnergyPrim) { x = GetLambdaFromTablePrim(e); }
|
||||
else if(theLambdaTable) { x = GetLambdaFromTable(e); }
|
||||
else { x = ComputeCurrentLambda(e); }
|
||||
else if(currentModel) { x = ComputeCurrentLambda(e); }
|
||||
return fFactor*x;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4double
|
||||
G4VEmProcess::GetLambda(G4double& kinEnergy,
|
||||
const G4MaterialCutsCouple* couple)
|
||||
inline void
|
||||
G4VEmProcess::CurrentSetup(const G4MaterialCutsCouple* couple, G4double energy)
|
||||
{
|
||||
DefineMaterial(couple);
|
||||
SelectModel(kinEnergy, currentCoupleIndex);
|
||||
SelectModel(energy, currentCoupleIndex);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4double
|
||||
G4VEmProcess::GetLambda(G4double kinEnergy,
|
||||
const G4MaterialCutsCouple* couple)
|
||||
{
|
||||
CurrentSetup(couple, kinEnergy);
|
||||
return GetCurrentLambda(kinEnergy);
|
||||
}
|
||||
|
||||
@@ -553,34 +554,10 @@ G4VEmProcess::GetLambda(G4double& kinEnergy,
|
||||
inline G4double
|
||||
G4VEmProcess::RecalculateLambda(G4double e, const G4MaterialCutsCouple* couple)
|
||||
{
|
||||
DefineMaterial(couple);
|
||||
SelectModel(e, currentCoupleIndex);
|
||||
CurrentSetup(couple, e);
|
||||
return fFactor*ComputeCurrentLambda(e);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline void G4VEmProcess::ComputeIntegralLambda(G4double e)
|
||||
{
|
||||
mfpKinEnergy = theEnergyOfCrossSectionMax[currentCoupleIndex];
|
||||
if (e <= mfpKinEnergy) {
|
||||
preStepLambda = GetCurrentLambda(e);
|
||||
|
||||
} else {
|
||||
G4double e1 = e*lambdaFactor;
|
||||
if(e1 > mfpKinEnergy) {
|
||||
preStepLambda = GetCurrentLambda(e);
|
||||
G4double preStepLambda1 = GetCurrentLambda(e1);
|
||||
if(preStepLambda1 > preStepLambda) {
|
||||
mfpKinEnergy = e1;
|
||||
preStepLambda = preStepLambda1;
|
||||
}
|
||||
} else {
|
||||
preStepLambda = fFactor*theCrossSectionMax[currentCoupleIndex];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ======== Get/Set inline methods used at initialisation ================
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -727,4 +704,11 @@ inline const G4VEmModel* G4VEmProcess::GetCurrentModel() const
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline void G4VEmProcess::SetEmMasterProcess(const G4VEmProcess* ptr)
|
||||
{
|
||||
masterProc = ptr;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user