74 : interpolation(algorithm), eMin(minE), eMax(maxE), nBins(bins),
75 unit1(unitE), unit2(unitData), zMin(minZ), zMax(maxZ)
85 std::map<G4int,G4RDVEMDataSet*,std::less<G4int> >::iterator
pos;
100 for (
size_t i=0; i<
n; i++)
102 delete (*crossSections)[i];
127 nBins = numberOfBins;
136 std::map<G4int,G4RDVEMDataSet*,std::less<G4int> >::const_iterator
pos;
147 G4cout <<
"---- Data set for Z = "
151 G4cout <<
"--------------------------------------------------" <<
G4endl;
158 for (
size_t i=0; i<nZ; i++)
164 char* path = std::getenv(
"G4LEDATA");
167 G4String excep =
"G4LEDATA environment variable not set!";
168 G4Exception(
"G4RDVCrossSectionHandler::LoadData()",
172 std::ostringstream ost;
173 ost << path <<
'/' << fileName << Z <<
".dat";
174 std::ifstream
file(ost.str().c_str());
175 std::filebuf* lsdp =
file.rdbuf();
177 if (! (lsdp->is_open()) )
179 G4String excep =
"Data file: " + ost.str() +
" not found!";
180 G4Exception(
"G4RDVCrossSectionHandler::LoadData()",
196 if (a == -1 || a == -2)
204 energies->push_back(e);
207 else if (k%nColumns == 0)
210 data->push_back(value);
226 for (
size_t i=0; i<nZ; i++)
238 char* path = std::getenv(
"G4LEDATA");
241 G4String excep =
"G4LEDATA environment variable not set!";
242 G4Exception(
"G4RDVCrossSectionHandler::LoadShellData()",
246 std::ostringstream ost;
248 ost << path <<
'/' << fileName << Z <<
".dat";
250 std::ifstream
file(ost.str().c_str());
251 std::filebuf* lsdp =
file.rdbuf();
253 if (! (lsdp->is_open()) )
255 G4String excep =
"Data file: " + ost.str() +
" not found!";
256 G4Exception(
"G4RDVCrossSectionHandler::LoadShellData()",
272 if (a == -1 || a == -2)
280 energies->push_back(e);
283 else if (k%nColumns == 0)
286 data->push_back(value);
307 std::map<G4int,G4RDVEMDataSet*,std::less<G4int> >::iterator
pos;
320 G4int i = (*pos).first;
334 std::map<G4int,G4RDVEMDataSet*,std::less<G4int> >::const_iterator
pos;
347 G4cout <<
"WARNING: G4RDVCrossSectionHandler::FindValue did not find Z = "
354 G4int shellIndex)
const
358 std::map<G4int,G4RDVEMDataSet*,std::less<G4int> >::const_iterator
pos;
370 if(shellIndex < nComponents)
375 G4cout <<
"WARNING: G4RDVCrossSectionHandler::FindValue did not find"
376 <<
" shellIndex= " << shellIndex
386 G4cout <<
"WARNING: G4RDVCrossSectionHandler::FindValue did not find Z = "
402 for (
G4int i=0 ; i<nElements ; i++)
406 G4double nAtomsVol = nAtomsPerVolume[i];
407 value += nAtomsVol * elementValue;
424 energyVector.push_back(std::pow(10., std::log10(
eMin)+i*dBin));
432 std::vector<G4RDVEMDataSet*>::iterator
mat;
450 G4Exception(
"G4RDVCrossSectionHandler::BuildMeanFreePathForMaterials()",
464 for (
size_t m=0;
m<numOfCouples;
m++)
471 energies->push_back(energy);
473 G4double materialCrossSection = 0.0;
475 for(
G4int j=0; j<nElm; j++) {
479 if (materialCrossSection > 0.)
481 data->push_back(1./materialCrossSection);
515 size_t materialIndex = couple->
GetIndex();
518 G4double materialCrossSection0 = 0.0;
521 for (
G4int i=0; i < nElements; i++ )
524 materialCrossSection0 += cr;
525 cross.push_back(materialCrossSection0);
530 for (
G4int k=0 ;
k < nElements ;
k++ )
532 if (random <= cross[
k])
return (
G4int) (*elementVector)[
k]->GetZ();
552 G4Element* element = (*elementVector)[0];
559 size_t materialIndex = couple->
GetIndex();
562 G4double materialCrossSection0 = 0.0;
565 for (
G4int i=0; i<nElements; i++)
568 materialCrossSection0 += cr;
569 cross.push_back(materialCrossSection0);
574 for (
G4int k=0 ;
k < nElements ;
k++ )
576 if (random <= cross[
k])
return (*elementVector)[
k];
579 G4cout <<
"G4RDVCrossSectionHandler::SelectRandomElement - no element found" <<
G4endl;
599 std::map<G4int,G4RDVEMDataSet*,std::less<G4int> >::const_iterator
pos;
605 if (pos !=
dataMap.end()) dataSet = (*pos).second;
608 for (
size_t i=0; i<nShells; i++)
611 if (shellDataSet != 0)
615 if (random <= partialSum)
return i;
625 if (materialTable == 0)
626 G4Exception(
"G4RDVCrossSectionHandler::ActiveElements",
637 for (
G4int iEl=0; iEl<nElements; iEl++)
639 G4Element* element = (*elementVector)[iEl];
659 std::map<G4int,G4RDVEMDataSet*,std::less<G4int> >::const_iterator
pos;
668 G4cout <<
"WARNING: G4RDVCrossSectionHandler::NumberOfComponents did not "