41 algorithm(argAlgorithm), unitEnergies(argUnitEnergies), unitData(argUnitData)
64 message+=fullFileName;
65 message+=
"\" not found";
66 G4Exception(
"G4MuElecCrossSectionDataSet::LoadData",
"em0003",
71 std::vector<G4DataVector *> columns;
72 std::vector<G4DataVector *> log_columns;
74 std::stringstream *stream(
new std::stringstream);
95 while (!stream->eof())
99 while (i>=columns.size())
105 columns[i]->push_back(value);
119 if (value <=0.) value = 1
e-300;
120 log_columns[i]->push_back(std::log10(value));
126 stream=
new std::stringstream;
144 if (comment) {
break; }
145 if (space && (!first)) { (*stream) <<
' '; }
153 catch(
const std::ios::failure &
e)
161 std::vector<G4DataVector *>::size_type maxI(columns.size());
166 message+=fullFileName;
167 message+=
"\" should have at least two columns";
168 G4Exception(
"G4MuElecCrossSectionDataSet::LoadData",
"em0005",
173 std::vector<G4DataVector*>::size_type i(1);
176 G4DataVector::size_type maxJ(columns[i]->size());
178 if (maxJ!=columns[0]->size())
181 message+=fullFileName;
182 message+=
"\" has lines with a different number of columns";
183 G4Exception(
"G4MuElecCrossSectionDataSet::LoadData",
"em0005",
188 G4DataVector::size_type j(0);
198 argData->push_back(columns[i]->
operator[] (j)*
GetUnitData());
199 argLogEnergies->push_back(log_columns[0]->
operator[] (j) + std::log10(
GetUnitEnergies()));
200 argLogData->push_back(log_columns[i]->
operator[] (j) + std::log10(
GetUnitData()));
214 delete log_columns[i];
231 message+=fullFileName;
232 message+=
"\" not found";
233 G4Exception(
"G4MuElecCrossSectionDataSet::LoadData",
"em0003",
238 std::vector<G4DataVector *> columns;
240 std::stringstream *stream(
new std::stringstream);
261 while (!stream->eof())
265 while (i>=columns.size())
270 columns[i]->push_back(value);
276 stream=
new std::stringstream;
294 if (comment) {
break; }
295 if (space && (!first)) { (*stream) <<
' '; }
303 catch(
const std::ios::failure &
e)
311 std::vector<G4DataVector *>::size_type maxI(columns.size());
316 message+=fullFileName;
317 message+=
"\" should have at least two columns";
318 G4Exception(
"G4MuElecCrossSectionDataSet::LoadData",
"em0005",
323 std::vector<G4DataVector*>::size_type i(1);
326 G4DataVector::size_type maxJ(columns[i]->size());
328 if (maxJ!=columns[0]->size())
331 message+=fullFileName;
332 message+=
"\" has lines with a different number of columns.";
333 G4Exception(
"G4MuElecCrossSectionDataSet::LoadData",
"em0005",
338 G4DataVector::size_type j(0);
346 argData->push_back(columns[i]->
operator[] (j)*
GetUnitData());
372 G4Exception(
"G4MuElecCrossSectionDataSet::SaveData",
"em0005",
379 std::ofstream out(fullFileName);
384 message+=fullFileName;
386 G4Exception(
"G4MuElecCrossSectionDataSet::SaveData",
"em0005",
393 G4DataVector::const_iterator * iData(
new G4DataVector::const_iterator[n]);
403 while (iEnergies!=iEnergiesEnd)
437 char* path = std::getenv(
"G4LEDATA");
440 G4Exception(
"G4MuElecCrossSectionDataSet::FullFileName",
"em0006",
446 std::ostringstream fullFileName;
448 fullFileName << path <<
"/" << argFileName <<
".dat";
450 return G4String(fullFileName.str().c_str());
459 std::vector<G4VEMDataSet *>::const_iterator i(
components.begin());
460 std::vector<G4VEMDataSet *>::const_iterator end(
components.end());
464 value+=(*i)->FindValue(argEnergy);
476 G4cout <<
"The data set has " << n <<
" components" <<
G4endl;
492 G4int argComponentId)
503 message <<
"Component " << argComponentId <<
" not found";
505 G4Exception(
"G4MuElecCrossSectionDataSet::SetEnergiesData",
"em0005",
515 G4int argComponentId)
526 message <<
"Component " << argComponentId <<
" not found";
528 G4Exception(
"G4MuElecCrossSectionDataSet::SetLogEnergiesData",
"em0005",