47 fCrossSectionHandler(nullptr)
58 fLowEnergyLimit = 10.0*eV;
59 fHighEnergyLimit = 100.0*GeV;
68 if (fCrossSectionHandler)
69 delete fCrossSectionHandler;
80 if (fVerboseLevel > 1)
81 G4cout <<
"Entering in method G4PenelopeIonisationCrossSection::CrossSection()" <<
G4endl;
90 ed <<
"The method has been called with a null G4Material pointer" <<
G4endl;
91 G4Exception(
"G4PenelopeIonisationCrossSection::CrossSection()",
"em2042",
96 if (!fCrossSectionHandler)
103 if(
G4int(shell) < nmax &&
104 incidentEnergy >= fLowEnergyLimit && incidentEnergy <= fHighEnergyLimit)
110 G4int index = FindShellIDIndex(material,
Z,shell);
127 ed <<
"There is something wrong here: it looks like the index is wrong" <<
G4endl;
128 ed <<
"Requested: shell " <<
G4int(shell) <<
" and Z = " <<
Z <<
G4endl;
130 G4Exception(
"G4PenelopeIonisationCrossSection::CrossSection()",
"em2043",
141 cross = crossPerMolecule/atomsPerMolec;
143 if (fVerboseLevel > 0)
145 G4cout <<
"Cross section of shell " <<
G4int(shell) <<
" and Z= " <<
Z;
146 G4cout <<
" of material: " << material->
GetName() <<
" and energy = " << incidentEnergy/keV <<
" keV" <<
G4endl;
150 if (fVerboseLevel > 2)
152 G4cout <<
"Cross section per molecule: " << crossPerMolecule/barn <<
" barn" <<
G4endl;
153 G4cout <<
"Atoms " <<
Z <<
" per molecule: " << atomsPerMolec <<
G4endl;
169 std::vector<G4double> vec(nmax,0.0);
170 for(
G4int i=0; i<nmax; ++i) {
186 size_t n = vec.size();
189 for(i=0; i<n; ++i) { sum += vec[i]; }
192 for(i=0; i<n; ++i) { vec[i] = vec[i]*sum; }
199G4int G4PenelopeIonisationCrossSection::FindShellIDIndex(
const G4Material* mat,
203 if (fVerboseLevel > 1)
204 G4cout <<
"Entering in method G4PenelopeIonisationCrossSection::FindShellIDIndex()" <<
G4endl;
207 fShellIDTable =
new std::map< std::pair<const G4Material*,G4int>,
G4DataVector*>;
209 std::pair<const G4Material*,G4int> theKey = std::make_pair(mat,
Z);
213 if (fShellIDTable->count(theKey))
215 if (fVerboseLevel > 2)
217 G4DataVector* theVec = fShellIDTable->find(theKey)->second;
219 if (ishell>=0 && ishell < (
G4int) theVec->size())
220 result = (
G4int) (*theVec)[ishell];
224 ed <<
"Shell ID: " << ishell <<
" not available for material " << mat->
GetName() <<
" and Z = " <<
233 if (fVerboseLevel > 2)
237 size_t numberOfOscillators = theTable->size();
242 for (
size_t iosc=0;iosc<numberOfOscillators;iosc++)
253 if ((shFlag-1) == ishell)
254 result = (
G4int) iosc;
257 fShellIDTable->insert(std::make_pair(theKey,dat));
260 if (fVerboseLevel > 1)
261 G4cout <<
"Leaving method G4PenelopeIonisationCrossSection::FindShellIDIndex() with index = "
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
std::vector< G4PenelopeOscillator * > G4PenelopeOscillatorTable
G4GLOB_DLL std::ostream G4cout
G4int NumberOfShells(G4int Z) const
static G4AtomicTransitionManager * Instance()
static G4Electron * Electron()
const G4String & GetName() const
G4double GetShellCrossSection(size_t shellID, G4double energy) const
Returns the hard cross section for the given shell (per molecule)
~G4PenelopeIonisationCrossSection()
Destructor. Clean all tables.
std::vector< G4double > GetCrossSection(G4int Z, G4double incidentEnergy, G4double mass, G4double deltaEnergy, const G4Material *mat) override
G4double CrossSection(G4int Z, G4AtomicShellEnumerator shell, G4double incidentEnergy, G4double mass, const G4Material *mat) override
G4PenelopeIonisationCrossSection()
Constructor.
std::vector< G4double > Probabilities(G4int Z, G4double incidentEnergy, G4double mass, G4double deltaEnergy, const G4Material *mat) override
void BuildXSTable(const G4Material *, G4double cut, const G4ParticleDefinition *, G4bool isMaster=true)
This can be inkoved only by the master.
const G4PenelopeCrossSection * GetCrossSectionTableForCouple(const G4ParticleDefinition *, const G4Material *, const G4double cut) const
G4double GetNumberOfZAtomsPerMolecule(const G4Material *, G4int Z)
static G4PenelopeOscillatorManager * GetOscillatorManager()
G4PenelopeOscillatorTable * GetOscillatorTableIonisation(const G4Material *)
G4PenelopeOscillator * GetOscillatorIonisation(const G4Material *, G4int)
G4double GetIonisationEnergy()
G4double GetResonanceEnergy() const