79 if (algorithm)
delete algorithm;
88 std::vector<G4VEMDataSet *>::const_iterator i(components.begin());
89 std::vector<G4VEMDataSet *>::const_iterator end(components.end());
93 value += (*i)->FindValue(energy);
105 G4cout <<
"The data set has " << n <<
" components" <<
G4endl;
163 G4String fullFileName = FullFileName(file);
164 std::ifstream in(fullFileName);
169 message += fullFileName;
170 message +=
"\" not found";
181 G4int shellIndex = 0;
199 if ((k%nColumns == 0) && (orig_shell_energies != 0) )
201 AddComponent(
new G4EMDataSet(shellIndex, orig_shell_energies, orig_shell_data, log_shell_energies, log_shell_data, algorithm->
Clone(), unitEnergies, unitData));
202 orig_shell_energies = 0;
204 log_shell_energies = 0;
210 if (orig_shell_energies == 0)
219 orig_shell_energies->push_back(a*unitEnergies);
220 log_shell_energies->push_back(std::log10(a) + std::log10(unitEnergies));
222 else if (k%nColumns == 1)
224 orig_shell_data->push_back(a*unitData);
225 log_shell_data->push_back(std::log10(a) + std::log10(unitData));
234 delete orig_shell_energies;
235 delete orig_shell_data;
236 delete log_shell_energies;
237 delete log_shell_data;
247 G4String fullFileName = FullFileName(file);
248 std::ifstream in(fullFileName);
252 G4String message(
"G4ShellEMDataSet::LoadData - data file \"");
253 message += fullFileName;
254 message +=
"\" not found";
263 G4int shellIndex = 0;
279 if ((k%nColumns == 0) && (orig_shell_energies != 0) )
282 orig_shell_energies = 0;
288 if (orig_shell_energies == 0)
295 orig_shell_energies->push_back(a*unitEnergies);
297 else if (k%nColumns == 1)
299 orig_shell_data->push_back(a*unitData);
308 delete orig_shell_energies;
309 delete orig_shell_data;
318 G4String fullFileName = FullFileName(file);
319 std::ofstream out(fullFileName);
324 message += fullFileName;
341 G4DataVector::const_iterator i = energies.begin();
342 G4DataVector::const_iterator endI = energies.end();
343 G4DataVector::const_iterator j = data.begin();
349 out.setf(std::ofstream::left);
350 out << ((*i)/unitEnergies) <<
' ';
354 out.setf(std::ofstream::left);
355 out << ((*j)/unitData) << std::endl;
363 out.setf(std::ofstream::left);
368 out.setf(std::ofstream::left);
369 out << -1.f << std::endl;
376 out.setf(std::ofstream::left);
381 out.setf(std::ofstream::left);
382 out << -2.f << std::endl;
390 while (!components.empty())
392 if (components.back())
delete components.back();
393 components.pop_back();
400 char* path = std::getenv(
"G4LEDATA");
408 std::ostringstream fullFileName;
410 fullFileName << path <<
'/' << fileName << z <<
".dat";
412 return G4String(fullFileName.str().c_str());
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4GLOB_DLL std::ostream G4cout
virtual G4bool SaveData(const G4String &fileName) const
virtual const G4VEMDataSet * GetComponent(G4int componentId) const
G4ShellEMDataSet(G4int Z, G4VDataSetAlgorithm *algo, G4double eUnit=CLHEP::MeV, G4double dataUnit=CLHEP::barn)
virtual size_t NumberOfComponents(void) const
virtual G4double FindValue(G4double energy, G4int componentId=0) const
void CleanUpComponents(void)
virtual void AddComponent(G4VEMDataSet *dataSet)
virtual G4bool LoadData(const G4String &fileName)
virtual void SetLogEnergiesData(G4DataVector *energies, G4DataVector *data, G4DataVector *log_energies, G4DataVector *log_data, G4int componentId)
virtual void PrintData(void) const
virtual G4bool LoadNonLogData(const G4String &fileName)
virtual ~G4ShellEMDataSet()
virtual void SetEnergiesData(G4DataVector *energies, G4DataVector *data, G4int componentId)
virtual G4VDataSetAlgorithm * Clone() const =0
virtual void SetEnergiesData(G4DataVector *x, G4DataVector *data, G4int component=0)=0
virtual const G4DataVector & GetData(G4int componentId) const =0
virtual const G4DataVector & GetEnergies(G4int componentId) const =0
virtual void SetLogEnergiesData(G4DataVector *x, G4DataVector *data, G4DataVector *Log_x, G4DataVector *Log_data, G4int component=0)=0
virtual void PrintData(void) const =0