48 if(!getenv(
"G4ABLADATA")) {
53 G4String errorMessage1 =
"ERROR: Data missing. Set environment variable G4ABLADATA\n";
54 G4String errorMessage2 =
"\t to point to the directory containing data files needed\n";
55 G4String errorMessage3 =
"\t by INCL and ABLA models.\n";
56 G4String errorMessage = errorMessage1 + errorMessage2 + errorMessage3;
60 G4String dataPath(getenv(
"G4ABLADATA"));
61 G4String flAlphaFile(dataPath +
"/flalpha.dat");
62 G4String frldmFile( dataPath +
"/frldm.dat");
63 G4String vgsldFile( dataPath +
"/vgsld.dat");
64 G4String pace2File( dataPath +
"/pace2.dat");
66 if(verboseLevel > 1) {
74 std::ifstream flalphain(flAlphaFile.c_str());
75 std::ifstream frldmin(frldmFile.c_str());
76 std::ifstream vgsldin(vgsldFile.c_str());
77 std::ifstream pace2in(pace2File.c_str());
79 std::filebuf *buf1 = flalphain.rdbuf();
80 std::filebuf *buf2 = frldmin.rdbuf();
81 std::filebuf *buf3 = vgsldin.rdbuf();
82 std::filebuf *buf4 = pace2in.rdbuf();
83 if (!((buf1->is_open()) && (buf2->is_open()) && (buf3->is_open()) && (buf4->is_open()))) {
84 G4Exception(
"ERROR: Data missing. Could not find ABLA data file in " + dataPath +
85 " defined by environment variable G4ABLADATA");
88 G4double flalpha, frldm, vgsld, pace2;
89 const G4int rows = 98;
90 const G4int cols = 153;
91 const G4int massnumbers = 263;
92 for(
int i = 0; i < rows; i++) {
93 for(
int j = 0; j < cols; j++) {
100 for(
int i = 0; i < rows; i++) {
101 for(
int j = 0; j < cols; j++) {
102 flalphain >> flalpha;
105 setAlpha(j, i, flalpha);
106 setEcnz( j, i, frldm);
107 setVgsld(j, i, vgsld);
114 int A = 0, Zbegin = 0, Zend = 0;
116 for(
int i = 0; i < 500; i++) {
117 for(
int j = 0; j < 500; j++) {
122 for(
int i = 0; i < massnumbers; i++) {
123 pace2in >> str1 >> A >> str2 >> Zbegin >> str3 >> Zend;
124 for(
int j = Zbegin; j <= Zend; j++) {
126 setPace2(A, j, pace2);
130 if(std::fabs(getPace2(A, Zend) - 114516.10) > 1e-6) {
131 G4cout <<
"ERROR: Problem in parsing datafile " + pace2File <<
G4endl;
G4DLLIMPORT std::ostream G4cout
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)