56{
57 std::ostringstream ost;
59 std::ifstream fin(ost.str().c_str());
60 if (!fin.is_open()) {
62 ed << "File <" << ost.str().c_str() << "> is not opened!";
63 G4Exception(
"G4DNASamplingTable::LoadDifferential ",
"em0003",
65 return;
66 }
67
72 std::vector<G4double>* v = nullptr;
73 std::vector<G4double>* vPDF[5];
74 for (;;) {
75 fin >> e;
76 if (fin.eof()) { break; }
77 if (e != e0 || nullptr == v) {
78 fPrimaryEnergy.push_back(e*factE);
79 e0 = e;
80 ++fNpoints;
81 v = new std::vector<G4double>;
82 fSecEnergy.push_back(v);
83 for (
G4int i=0; i<5; ++i) {
84 vPDF[i] = new std::vector<G4double>;
85 (fPDF[i]).push_back(vPDF[i]);
86 }
87 ntmax = std::max(ntmax, nt);
88 nt = 0;
89 }
90 fin >> t;
91 v->push_back(t*factE);
92 ++nt;
93 for (
G4int i=0; i<5; ++i) {
94 fin >> sig;
95 sig *= fact;
96 (vPDF[i])->push_back(sig);
97 }
98 if (fin.eof()) { break; }
99 }
100 if (verbose) {
101 G4cout <<
"G4DNASamplingTable::LoadData from file:" <<
G4endl;
103 G4cout <<
" Nenergy= " << fNpoints <<
" NmaxT= " << ntmax <<
G4endl;
104 }
105 if (fNpoints > 0) { --fNpoints; }
106}
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
G4GLOB_DLL std::ostream G4cout
static G4EmParameters * Instance()
const G4String & GetDirLEDATA() const