43 algorithm(argAlgorithm), unitEnergies(argUnitEnergies), unitData(argUnitData)
68 message+=fullFileName;
69 message+=
"\" not found";
70 G4Exception(
"G4MicroElecCrossSectionDataSet::LoadData",
"em0003",
75 std::vector<G4DataVector *> columns;
76 std::vector<G4DataVector *> log_columns;
78 std::stringstream *stream(
new std::stringstream);
99 while (!stream->eof())
103 while (i>=columns.size())
109 columns[i]->push_back(value);
123 if (value <=0.) value = 1
e-300;
124 log_columns[i]->push_back(std::log10(value));
130 stream=
new std::stringstream;
148 if (comment) {
break; }
149 if (space && (!first)) { (*stream) <<
' '; }
157 catch(
const std::ios::failure &
e)
165 std::vector<G4DataVector *>::size_type maxI(columns.size());
170 message+=fullFileName;
171 message+=
"\" should have at least two columns";
172 G4Exception(
"G4MicroElecCrossSectionDataSet::LoadData",
"em0005",
177 std::vector<G4DataVector*>::size_type i(1);
180 G4DataVector::size_type maxJ(columns[i]->size());
182 if (maxJ!=columns[0]->size())
185 message+=fullFileName;
186 message+=
"\" has lines with a different number of columns";
187 G4Exception(
"G4MicroElecCrossSectionDataSet::LoadData",
"em0005",
192 G4DataVector::size_type j(0);
202 argData->push_back(columns[i]->
operator[] (j)*
GetUnitData());
203 argLogEnergies->push_back(log_columns[0]->
operator[] (j) + std::log10(
GetUnitEnergies()));
204 argLogData->push_back(log_columns[i]->
operator[] (j) + std::log10(
GetUnitData()));
218 delete log_columns[i];
235 message+=fullFileName;
236 message+=
"\" not found";
237 G4Exception(
"G4MicroElecCrossSectionDataSet::LoadData",
"em0003",
242 std::vector<G4DataVector *> columns;
244 std::stringstream *stream(
new std::stringstream);
265 while (!stream->eof())
269 while (i>=columns.size())
274 columns[i]->push_back(value);
280 stream=
new std::stringstream;
298 if (comment) {
break; }
299 if (space && (!first)) { (*stream) <<
' '; }
307 catch(
const std::ios::failure &
e)
315 std::vector<G4DataVector *>::size_type maxI(columns.size());
320 message+=fullFileName;
321 message+=
"\" should have at least two columns";
322 G4Exception(
"G4MicroElecCrossSectionDataSet::LoadData",
"em0005",
327 std::vector<G4DataVector*>::size_type i(1);
330 G4DataVector::size_type maxJ(columns[i]->size());
332 if (maxJ!=columns[0]->size())
335 message+=fullFileName;
336 message+=
"\" has lines with a different number of columns.";
337 G4Exception(
"G4MicroElecCrossSectionDataSet::LoadData",
"em0005",
342 G4DataVector::size_type j(0);
350 argData->push_back(columns[i]->
operator[] (j)*
GetUnitData());
376 G4Exception(
"G4MicroElecCrossSectionDataSet::SaveData",
"em0005",
383 std::ofstream out(fullFileName);
388 message+=fullFileName;
390 G4Exception(
"G4MicroElecCrossSectionDataSet::SaveData",
"em0005",
397 G4DataVector::const_iterator * iData(
new G4DataVector::const_iterator[n]);
407 while (iEnergies!=iEnergiesEnd)
441 char* path = std::getenv(
"G4LEDATA");
444 G4Exception(
"G4MicroElecCrossSectionDataSet::FullFileName",
"em0006",
450 std::ostringstream fullFileName;
452 fullFileName << path <<
"/" << argFileName <<
".dat";
454 return G4String(fullFileName.str().c_str());
463 std::vector<G4VEMDataSet *>::const_iterator i(
components.begin());
464 std::vector<G4VEMDataSet *>::const_iterator end(
components.end());
468 value+=(*i)->FindValue(argEnergy);
480 G4cout <<
"The data set has " << n <<
" components" <<
G4endl;
496 G4int argComponentId)
507 message <<
"Component " << argComponentId <<
" not found";
509 G4Exception(
"G4MicroElecCrossSectionDataSet::SetEnergiesData",
"em0005",
519 G4int argComponentId)
530 message <<
"Component " << argComponentId <<
" not found";
532 G4Exception(
"G4MicroElecCrossSectionDataSet::SetLogEnergiesData",
"em0005",