73 G4Exception(
"G4ShellEMDataSet::G4ShellEMDataSet()",
"em0007",
90 std::vector<G4VEMDataSet *>::const_iterator i(
components.begin());
91 std::vector<G4VEMDataSet *>::const_iterator end(
components.end());
95 value += (*i)->FindValue(
energy);
108 G4cout <<
"The data set has " <<
n <<
" components" <<
G4endl;
135 msg +=
static_cast<char>(componentId);
157 msg +=
static_cast<char>(componentId);
159 G4Exception(
"G4ShellEMDataSet::SetLogEnergiesData()",
"em0008",
170 std::ifstream in(fullFileName);
175 message += fullFileName;
176 message +=
"\" not found";
187 G4int shellIndex = 0;
205 if ((k%nColumns == 0) && (orig_shell_energies != 0) )
208 orig_shell_data, log_shell_energies,
211 orig_shell_energies = 0;
213 log_shell_energies = 0;
219 if (orig_shell_energies == 0)
229 log_shell_energies->push_back(std::log10(a) + std::log10(
unitEnergies));
231 else if (k%nColumns == 1)
233 orig_shell_data->push_back(a*
unitData);
234 log_shell_data->push_back(std::log10(a) + std::log10(
unitData));
242 delete orig_shell_energies;
243 delete orig_shell_data;
244 delete log_shell_energies;
245 delete log_shell_data;
257 std::ifstream in(fullFileName);
261 G4String message(
"G4ShellEMDataSet::LoadData - data file \"");
262 message += fullFileName;
263 message +=
"\" not found";
272 G4int shellIndex = 0;
287 if ((k%nColumns == 0) && (orig_shell_energies != 0) )
292 orig_shell_energies = 0;
298 if (orig_shell_energies == 0)
307 else if (k%nColumns == 1)
309 orig_shell_data->push_back(a*
unitData);
318 delete orig_shell_energies;
319 delete orig_shell_data;
329 std::ofstream out(fullFileName);
334 message += fullFileName;
351 G4DataVector::const_iterator i = energies.begin();
352 G4DataVector::const_iterator endI = energies.end();
353 G4DataVector::const_iterator j = data.begin();
359 out.setf(std::ofstream::left);
364 out.setf(std::ofstream::left);
365 out << ((*j)/
unitData) << std::endl;
373 out.setf(std::ofstream::left);
378 out.setf(std::ofstream::left);
379 out << -1.f << std::endl;
386 out.setf(std::ofstream::left);
391 out.setf(std::ofstream::left);
392 out << -2.f << std::endl;
412 char* path = std::getenv(
"G4LEDATA");
420 std::ostringstream fullFileName;
422 fullFileName << path <<
'/' << fileName <<
z <<
".dat";
424 return G4String(fullFileName.str().c_str());
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4GLOB_DLL std::ostream G4cout
void SetEnergiesData(G4DataVector *energies, G4DataVector *data, G4int componentId) override
std::vector< G4VEMDataSet * > components
void AddComponent(G4VEMDataSet *dataSet) override
G4ShellEMDataSet(G4int Z, G4VDataSetAlgorithm *algo, G4double eUnit=CLHEP::MeV, G4double dataUnit=CLHEP::barn)
size_t NumberOfComponents(void) const override
G4bool LoadData(const G4String &fileName) override
const G4VEMDataSet * GetComponent(G4int componentId) const override
G4bool SaveData(const G4String &fileName) const override
G4VDataSetAlgorithm * algorithm
G4bool LoadNonLogData(const G4String &fileName) override
G4double FindValue(G4double energy, G4int componentId=0) const override
void PrintData(void) const override
void SetLogEnergiesData(G4DataVector *energies, G4DataVector *data, G4DataVector *log_energies, G4DataVector *log_data, G4int componentId) override
G4String FullFileName(const G4String &fileName) const
virtual ~G4ShellEMDataSet()
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
G4double energy(const ThreeVector &p, const G4double m)