Read all data from files.
53{
56 ed << " Data missing: set environment variable G4ABLADATA\n"
57 << " to point to the directory containing data files needed\n"
58 <<
" by the ABLA model" <<
G4endl;
60 }
62
63 G4String flAlphaFile(dataPath + "/flalpha.dat");
64 G4String frldmFile(dataPath + "/frldm.dat");
65 G4String vgsldFile(dataPath + "/vgsld.dat");
66 G4String rmsFile(dataPath + "/rms.dat");
67 G4String defoFile(dataPath + "/defo.dat");
68 G4String massFile(dataPath + "/mass2020.dat");
69
70 if (verboseLevel > 1) {
71
72
73
74
75 }
76
77 std::ifstream flalphain(flAlphaFile.c_str());
78 std::ifstream frldmin(frldmFile.c_str());
79 std::ifstream vgsldin(vgsldFile.c_str());
80 std::ifstream rmsin(rmsFile.c_str());
81 std::ifstream defoin(defoFile.c_str());
82 std::ifstream massin(massFile.c_str());
83
84 if (!massin.is_open()) {
85 massFile = dataPath + "/mass2016.dat";
86 massin.close();
87 massin.open(massFile.c_str());
88 std::cout << "Mass evaluation file mass2020.dat not found, current file: " << massFile.c_str()
89 << std::endl;
90
91 if (!massin.is_open()) {
92 massFile = dataPath + "/mass2003.dat";
93 massin.close();
94 massin.open(massFile.c_str());
95 std::cout << "Mass evaluation file mass2016.dat not found, current file: " << massFile.c_str()
96 << std::endl;
97 }
98 }
99
100 std::filebuf* buf1 = flalphain.rdbuf();
101 std::filebuf* buf2 = frldmin.rdbuf();
102 std::filebuf* buf3 = vgsldin.rdbuf();
103 std::filebuf* buf4 = rmsin.rdbuf();
104 std::filebuf* buf5 = defoin.rdbuf();
105 std::filebuf* buf6 = massin.rdbuf();
106 if (!((buf1->is_open()) && (buf2->is_open()) && (buf3->is_open()) && (buf4->is_open())
107 && (buf5->is_open()) && (buf6->is_open())))
108 {
110 ed << "Data missing: could not find ABLA data file in " << dataPath
111 <<
"defined by environment variable G4ABLADATA" <<
G4endl;
113 }
114
115 G4double fflalpha, ffrldm, fvgsld, frms;
116 G4int fj = 0, fk = 0, a2, a3, a4;
119 const G4int rows = 99;
120 const G4int cols = 154;
121 const G4int rowsbeta = 137;
122 const G4int colsbeta = 251;
123
130 }
131 }
132
133 for (
G4int i = 0; i < rows; i++) {
134 for (
G4int j = 0; j < cols; j++) {
135 flalphain >> fflalpha;
136 frldmin >> ffrldm;
137 vgsldin >> fvgsld;
138 rmsin >> frms;
143 }
144 }
145
146 for (
G4int i = 0; i < rowsbeta; i++) {
147 for (
G4int j = 0; j < colsbeta; j++) {
150 }
151 }
152
153 defoin >> fj >> fk >> fbeta2 >> fbeta4;
154 while (!defoin.eof()) {
157 defoin >> fj >> fk >> fbeta2 >> fbeta4;
158 }
159
164 }
165 }
166 massin >> a2 >> a3 >> a4 >> a7;
167 while (!massin.eof()) {
168
171 setMexp(a2, a3, 938.7829835 * a3 + 939.5653301 * a2 - 1. * a4 * a7 / 1000.);
172 }
173 massin >> a2 >> a3 >> a4 >> a7;
174 }
175
176 flalphain.close();
177 frldmin.close();
178 vgsldin.close();
179 rmsin.close();
180 defoin.close();
181 massin.close();
182
183 return true;
184}
constexpr const G4int zcols
constexpr const G4int nrows
constexpr const G4int lpcols
const char * G4FindDataDir(const char *)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
G4bool setEcnz(G4int A, G4int Z, G4double value)
G4bool setBeta4(G4int A, G4int Z, G4double value)
G4bool setVgsld(G4int A, G4int Z, G4double value)
G4bool setAlpha(G4int A, G4int Z, G4double value)
G4bool setMexp(G4int A, G4int Z, G4double value)
G4bool setBeta2(G4int A, G4int Z, G4double value)
G4bool setMexpID(G4int A, G4int Z, G4int value)
G4bool setRms(G4int A, G4int Z, G4double value)