58 G4Exception(
"G4RDShellEMDataSet::G4RDShellEMDataSet()",
"InvalidSetup",
66 if (algorithm)
delete algorithm;
75 std::vector<G4RDVEMDataSet *>::const_iterator i(components.begin());
76 std::vector<G4RDVEMDataSet *>::const_iterator end(components.end());
80 value += (*i)->FindValue(energy);
92 G4cout <<
"The data set has " << n <<
" components" <<
G4endl;
118 std::ostringstream message;
119 message <<
"Component " << componentId <<
" not found";
121 G4Exception(
"G4RDShellEMDataSet::SetEnergiesData()",
"DataNotFound",
130 G4String fullFileName = FullFileName(file);
131 std::ifstream in(fullFileName);
136 message += fullFileName;
137 message +=
"\" not found";
138 G4Exception(
"G4RDShellEMDataSet::LoadData()",
"DataNotFound",
146 G4int shellIndex = 0;
147 bool energyColumn =
true;
155 if (energyColumn && energies!=0)
162 energyColumn = (!energyColumn);
173 energies->push_back(a * unitEnergies);
175 data->push_back(a * unitData);
177 energyColumn = (!energyColumn);
188 G4String fullFileName = FullFileName(file);
189 std::ofstream out(fullFileName);
194 message += fullFileName;
196 G4Exception(
"G4RDEMDataSet::SaveData()",
"CannotOpenFile",
212 G4DataVector::const_iterator i = energies.begin();
213 G4DataVector::const_iterator endI = energies.end();
214 G4DataVector::const_iterator j = data.begin();
221 out << ((*i)/unitEnergies) <<
' ';
226 out << ((*j)/unitData) << std::endl;
240 out << -1.f << std::endl;
253 out << -2.f << std::endl;
261 while (!components.empty())
263 if (components.back())
delete components.back();
264 components.pop_back();
271 char* path = getenv(
"G4LEDATA");
273 G4Exception(
"G4RDShellEMDataSet::FullFileName()",
"InvalidSetup",
276 std::ostringstream fullFileName;
278 fullFileName << path <<
'/' << fileName << z <<
".dat";
280 return G4String(fullFileName.str().c_str());
virtual void SetEnergiesData(G4DataVector *x, G4DataVector *data, G4int component=0)=0
virtual G4RDVDataSetAlgorithm * Clone() const =0
virtual const G4DataVector & GetData(G4int componentId) const =0
virtual void PrintData(void) const
void CleanUpComponents(void)
virtual ~G4RDShellEMDataSet()
double precision function energy(A, Z)
G4GLOB_DLL std::ostream G4cout
virtual void PrintData(void) const =0
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
virtual const G4DataVector & GetEnergies(G4int componentId) const =0
virtual void SetEnergiesData(G4DataVector *energies, G4DataVector *data, G4int componentId)
virtual void AddComponent(G4RDVEMDataSet *dataSet)
virtual G4bool SaveData(const G4String &fileName) const
virtual const G4RDVEMDataSet * GetComponent(G4int componentId) const
virtual G4double FindValue(G4double energy, G4int componentId=0) const
const XML_Char int const XML_Char * value
virtual size_t NumberOfComponents(void) const
virtual G4bool LoadData(const G4String &fileName)
G4RDShellEMDataSet(G4int Z, G4RDVDataSetAlgorithm *algo, G4double eUnit=CLHEP::MeV, G4double dataUnit=CLHEP::barn)
const XML_Char const XML_Char * data