48 theCrossSectionHandler(0)
59 fLowEnergyLimit = 10.0*
eV;
60 fHighEnergyLimit = 100.0*
GeV;
69 if (theCrossSectionHandler)
70 delete theCrossSectionHandler;
82 G4cout <<
"Entering in method G4PenelopeIonisationCrossSection::CrossSection()" <<
G4endl;
91 ed <<
"The method has been called with a NULL G4Material pointer" <<
G4endl;
92 G4Exception(
"G4PenelopeIonisationCrossSection::CrossSection()",
"em2042",
97 if (!theCrossSectionHandler)
102 if(
G4int(shell) < nmax &&
103 incidentEnergy >= fLowEnergyLimit && incidentEnergy <= fHighEnergyLimit)
109 G4int index = FindShellIDIndex(material,Z,shell);
126 ed <<
"There is something wrong here: it looks like the index is wrong" <<
G4endl;
127 ed <<
"Requested: shell " <<
G4int(shell) <<
" and Z = " << Z <<
G4endl;
129 G4Exception(
"G4PenelopeIonisationCrossSection::CrossSection()",
"em2043",
141 cross = crossPerMolecule/atomsPerMolec;
144 if (verboseLevel > 0)
146 G4cout <<
"Cross section of shell " <<
G4int(shell) <<
" and Z= " <<
Z;
147 G4cout <<
" of material: " << material->
GetName() <<
" and energy = " << incidentEnergy/
keV <<
" keV" <<
G4endl;
151 if (verboseLevel > 2)
153 G4cout <<
"Cross section per molecule: " << crossPerMolecule/
barn <<
" barn" <<
G4endl;
154 G4cout <<
"Atoms " << Z <<
" per molecule: " << atomsPerMolec <<
G4endl;
163 std::vector<G4double>
170 std::vector<G4double> vec(nmax,0.0);
179 std::vector<G4double>
187 size_t n = vec.size();
190 for(i=0; i<
n; ++i) { sum += vec[i]; }
193 for(i=0; i<
n; ++i) { vec[i] = vec[i]*sum; }
204 if (verboseLevel > 1)
205 G4cout <<
"Entering in method G4PenelopeIonisationCrossSection::FindShellIDIndex()" <<
G4endl;
208 shellIDTable =
new std::map< std::pair<const G4Material*,G4int>,
G4DataVector*>;
210 std::pair<const G4Material*,G4int> theKey = std::make_pair(mat,Z);
214 if (shellIDTable->count(theKey))
216 if (verboseLevel > 2)
218 G4DataVector* theVec = shellIDTable->find(theKey)->second;
220 if (ishell>=0 && ishell < (
G4int) theVec->size())
221 result = (
G4int) (*theVec)[ishell];
225 ed <<
"Shell ID: " << ishell <<
" not available for material " << mat->
GetName() <<
" and Z = " <<
234 if (verboseLevel > 2)
238 size_t numberOfOscillators = theTable->size();
242 G4DataVector* dat =
new G4DataVector(nMaxLevels,-1);
243 for (
size_t iosc=0;iosc<numberOfOscillators;iosc++)
254 if ((shFlag-1) == ishell)
255 result = (
G4int) iosc;
258 shellIDTable->insert(std::make_pair(theKey,dat));
261 if (verboseLevel > 1)
262 G4cout <<
"Leaving method G4PenelopeIonisationCrossSection::FindShellIDIndex() with index = " << result <<
G4endl;