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);
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];
245 if(0.0 >= cross) {
return anElement; }
250 for(
G4int i=0; i<nElements; ++i) {
251 if(cross <= xsecelm[i]) {
252 anElement = (*theElementVector)[i];
261 G4int i = nDataSetList-1;
262 if (dataSetList[i]->IsElementApplicable(part, Z, mat)) {
271 <<
" has no isotopes " <<
G4endl;
273 " Isotope vector is not defined");
278 iso = (*isoVector)[0];
296 <<
" has no isotopes " <<
G4endl;
298 " Isotope vector is not defined");
304 iso = (*isoVector)[0];
309 if(
G4int(xseciso.size()) < nIso) { xseciso.resize(nIso); }
313 if(abundVector[j] > 0.0) {
314 iso = (*isoVector)[j];
315 xsec = abundVector[j]*
316 GetIsoCrossSection(part, Z, iso->GetN(), iso, anElement,
mat, i);
323 if(cross <= xseciso[j]) {
324 iso = (*isoVector)[j];
339 if (nDataSetList == 0)
342 "G4CrossSectionDataStore: no data sets registered");
345 for (
G4int i=0; i<nDataSetList; ++i) {
346 dataSetList[i]->BuildPhysicsTable(aParticleType);
358 if (nDataSetList == 0) {
359 G4cout <<
"WARNING - G4CrossSectionDataStore::DumpPhysicsTable: "
360 <<
" no data sets registered" <<
G4endl;
364 for (
G4int i = nDataSetList-1; i >= 0; --i) {
365 G4double e1 = dataSetList[i]->GetMinKinEnergy();
366 G4double e2 = dataSetList[i]->GetMaxKinEnergy();
368 <<
" Cr_sctns: " << std::setw(25) << dataSetList[i]->GetName() <<
": "
372 if (dataSetList[i]->GetName() ==
"G4CrossSectionPairGG") {
373 dataSetList[i]->DumpPhysicsTable(aParticleType);
388 for (
G4int i = nDataSetList-1; i > 0; i--) {
389 elo = dataSetList[i]->GetMinKinEnergy()/
GeV;
390 ehi = dataSetList[i]->GetMaxKinEnergy()/
GeV;
391 outFile <<
" <li><b><a href=\"" << dataSetList[i]->GetName() <<
".html\"> "
392 << dataSetList[i]->GetName() <<
"</a> from "
393 << elo <<
" GeV to " << ehi <<
" GeV </b></li>\n";
396 G4double defaultHi = dataSetList[0]->GetMaxKinEnergy()/
GeV;
397 if (ehi < defaultHi) {
398 outFile <<
" <li><b><a href=\"" << dataSetList[0]->GetName() <<
".html\"> "
399 << dataSetList[0]->GetName() <<
"</a> from "
400 << 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