68 algorithm(argAlgorithm), unitEnergies(argUnitEnergies), unitData(argUnitData)
93 message+=fullFileName;
94 message+=
"\" not found";
100 std::vector<G4DataVector *> columns;
101 std::vector<G4DataVector *> log_columns;
103 std::stringstream *stream(
new std::stringstream);
124 while (!stream->eof())
128 while (i>=columns.size())
134 columns[i]->push_back(value);
148 if (value <=0.) value = 1
e-300;
149 log_columns[i]->push_back(std::log10(value));
155 stream=
new std::stringstream;
173 if (comment) {
break; }
174 if (space && (!first)) { (*stream) <<
' '; }
182 catch(
const std::ios::failure &
e)
190 std::vector<G4DataVector *>::size_type maxI(columns.size());
195 message+=fullFileName;
196 message+=
"\" should have at least two columns";
202 std::vector<G4DataVector*>::size_type i(1);
205 G4DataVector::size_type maxJ(columns[i]->size());
207 if (maxJ!=columns[0]->size())
210 message+=fullFileName;
211 message+=
"\" has lines with a different number of columns";
217 G4DataVector::size_type j(0);
227 argData->push_back(columns[i]->
operator[] (j)*
GetUnitData());
228 argLogEnergies->push_back(log_columns[0]->
operator[] (j) + std::log10(
GetUnitEnergies()));
229 argLogData->push_back(log_columns[i]->
operator[] (j) + std::log10(
GetUnitData()));
243 delete log_columns[i];
260 message+=fullFileName;
261 message+=
"\" not found";
262 G4Exception(
"G4CrossSectionDataSet::LoadNonLogData",
267 std::vector<G4DataVector *> columns;
269 std::stringstream *stream(
new std::stringstream);
290 while (!stream->eof())
294 while (i>=columns.size())
299 columns[i]->push_back(value);
305 stream=
new std::stringstream;
323 if (comment) {
break; }
324 if (space && (!first)) { (*stream) <<
' '; }
332 catch(
const std::ios::failure &
e)
340 std::vector<G4DataVector *>::size_type maxI(columns.size());
345 message+=fullFileName;
346 message+=
"\" should have at least two columns";
347 G4Exception(
"G4CrossSectionDataSet::LoadNonLogData",
352 std::vector<G4DataVector*>::size_type i(1);
355 G4DataVector::size_type maxJ(columns[i]->size());
357 if (maxJ!=columns[0]->size())
360 message+=fullFileName;
361 message+=
"\" has lines with a different number of columns";
362 G4Exception(
"G4CrossSectionDataSet::LoadNonLogData",
367 G4DataVector::size_type j(0);
375 argData->push_back(columns[i]->
operator[] (j)*
GetUnitData());
407 std::ofstream out(fullFileName);
412 message+=fullFileName;
421 G4DataVector::const_iterator * iData(
new G4DataVector::const_iterator[n]);
431 while (iEnergies!=iEnergiesEnd)
465 char* path = std::getenv(
"G4LEDATA");
473 std::ostringstream fullFileName;
475 fullFileName << path <<
"/" << argFileName <<
".dat";
477 return G4String(fullFileName.str().c_str());
486 std::vector<G4VEMDataSet *>::const_iterator i(
components.begin());
487 std::vector<G4VEMDataSet *>::const_iterator end(
components.end());
491 value+=(*i)->FindValue(argEnergy);
503 G4cout <<
"The data set has " << n <<
" components" <<
G4endl;
519 G4int argComponentId)
530 message <<
"component " << argComponentId <<
" not found";
532 G4Exception(
"G4CrossSectionDataSet::SetEnergiesData",
541 G4int argComponentId)
552 message <<
"component " << argComponentId <<
" not found";
554 G4Exception(
"G4CrossSectionDataSet::SetLogEnergiesData",