Import Geant4 9.4.0 source tree
This commit is contained in:
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4PenelopeIonisationModel.cc,v 1.10 2009/10/23 09:29:24 pandola Exp $
|
||||
// GEANT4 tag $Name: geant4-09-03 $
|
||||
// $Id: G4PenelopeIonisationModel.cc,v 1.18 2010/12/01 15:20:35 pandola Exp $
|
||||
// GEANT4 tag $Name: geant4-09-04 $
|
||||
//
|
||||
// Author: Luciano Pandola
|
||||
//
|
||||
@@ -41,6 +41,13 @@
|
||||
// 21 Oct 2009 L Pandola Remove un-necessary fUseAtomicDeexcitation flag - now managed by
|
||||
// G4VEmModel::DeexcitationFlag()
|
||||
// Add ActivateAuger() method
|
||||
// 15 Mar 2010 L Pandola Explicitely initialize Auger to false
|
||||
// 29 Mar 2010 L Pandola Added a dummy ComputeCrossSectionPerAtom() method issueing a
|
||||
// warning if users try to access atomic cross sections via
|
||||
// G4EmCalculator
|
||||
// 15 Apr 2010 L. Pandola Implemented model's own version of MinEnergyCut()
|
||||
// 23 Apr 2010 L. Pandola Removed InitialiseElementSelectors() call. Useless here and
|
||||
// triggers fake warning messages
|
||||
//
|
||||
|
||||
#include "G4PenelopeIonisationModel.hh"
|
||||
@@ -79,8 +86,7 @@ G4PenelopeIonisationModel::G4PenelopeIonisationModel(const G4ParticleDefinition*
|
||||
// SetLowEnergyLimit(fIntrinsicLowEnergyLimit);
|
||||
SetHighEnergyLimit(fIntrinsicHighEnergyLimit);
|
||||
//
|
||||
// Atomic deexcitation model activated by default
|
||||
SetDeexcitationFlag(true);
|
||||
//
|
||||
verboseLevel= 0;
|
||||
|
||||
// Verbosity scale:
|
||||
@@ -89,6 +95,10 @@ G4PenelopeIonisationModel::G4PenelopeIonisationModel(const G4ParticleDefinition*
|
||||
// 2 = details of energy budget
|
||||
// 3 = calculation of cross sections, file openings, sampling of atoms
|
||||
// 4 = entering in methods
|
||||
|
||||
// Atomic deexcitation model activated by default
|
||||
SetDeexcitationFlag(true);
|
||||
ActivateAuger(false);
|
||||
|
||||
//These vectors do not change when materials or cut change.
|
||||
//Therefore I can read it at the constructor
|
||||
@@ -117,29 +127,36 @@ G4PenelopeIonisationModel::~G4PenelopeIonisationModel()
|
||||
|
||||
|
||||
std::map <G4int,G4DataVector*>::iterator i;
|
||||
for (i=ionizationEnergy->begin();i != ionizationEnergy->end();i++)
|
||||
if (i->second) delete i->second;
|
||||
for (i=resonanceEnergy->begin();i != resonanceEnergy->end();i++)
|
||||
if (i->second) delete i->second;
|
||||
for (i=occupationNumber->begin();i != occupationNumber->end();i++)
|
||||
if (i->second) delete i->second;
|
||||
for (i=shellFlag->begin();i != shellFlag->end();i++)
|
||||
if (i->second) delete i->second;
|
||||
|
||||
if (ionizationEnergy)
|
||||
delete ionizationEnergy;
|
||||
{
|
||||
for (i=ionizationEnergy->begin();i != ionizationEnergy->end();i++)
|
||||
if (i->second) delete i->second;
|
||||
delete ionizationEnergy;
|
||||
}
|
||||
if (resonanceEnergy)
|
||||
delete resonanceEnergy;
|
||||
{
|
||||
for (i=resonanceEnergy->begin();i != resonanceEnergy->end();i++)
|
||||
if (i->second) delete i->second;
|
||||
delete resonanceEnergy;
|
||||
}
|
||||
if (occupationNumber)
|
||||
delete occupationNumber;
|
||||
{
|
||||
for (i=occupationNumber->begin();i != occupationNumber->end();i++)
|
||||
if (i->second) delete i->second;
|
||||
delete occupationNumber;
|
||||
}
|
||||
if (shellFlag)
|
||||
delete shellFlag;
|
||||
{
|
||||
for (i=shellFlag->begin();i != shellFlag->end();i++)
|
||||
if (i->second) delete i->second;
|
||||
delete shellFlag;
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void G4PenelopeIonisationModel::Initialise(const G4ParticleDefinition* particle,
|
||||
const G4DataVector& cuts)
|
||||
const G4DataVector& )
|
||||
{
|
||||
if (verboseLevel > 3)
|
||||
G4cout << "Calling G4PenelopeIonisationModel::Initialise()" << G4endl;
|
||||
@@ -173,10 +190,12 @@ void G4PenelopeIonisationModel::Initialise(const G4ParticleDefinition* particle,
|
||||
crossSectionFile = "penelope/ion-cs-po-";
|
||||
crossSectionHandler->LoadData(crossSectionFile);
|
||||
//This is used to retrieve cross section values later on
|
||||
crossSectionHandler->BuildMeanFreePathForMaterials();
|
||||
G4VEMDataSet* emdata =
|
||||
crossSectionHandler->BuildMeanFreePathForMaterials();
|
||||
//The method BuildMeanFreePathForMaterials() is required here only to force
|
||||
//the building of an internal table: the output pointer can be deleted
|
||||
delete emdata;
|
||||
|
||||
InitialiseElementSelectors(particle,cuts);
|
||||
|
||||
if (verboseLevel > 2)
|
||||
G4cout << "Loaded cross section files for PenelopeIonisationModel" << G4endl;
|
||||
|
||||
@@ -279,6 +298,25 @@ G4double G4PenelopeIonisationModel::CrossSectionPerVolume(const G4Material* mate
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
//This is a dummy method. Never inkoved by the tracking, it just issues
|
||||
//a warning if one tries to get Cross Sections per Atom via the
|
||||
//G4EmCalculator.
|
||||
G4double G4PenelopeIonisationModel::ComputeCrossSectionPerAtom(const G4ParticleDefinition*,
|
||||
G4double,
|
||||
G4double,
|
||||
G4double,
|
||||
G4double,
|
||||
G4double)
|
||||
{
|
||||
G4cout << "*** G4PenelopeIonisationModel -- WARNING ***" << G4endl;
|
||||
G4cout << "Penelope Ionisation model does not calculate cross section _per atom_ " << G4endl;
|
||||
G4cout << "so the result is always zero. For physics values, please invoke " << G4endl;
|
||||
G4cout << "GetCrossSectionPerVolume() or GetMeanFreePath() via the G4EmCalculator" << G4endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4double G4PenelopeIonisationModel::ComputeDEDXPerVolume(const G4Material* material,
|
||||
const G4ParticleDefinition* theParticle,
|
||||
G4double kineticEnergy,
|
||||
@@ -351,6 +389,14 @@ G4double G4PenelopeIonisationModel::ComputeDEDXPerVolume(const G4Material* mater
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4double G4PenelopeIonisationModel::MinEnergyCut(const G4ParticleDefinition*,
|
||||
const G4MaterialCutsCouple*)
|
||||
{
|
||||
return fIntrinsicLowEnergyLimit;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void G4PenelopeIonisationModel::SampleSecondaries(std::vector<G4DynamicParticle*>* fvect,
|
||||
const G4MaterialCutsCouple* couple,
|
||||
const G4DynamicParticle* aDynamicParticle,
|
||||
@@ -598,6 +644,7 @@ void G4PenelopeIonisationModel::ReadData()
|
||||
{
|
||||
G4String excep = "G4PenelopeIonisationModel - G4LEDATA environment variable not set!";
|
||||
G4Exception(excep);
|
||||
return;
|
||||
}
|
||||
G4String pathString(path);
|
||||
G4String pathFile = pathString + "/penelope/ion-pen.dat";
|
||||
@@ -613,17 +660,27 @@ void G4PenelopeIonisationModel::ReadData()
|
||||
{
|
||||
G4String excep = "G4PenelopeIonisationModel: problem with reading data from file";
|
||||
G4Exception(excep);
|
||||
return;
|
||||
}
|
||||
|
||||
G4int Z=1,nLevels=0;
|
||||
G4int test,test1;
|
||||
|
||||
do{
|
||||
file >> Z >> nLevels;
|
||||
//Check for nLevels validity, before using it in a loop
|
||||
if (nLevels<0 || nLevels>64)
|
||||
{
|
||||
G4String excep = "G4PenelopeIonisationModel: corrupted data file ?";
|
||||
G4Exception(excep);
|
||||
return;
|
||||
}
|
||||
//Allocate space for storage
|
||||
G4DataVector* occVector = new G4DataVector;
|
||||
G4DataVector* ionEVector = new G4DataVector;
|
||||
G4DataVector* resEVector = new G4DataVector;
|
||||
G4DataVector* shellIndVector = new G4DataVector;
|
||||
file >> Z >> nLevels;
|
||||
//
|
||||
G4double a1,a2,a3,a4;
|
||||
G4int k1,k2,k3;
|
||||
for (G4int h=0;h<nLevels;h++)
|
||||
@@ -1623,6 +1680,7 @@ G4PenelopeIonisationModel::BuildCrossSectionTable(const G4ParticleDefinition* th
|
||||
std::vector<G4VEMDataSet*>* set = new std::vector<G4VEMDataSet*>;
|
||||
|
||||
size_t nOfBins = 200;
|
||||
//Temporary vector, a quick way to produce a log-spaced energy grid
|
||||
G4PhysicsLogVector* theLogVector = new G4PhysicsLogVector(LowEnergyLimit(),
|
||||
HighEnergyLimit(),
|
||||
nOfBins);
|
||||
@@ -1676,6 +1734,7 @@ G4PenelopeIonisationModel::BuildCrossSectionTable(const G4ParticleDefinition* th
|
||||
}
|
||||
set->push_back(setForMat);
|
||||
}
|
||||
delete theLogVector;
|
||||
return set;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user