Import Geant4 6.0.0 source tree
This commit is contained in:
@@ -20,6 +20,8 @@
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4EmModelManager.cc,v 1.20 2003/11/03 19:37:59 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -42,6 +44,10 @@
|
||||
// 06-03-03 Fix in energy intervals for models (V.Ivanchenko)
|
||||
// 13-04-03 Add startFromNull (V.Ivanchenko)
|
||||
// 13-05-03 Add calculation of precise range (V.Ivanchenko)
|
||||
// 16-07-03 Replace G4Material by G4MaterialCutCouple in dE/dx and CrossSection
|
||||
// calculation (V.Ivanchenko)
|
||||
// 21-07-03 Add UpdateEmModel method (V.Ivanchenko)
|
||||
// 03-11-03 Substitute STL vector for G4RegionModels (V.Ivanchenko)
|
||||
//
|
||||
// Class Description:
|
||||
//
|
||||
@@ -96,6 +102,8 @@ G4EmModelManager::G4EmModelManager():
|
||||
nEmModels(0),
|
||||
nRegions(0),
|
||||
nCouples(0),
|
||||
idxOfRegionModels(0),
|
||||
setOfRegionModels(0),
|
||||
minSubRange(0.1),
|
||||
particle(0),
|
||||
verboseLevel(0)
|
||||
@@ -150,8 +158,15 @@ void G4EmModelManager::Clear()
|
||||
theCuts.clear();
|
||||
theSubCuts.clear();
|
||||
upperEkin.clear();
|
||||
idxOfRegionModels.clear();
|
||||
setOfRegionModels.clear();
|
||||
if(idxOfRegionModels) delete [] idxOfRegionModels;
|
||||
if(setOfRegionModels && nRegions) {
|
||||
for(G4int i=0; i<nRegions; i++) {
|
||||
delete (setOfRegionModels[i]);
|
||||
}
|
||||
delete [] setOfRegionModels;
|
||||
}
|
||||
idxOfRegionModels = 0;
|
||||
setOfRegionModels = 0;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -167,6 +182,7 @@ void G4EmModelManager::AddEmModel(G4int num, G4VEmModel* p,
|
||||
flucModels.push_back(fm);
|
||||
regions.push_back(r);
|
||||
orderOfModels.push_back(num);
|
||||
p->DefineForRegion(r);
|
||||
if (nEmModels) {
|
||||
G4int idx = nEmModels;
|
||||
do {idx--;} while (idx && num < orderOfModels[idx]);
|
||||
@@ -187,11 +203,34 @@ void G4EmModelManager::AddEmModel(G4int num, G4VEmModel* p,
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void G4EmModelManager::UpdateEmModel(const G4String& nam, G4double emin, G4double emax)
|
||||
{
|
||||
if (nEmModels) {
|
||||
for(G4int i=0; i<nEmModels; i++) {
|
||||
if(nam == models[i]->GetName()) {
|
||||
models[i]->SetLowEnergyLimit(emin);
|
||||
models[i]->SetHighEnergyLimit(emax);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
G4cout << "G4EmModelManager::UpdateEmModel WARNING: no model <"
|
||||
<< nam << "> is found out"
|
||||
<< G4endl;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
const G4DataVector* G4EmModelManager::Initialise(const G4ParticleDefinition* p,
|
||||
const G4ParticleDefinition* sp,
|
||||
G4double theMinSubRange,
|
||||
G4int val)
|
||||
{
|
||||
if(0 < verboseLevel) {
|
||||
G4cout << "G4EmModelManager::Initialise() for "
|
||||
<< p->GetParticleName()
|
||||
<< G4endl;
|
||||
}
|
||||
// Are models defined?
|
||||
if(!nEmModels) {
|
||||
G4Exception("G4EmModelManager::Initialise without any model defined");
|
||||
@@ -201,11 +240,6 @@ const G4DataVector* G4EmModelManager::Initialise(const G4ParticleDefinition* p,
|
||||
minSubRange = theMinSubRange;
|
||||
verboseLevel = val;
|
||||
|
||||
if(0 < verboseLevel) {
|
||||
G4cout << "### G4EmModelManager::Initialise() for "
|
||||
<< p->GetParticleName()
|
||||
<< G4endl;
|
||||
}
|
||||
Clear();
|
||||
|
||||
G4RegionStore* regionStore = G4RegionStore::GetInstance();
|
||||
@@ -232,11 +266,11 @@ const G4DataVector* G4EmModelManager::Initialise(const G4ParticleDefinition* p,
|
||||
}
|
||||
}
|
||||
|
||||
setOfRegionModels.clear();
|
||||
const G4ProductionCutsTable* theCoupleTable=
|
||||
G4ProductionCutsTable::GetProductionCutsTable();
|
||||
size_t numOfCouples = theCoupleTable->GetTableSize();
|
||||
idxOfRegionModels.resize(numOfCouples);
|
||||
idxOfRegionModels = new G4int[numOfCouples];
|
||||
setOfRegionModels = new G4RegionModels*[nRegions];
|
||||
upperEkin.resize(nEmModels);
|
||||
|
||||
// Order models for regions
|
||||
@@ -283,12 +317,14 @@ const G4DataVector* G4EmModelManager::Initialise(const G4ParticleDefinition* p,
|
||||
}
|
||||
eLow[0] = 0.0;
|
||||
|
||||
if(1 < verboseLevel) {
|
||||
if(0 < verboseLevel) {
|
||||
G4cout << "New G4RegionModels set with " << n << " models for region <"
|
||||
<< region->GetName() << "> " << G4endl;
|
||||
<< region->GetName() << "> Elow(MeV)= ";
|
||||
for(G4int ii=0; ii<n; ii++) {G4cout << eLow[ii]/MeV << " ";}
|
||||
G4cout << G4endl;
|
||||
}
|
||||
G4RegionModels* rm = new G4RegionModels(n, modelAtRegion, eLow);
|
||||
setOfRegionModels.push_back(rm);
|
||||
setOfRegionModels[reg] = rm;
|
||||
}
|
||||
|
||||
// Access to materials and build cuts
|
||||
@@ -302,9 +338,13 @@ const G4DataVector* G4EmModelManager::Initialise(const G4ParticleDefinition* p,
|
||||
do {reg--;} while (reg>0 && pcuts != (set[reg]->GetProductionCuts()));
|
||||
idxOfRegionModels[i] = reg;
|
||||
|
||||
if(1 < verboseLevel) {
|
||||
if(0 < verboseLevel) {
|
||||
G4cout << "G4EmModelManager::Initialise() for "
|
||||
<< material->GetName() << G4endl;
|
||||
<< material->GetName()
|
||||
<< " indexOfCouple= " << i
|
||||
<< " indexOfRegion= " << reg
|
||||
<< " indexOfRegion= " << reg
|
||||
<< G4endl;
|
||||
}
|
||||
|
||||
G4double cut = 0.0;
|
||||
@@ -339,12 +379,12 @@ const G4DataVector* G4EmModelManager::Initialise(const G4ParticleDefinition* p,
|
||||
|
||||
for(G4int jj=0; jj<nEmModels; jj++) {
|
||||
models[jj]->Initialise(particle, theCuts);
|
||||
if(flucModels[jj]) flucModels[jj]->Initialise(particle);
|
||||
if(flucModels[jj]) flucModels[jj]->InitialiseMe(particle);
|
||||
}
|
||||
|
||||
|
||||
if(0 < verboseLevel) {
|
||||
G4cout << "G4EmModelManager is initialised "
|
||||
G4cout << "G4EmModelManager is initialised; nRegions= " << nRegions
|
||||
<< G4endl;
|
||||
}
|
||||
|
||||
@@ -364,13 +404,12 @@ void G4EmModelManager::FillDEDXVector(G4PhysicsVector* aVector,
|
||||
|
||||
G4double e;
|
||||
|
||||
const G4Material* material = couple->GetMaterial();
|
||||
size_t i = couple->GetIndex();
|
||||
G4double cut = theCuts[i];
|
||||
|
||||
if(0 < verboseLevel) {
|
||||
G4cout << "G4EmModelManager::FillDEDXVector() for "
|
||||
<< material->GetName()
|
||||
<< couple->GetMaterial()->GetName()
|
||||
<< " Ecut(MeV)= " << cut/MeV
|
||||
<< G4endl;
|
||||
}
|
||||
@@ -385,7 +424,7 @@ void G4EmModelManager::FillDEDXVector(G4PhysicsVector* aVector,
|
||||
|
||||
if(0 < verboseLevel) {
|
||||
G4cout << "There are " << nmod << " models for "
|
||||
<< material->GetName()
|
||||
<< couple->GetMaterial()->GetName()
|
||||
<< " at the region #" << reg
|
||||
<< G4endl;
|
||||
}
|
||||
@@ -400,15 +439,15 @@ void G4EmModelManager::FillDEDXVector(G4PhysicsVector* aVector,
|
||||
dedxLow[0] = 0.0;
|
||||
|
||||
e = upperEkin[regModels->ModelIndex(0)];
|
||||
dedxHigh[0] = models[regModels->ModelIndex(0)]->ComputeDEDX(material,particle,e,cut);
|
||||
dedxHigh[0] = models[regModels->ModelIndex(0)]->ComputeDEDX(couple,particle,e,cut);
|
||||
|
||||
if(nmod > 1) {
|
||||
for(j=1; j<nmod; j++) {
|
||||
|
||||
e = upperEkin[regModels->ModelIndex(j-1)];
|
||||
dedxLow[j] = models[regModels->ModelIndex(j)]->ComputeDEDX(material,particle,e,cut);
|
||||
dedxLow[j] = models[regModels->ModelIndex(j)]->ComputeDEDX(couple,particle,e,cut);
|
||||
e = upperEkin[regModels->ModelIndex(j)];
|
||||
dedxHigh[j] = models[regModels->ModelIndex(j)]->ComputeDEDX(material,particle,e,cut);
|
||||
dedxHigh[j] = models[regModels->ModelIndex(j)]->ComputeDEDX(couple,particle,e,cut);
|
||||
}
|
||||
|
||||
for(j=1; j<nmod; j++) {
|
||||
@@ -436,11 +475,11 @@ void G4EmModelManager::FillDEDXVector(G4PhysicsVector* aVector,
|
||||
} while (k<nmod-1 && e < upperEkin[regModels->ModelIndex(k)] );
|
||||
}
|
||||
|
||||
G4double dedx = models[regModels->ModelIndex(k)]->ComputeDEDX(material,particle,e,cut)*fac;
|
||||
G4double dedx = models[regModels->ModelIndex(k)]->ComputeDEDX(couple,particle,e,cut)*fac;
|
||||
|
||||
if(dedx < 0.0) dedx = 0.0;
|
||||
if(1 < verboseLevel) {
|
||||
G4cout << "Material= " << material->GetName()
|
||||
G4cout << "Material= " << couple->GetMaterial()->GetName()
|
||||
<< " E(MeV)= " << e/MeV
|
||||
<< " dEdx(MeV/mm)= " << dedx*mm/MeV
|
||||
<< " fac= " << fac
|
||||
@@ -465,12 +504,11 @@ void G4EmModelManager::FillDEDXVectorForPreciseRange(
|
||||
|
||||
G4double e;
|
||||
|
||||
const G4Material* material = couple->GetMaterial();
|
||||
size_t i = couple->GetIndex();
|
||||
|
||||
if(0 < verboseLevel) {
|
||||
G4cout << "G4EmModelManager::FillDEDXVector() for "
|
||||
<< material->GetName()
|
||||
<< couple->GetMaterial()->GetName()
|
||||
<< G4endl;
|
||||
}
|
||||
|
||||
@@ -484,7 +522,7 @@ void G4EmModelManager::FillDEDXVectorForPreciseRange(
|
||||
|
||||
if(0 < verboseLevel) {
|
||||
G4cout << "There are " << nmod << " models for "
|
||||
<< material->GetName()
|
||||
<< couple->GetMaterial()->GetName()
|
||||
<< " at the region #" << reg
|
||||
<< G4endl;
|
||||
}
|
||||
@@ -499,15 +537,15 @@ void G4EmModelManager::FillDEDXVectorForPreciseRange(
|
||||
dedxLow[0] = 0.0;
|
||||
|
||||
e = upperEkin[regModels->ModelIndex(0)];
|
||||
dedxHigh[0] = models[regModels->ModelIndex(0)]->ComputeDEDX(material,particle,e,e);
|
||||
dedxHigh[0] = models[regModels->ModelIndex(0)]->ComputeDEDX(couple,particle,e,e);
|
||||
|
||||
if(nmod > 1) {
|
||||
for(j=1; j<nmod; j++) {
|
||||
|
||||
e = upperEkin[regModels->ModelIndex(j-1)];
|
||||
dedxLow[j] = models[regModels->ModelIndex(j)]->ComputeDEDX(material,particle,e,e);
|
||||
dedxLow[j] = models[regModels->ModelIndex(j)]->ComputeDEDX(couple,particle,e,e);
|
||||
e = upperEkin[regModels->ModelIndex(j)];
|
||||
dedxHigh[j] = models[regModels->ModelIndex(j)]->ComputeDEDX(material,particle,e,e);
|
||||
dedxHigh[j] = models[regModels->ModelIndex(j)]->ComputeDEDX(couple,particle,e,e);
|
||||
}
|
||||
|
||||
for(j=1; j<nmod; j++) {
|
||||
@@ -535,11 +573,11 @@ void G4EmModelManager::FillDEDXVectorForPreciseRange(
|
||||
} while (k<nmod-1 && e < upperEkin[regModels->ModelIndex(k)] );
|
||||
}
|
||||
|
||||
G4double dedx = models[regModels->ModelIndex(k)]->ComputeDEDX(material,particle,e,e)*fac;
|
||||
G4double dedx = models[regModels->ModelIndex(k)]->ComputeDEDX(couple,particle,e,e)*fac;
|
||||
|
||||
if(dedx < 0.0) dedx = 0.0;
|
||||
if(1 < verboseLevel) {
|
||||
G4cout << "Material= " << material->GetName()
|
||||
G4cout << "Material= " << couple->GetMaterial()->GetName()
|
||||
<< " E(MeV)= " << e/MeV
|
||||
<< " dEdx(MeV/mm)= " << dedx*mm/MeV
|
||||
<< " fac= " << fac
|
||||
@@ -563,12 +601,10 @@ void G4EmModelManager::FillLambdaVector(G4PhysicsVector* aVector,
|
||||
|
||||
G4double e;
|
||||
|
||||
const G4Material* material = couple->GetMaterial();
|
||||
|
||||
if(0 < verboseLevel) {
|
||||
G4cout << "G4EmModelManager::FillLambdaVector() for particle "
|
||||
<< particle->GetParticleName()
|
||||
<< " in " << material->GetName()
|
||||
<< " in " << couple->GetMaterial()->GetName()
|
||||
<< G4endl;
|
||||
}
|
||||
|
||||
@@ -585,7 +621,7 @@ void G4EmModelManager::FillLambdaVector(G4PhysicsVector* aVector,
|
||||
|
||||
if(1 < verboseLevel) {
|
||||
G4cout << "There are " << nmod << " models for "
|
||||
<< material->GetName() << G4endl;
|
||||
<< couple->GetMaterial()->GetName() << G4endl;
|
||||
}
|
||||
|
||||
// calculate factors to provide continuity of energy loss
|
||||
@@ -598,7 +634,7 @@ void G4EmModelManager::FillLambdaVector(G4PhysicsVector* aVector,
|
||||
e = upperEkin[regModels->ModelIndex(0)];
|
||||
|
||||
if(1 < verboseLevel) {
|
||||
G4cout << "### For material " << material->GetName()
|
||||
G4cout << "### For material " << couple->GetMaterial()->GetName()
|
||||
<< " " << nmod
|
||||
<< " models"
|
||||
<< " Ecut(MeV)= " << cut/MeV
|
||||
@@ -607,16 +643,16 @@ void G4EmModelManager::FillLambdaVector(G4PhysicsVector* aVector,
|
||||
<< G4endl;
|
||||
}
|
||||
|
||||
sigmaHigh[0] = models[regModels->ModelIndex(0)]->CrossSection(material,particle,e,cut,e);
|
||||
sigmaHigh[0] = models[regModels->ModelIndex(0)]->CrossSection(couple,particle,e,cut,e);
|
||||
|
||||
if(nmod > 1) {
|
||||
|
||||
for(j=1; j<nmod; j++) {
|
||||
|
||||
e = upperEkin[regModels->ModelIndex(j-1)];
|
||||
sigmaLow[j] = models[regModels->ModelIndex(j)]->CrossSection(material,particle,e,cut,e);
|
||||
sigmaLow[j] = models[regModels->ModelIndex(j)]->CrossSection(couple,particle,e,cut,e);
|
||||
e = upperEkin[regModels->ModelIndex(j)];
|
||||
sigmaHigh[j] = models[regModels->ModelIndex(j)]->CrossSection(material,particle,e,cut,e);
|
||||
sigmaHigh[j] = models[regModels->ModelIndex(j)]->CrossSection(couple,particle,e,cut,e);
|
||||
}
|
||||
for(j=1; j<nmod; j++) {
|
||||
if(sigmaLow[j] > 0.0) factor[j] = (sigmaHigh[j-1]/sigmaLow[j] - 1.0);
|
||||
@@ -639,7 +675,7 @@ void G4EmModelManager::FillLambdaVector(G4PhysicsVector* aVector,
|
||||
} while (k<nmod-1 && e < upperEkin[regModels->ModelIndex(k)] );
|
||||
}
|
||||
|
||||
G4double cross = models[regModels->ModelIndex(k)]->CrossSection(material,particle,e,cut,e)*fac;
|
||||
G4double cross = models[regModels->ModelIndex(k)]->CrossSection(couple,particle,e,cut,e)*fac;
|
||||
if(j==0 && startFromNull) cross = 0.0;
|
||||
|
||||
if(1 < verboseLevel) {
|
||||
@@ -673,7 +709,6 @@ void G4EmModelManager::FillSubLambdaVector(G4PhysicsVector* aVector,
|
||||
|
||||
G4double e;
|
||||
|
||||
const G4Material* material = couple->GetMaterial();
|
||||
size_t i = couple->GetIndex();
|
||||
G4double cut = theCuts[i];
|
||||
G4double subcut = theSubCuts[i];
|
||||
@@ -687,7 +722,7 @@ void G4EmModelManager::FillSubLambdaVector(G4PhysicsVector* aVector,
|
||||
|
||||
if(0 < verboseLevel) {
|
||||
G4cout << "There are " << nmod << " models for "
|
||||
<< material->GetName() << G4endl;
|
||||
<< couple->GetMaterial()->GetName() << G4endl;
|
||||
}
|
||||
|
||||
// calculate factors to provide continuity of energy loss
|
||||
@@ -701,7 +736,7 @@ void G4EmModelManager::FillSubLambdaVector(G4PhysicsVector* aVector,
|
||||
|
||||
|
||||
if(1 < verboseLevel) {
|
||||
G4cout << "### For material " << material->GetName()
|
||||
G4cout << "### For material " << couple->GetMaterial()->GetName()
|
||||
<< " are available " << nmod
|
||||
<< " models"
|
||||
<< " Ecut(MeV)= " << cut/MeV
|
||||
@@ -709,16 +744,16 @@ void G4EmModelManager::FillSubLambdaVector(G4PhysicsVector* aVector,
|
||||
<< G4endl;
|
||||
}
|
||||
|
||||
sigmaHigh[0] = models[regModels->ModelIndex(0)]->CrossSection(material,particle,e,subcut,cut);
|
||||
sigmaHigh[0] = models[regModels->ModelIndex(0)]->CrossSection(couple,particle,e,subcut,cut);
|
||||
|
||||
if(nmod > 1) {
|
||||
|
||||
for(j=1; j<nmod; j++) {
|
||||
|
||||
e = upperEkin[regModels->ModelIndex(j-1)];
|
||||
sigmaLow[j] = models[regModels->ModelIndex(j)]->CrossSection(material,particle,e,subcut,cut);
|
||||
sigmaLow[j] = models[regModels->ModelIndex(j)]->CrossSection(couple,particle,e,subcut,cut);
|
||||
e = upperEkin[regModels->ModelIndex(j)];
|
||||
sigmaHigh[j] = models[regModels->ModelIndex(j)]->CrossSection(material,particle,e,subcut,cut);
|
||||
sigmaHigh[j] = models[regModels->ModelIndex(j)]->CrossSection(couple,particle,e,subcut,cut);
|
||||
}
|
||||
for(j=1; j<nmod; j++) {
|
||||
if(sigmaLow[j] > 0.0) factor[j] = (sigmaHigh[j-1]/sigmaLow[j] - 1.0);
|
||||
@@ -741,7 +776,7 @@ void G4EmModelManager::FillSubLambdaVector(G4PhysicsVector* aVector,
|
||||
} while (k<nmod-1 && e < upperEkin[regModels->ModelIndex(k)] );
|
||||
}
|
||||
|
||||
G4double cross=models[regModels->ModelIndex(k)]->CrossSection(material,particle,e,subcut,cut)*fac;
|
||||
G4double cross=models[regModels->ModelIndex(k)]->CrossSection(couple,particle,e,subcut,cut)*fac;
|
||||
if(j==0 && startFromNull) cross = 0.0;
|
||||
|
||||
if(1 < verboseLevel) {
|
||||
|
||||
Reference in New Issue
Block a user