63 nDataSetList(0), verboseLevel(0)
66 currentMaterial = elmMaterial = 0;
68 matParticle = elmParticle = 0;
69 matKinEnergy = elmKinEnergy = matCrossSection = elmCrossSection = 0.0;
83 if(mat == currentMaterial && part->
GetDefinition() == matParticle
85 {
return matCrossSection; }
87 currentMaterial = mat;
95 if(
G4int(xsecelm.size()) < nElements) { xsecelm.resize(nElements); }
97 for(
G4int i=0; i<nElements; ++i) {
98 matCrossSection += nAtomsPerVolume[i] *
100 xsecelm[i] = matCrossSection;
102 return matCrossSection;
112 if(mat == elmMaterial && elm == currentElement &&
115 {
return elmCrossSection; }
118 currentElement = elm;
121 elmCrossSection = 0.0;
123 G4int i = nDataSetList-1;
126 dataSetList[i]->IsElementApplicable(part, Z, mat)) {
129 elmCrossSection = dataSetList[i]->GetElementCrossSection(part, Z, mat);
146 for (
G4int j = 0; j<nIso; ++j) {
147 if(abundVector[j] > 0.0) {
148 iso = (*isoVector)[j];
149 elmCrossSection += abundVector[j]*
150 GetIsoCrossSection(part, Z, iso->
GetN(), iso, elm, mat, i);
160 return elmCrossSection;
177 if(dataSetList[idx]->IsIsoApplicable(part, Z, A, elm, mat) ) {
178 return dataSetList[idx]->GetIsoCrossSection(part, Z, A, iso, elm, mat);
182 for (
G4int j = nDataSetList-1; j >= 0; --j) {
183 if (dataSetList[j]->IsElementApplicable(part, Z, mat)) {
184 return dataSetList[j]->GetElementCrossSection(part, Z, mat);
185 }
else if (dataSetList[j]->IsIsoApplicable(part, Z, A, elm, mat)) {
186 return dataSetList[j]->GetIsoCrossSection(part, Z, A, iso, elm, mat);
190 G4cout <<
"G4CrossSectionDataStore::GetCrossSection ERROR: "
191 <<
" no isotope cross section found"
194 <<
" off Element " << elm->
GetName()
196 <<
" Z= " << Z <<
" A= " << A
199 " no applicable data set found for the isotope");
213 for (
G4int i = nDataSetList-1; i >= 0; --i) {
214 if (dataSetList[i]->IsIsoApplicable(part, Z, A, elm, mat) ) {
215 return dataSetList[i]->GetIsoCrossSection(part, Z, A, iso, elm, mat);
218 G4cout <<
"G4CrossSectionDataStore::GetCrossSection ERROR: "
219 <<
" no isotope cross section found"
222 <<
" off Element " << elm->
GetName()
224 <<
" Z= " << Z <<
" A= " << A
227 " no applicable data set found for the isotope");
240 G4Element* anElement = (*theElementVector)[0];
247 for(
G4int i=0; i<nElements; ++i) {
248 if(cross <= xsecelm[i]) {
249 anElement = (*theElementVector)[i];
258 G4int i = nDataSetList-1;
259 if (dataSetList[i]->IsElementApplicable(part, Z, mat)) {
268 <<
" has no isotopes " <<
G4endl;
270 " Isotope vector is not defined");
275 iso = (*isoVector)[0];
293 <<
" has no isotopes " <<
G4endl;
295 " Isotope vector is not defined");
301 iso = (*isoVector)[0];
306 if(
G4int(xseciso.size()) < nIso) { xseciso.resize(nIso); }
308 for (
G4int j = 0; j<nIso; ++j) {
310 if(abundVector[j] > 0.0) {
311 iso = (*isoVector)[j];
312 xsec = abundVector[j]*
313 GetIsoCrossSection(part, Z, iso->GetN(), iso, anElement, mat, i);
319 for (
G4int j = 0; j<nIso; ++j) {
320 if(cross <= xseciso[j]) {
321 iso = (*isoVector)[j];
336 if (nDataSetList == 0)
339 "G4CrossSectionDataStore: no data sets registered");
342 for (
G4int i=0; i<nDataSetList; ++i) {
343 dataSetList[i]->BuildPhysicsTable(aParticleType);
355 if (nDataSetList == 0) {
356 G4cout <<
"WARNING - G4CrossSectionDataStore::DumpPhysicsTable: "
357 <<
" no data sets registered" <<
G4endl;
361 for (
G4int i = nDataSetList-1; i >= 0; --i) {
362 G4double e1 = dataSetList[i]->GetMinKinEnergy();
363 G4double e2 = dataSetList[i]->GetMaxKinEnergy();
365 <<
" Cr_sctns: " << std::setw(25) << dataSetList[i]->GetName() <<
": "
369 if (dataSetList[i]->GetName() ==
"G4CrossSectionPairGG") {
370 dataSetList[i]->DumpPhysicsTable(aParticleType);
385 for (
G4int i = nDataSetList-1; i > 0; i--) {
386 elo = dataSetList[i]->GetMinKinEnergy()/
GeV;
387 ehi = dataSetList[i]->GetMaxKinEnergy()/
GeV;
388 outFile <<
" <li><b><a href=\"" << dataSetList[i]->GetName() <<
".html\"> "
389 << dataSetList[i]->GetName() <<
"</a> from "
390 << elo <<
" GeV to " << ehi <<
" GeV </b></li>\n";
393 G4double defaultHi = dataSetList[0]->GetMaxKinEnergy()/
GeV;
394 if (ehi < defaultHi) {
395 outFile <<
" <li><b><a href=\"" << dataSetList[0]->GetName() <<
".html\"> "
396 << dataSetList[0]->GetName() <<
"</a> from "
397 << ehi <<
" GeV to " << defaultHi <<
" GeV </b></li>\n";
size_t GetNumberOfIsotopes() const
void SetIsotope(const G4Isotope *iso)
G4bool GetNaturalAbundanceFlag() const
std::vector< G4Isotope * > G4IsotopeVector
std::vector< G4Element * > G4ElementVector
G4double GetKineticEnergy() const
const G4String & GetName() const
G4ParticleDefinition * GetDefinition() const
void DumpHtml(const G4ParticleDefinition &, std::ofstream &)
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
const G4ElementVector * GetElementVector() const
static G4NistManager * Instance()
const G4String & GetParticleName() const
const G4double * GetVecNbOfAtomsPerVolume() const
G4GLOB_DLL std::ostream G4cout
~G4CrossSectionDataStore()
G4double GetCrossSection(const G4DynamicParticle *, const G4Material *)
G4double * GetRelativeAbundanceVector() const
void BuildPhysicsTable(const G4ParticleDefinition &)
G4IsotopeVector * GetIsotopeVector() const
void DumpPhysicsTable(const G4ParticleDefinition &)
G4CrossSectionDataStore()
size_t GetNumberOfElements() const
G4Element * SampleZandA(const G4DynamicParticle *, const G4Material *, G4Nucleus &target)
const G4String & GetName() const