104 : interpolation(algorithm), eMin(minE), eMax(maxE), nBins(bins),
105 unit1(unitE), unit2(unitData), zMin(minZ), zMax(maxZ)
115 std::map<G4int,G4VEMDataSet*,std::less<G4int> >::iterator
pos;
130 for (
size_t i=0; i<
n; i++)
132 delete (*crossSections)[i];
158 nBins = numberOfBins;
167 std::map<G4int,G4VEMDataSet*,std::less<G4int> >::const_iterator
pos;
178 G4cout <<
"---- Data set for Z = "
182 G4cout <<
"--------------------------------------------------" <<
G4endl;
189 for (
size_t i=0; i<nZ; i++)
195 char* path = std::getenv(
"G4LEDATA");
203 std::ostringstream ost;
204 ost << path <<
'/' << fileName << Z <<
".dat";
205 std::ifstream
file(ost.str().c_str());
206 std::filebuf* lsdp =
file.rdbuf();
208 if (! (lsdp->is_open()) )
210 G4String excep =
"data file: " + ost.str() +
" not found";
235 if (a != -1 && a != -2)
239 orig_reg_energies->push_back(a*
unit1);
240 log_reg_energies->push_back(std::log10(a)+std::log10(unit1));
242 else if (k%nColumns == 1)
244 orig_reg_data->push_back(a*
unit2);
245 log_reg_data->push_back(std::log10(a)+std::log10(unit2));
266 for (
size_t i=0; i<nZ; i++)
272 char* path = std::getenv(
"G4LEDATA");
275 G4Exception(
"G4VCrossSectionHandler::LoadNonLogData",
280 std::ostringstream ost;
281 ost << path <<
'/' << fileName << Z <<
".dat";
282 std::ifstream
file(ost.str().c_str());
283 std::filebuf* lsdp =
file.rdbuf();
285 if (! (lsdp->is_open()) )
287 G4String excep =
"data file: " + ost.str() +
" not found";
288 G4Exception(
"G4VCrossSectionHandler::LoadNonLogData",
308 if (a != -1 && a != -2)
312 orig_reg_energies->push_back(a*
unit1);
314 else if (k%nColumns == 1)
316 orig_reg_data->push_back(a*
unit2);
336 for (
size_t i=0; i<nZ; i++)
355 std::map<G4int,G4VEMDataSet*,std::less<G4int> >::iterator
pos;
368 G4int i = (*pos).first;
382 std::map<G4int,G4VEMDataSet*,std::less<G4int> >::const_iterator
pos;
395 G4cout <<
"WARNING: G4VCrossSectionHandler::FindValue did not find Z = "
402 G4int shellIndex)
const
406 std::map<G4int,G4VEMDataSet*,std::less<G4int> >::const_iterator
pos;
418 if(shellIndex < nComponents)
423 G4cout <<
"WARNING: G4VCrossSectionHandler::FindValue did not find"
424 <<
" shellIndex= " << shellIndex
434 G4cout <<
"WARNING: G4VCrossSectionHandler::FindValue did not find Z = "
450 for (
G4int i=0 ; i<nElements ; i++)
454 G4double nAtomsVol = nAtomsPerVolume[i];
455 value += nAtomsVol * elementValue;
472 energyVector.push_back(std::pow(10., std::log10(
eMin)+i*dBin));
480 std::vector<G4VEMDataSet*>::iterator
mat;
499 G4Exception(
"G4VCrossSectionHandler::BuildMeanFreePathForMaterials",
519 for (
size_t mLocal=0; mLocal<numOfCouples; mLocal++)
528 energies->push_back(energy);
529 log_energies->push_back(std::log10(energy));
531 G4double materialCrossSection = 0.0;
533 for(
G4int j=0; j<nElm; j++) {
537 if (materialCrossSection > 0.)
539 data->push_back(1./materialCrossSection);
540 log_data->push_back(std::log10(1./materialCrossSection));
545 log_data->push_back(std::log10(
DBL_MAX));
580 size_t materialIndex = couple->
GetIndex();
582 G4VEMDataSet* materialSet = (*crossSections)[materialIndex];
583 G4double materialCrossSection0 = 0.0;
586 for (
G4int i=0; i < nElements; i++ )
589 materialCrossSection0 += cr;
590 cross.push_back(materialCrossSection0);
595 for (
G4int k=0 ;
k < nElements ;
k++ )
597 if (random <= cross[
k])
return (
G4int) (*elementVector)[
k]->GetZ();
617 G4Element* element = (*elementVector)[0];
624 size_t materialIndex = couple->
GetIndex();
626 G4VEMDataSet* materialSet = (*crossSections)[materialIndex];
627 G4double materialCrossSection0 = 0.0;
630 for (
G4int i=0; i<nElements; i++)
633 materialCrossSection0 += cr;
634 cross.push_back(materialCrossSection0);
639 for (
G4int k=0 ;
k < nElements ;
k++ )
641 if (random <= cross[
k])
return (*elementVector)[
k];
644 G4cout <<
"G4VCrossSectionHandler::SelectRandomElement - no element found" <<
G4endl;
664 std::map<G4int,G4VEMDataSet*,std::less<G4int> >::const_iterator
pos;
671 dataSet = (*pos).second;
674 G4Exception(
"G4VCrossSectionHandler::SelectRandomShell",
679 size_t nShells = dataSet->NumberOfComponents();
680 for (
size_t i=0; i<nShells; i++)
683 if (shellDataSet != 0)
687 if (random <= partialSum)
return i;
697 if (materialTable == 0)
698 G4Exception(
"G4VCrossSectionHandler::ActiveElements",
709 for (
G4int iEl=0; iEl<nElements; iEl++)
711 G4Element* element = (*elementVector)[iEl];
731 std::map<G4int,G4VEMDataSet*,std::less<G4int> >::const_iterator
pos;
740 G4cout <<
"WARNING: G4VCrossSectionHandler::NumberOfComponents did not "