Read all data from files.
67 #ifdef ABLAXX_IN_GEANT4_MODE
68 if(!getenv(
"G4ABLADATA")) {
79 ed <<
" Data missing: set environment variable G4ABLADATA\n"
80 <<
" to point to the directory containing data files needed\n"
81 <<
" by the ABLA model" <<
G4endl;
82 G4Exception(
"G4AblaDataFile::readData()",
"ABLA_001",
86 G4String dataPath(getenv(
"G4ABLADATA"));
88 G4String dataPath(theConfig->getABLAv3pCxxDataFilePath().c_str());
90 G4String flAlphaFile(dataPath +
"/flalpha.dat");
91 G4String frldmFile( dataPath +
"/frldm.dat");
92 G4String vgsldFile( dataPath +
"/vgsld.dat");
93 G4String pace2File( dataPath +
"/pace2.dat");
95 if(verboseLevel > 1) {
103 std::ifstream flalphain(flAlphaFile.c_str());
104 std::ifstream frldmin(frldmFile.c_str());
105 std::ifstream vgsldin(vgsldFile.c_str());
106 std::ifstream pace2in(pace2File.c_str());
108 std::filebuf *buf1 = flalphain.rdbuf();
109 std::filebuf *buf2 = frldmin.rdbuf();
110 std::filebuf *buf3 = vgsldin.rdbuf();
111 std::filebuf *buf4 = pace2in.rdbuf();
112 if (!((buf1->is_open()) && (buf2->is_open()) && (buf3->is_open()) && (buf4->is_open()))) {
113 #ifdef ABLAXX_IN_GEANT4_MODE
115 ed <<
" Data missing: could not find ABLA data file in " << dataPath
116 <<
"defined by environment variable G4ABLADATA" <<
G4endl;
119 std::cerr <<
"Error opening file." << std::endl;
123 G4double fflalpha, ffrldm, fvgsld, fpace2;
124 const G4int rows = 99;
125 const G4int cols = 154;
126 const G4int massnumbers = 263;
127 for(
int i = 0; i < rows; i++) {
128 for(
int j = 0; j < cols; j++) {
135 for(
int i = 0; i < rows; i++) {
136 for(
int j = 0; j < cols; j++) {
137 flalphain >> fflalpha;
150 for(
int i = 0; i < 500; i++) {
151 for(
int j = 0; j < 500; j++) {
156 int A = 0, Zbegin = 0, Zend = 0;
157 for(
int i = 0; i < massnumbers; i++) {
158 pace2in >> str1 >> A >> str2 >> Zbegin >> str3 >> Zend;
161 for(
int j = Zbegin; j <= Zend; j++) {
168 if(std::abs(
getPace2(A, Zend) - 114516.10) > 1e-6) {
169 std::cerr <<
"ERROR: Problem in parsing datafile " + pace2File << std::endl;
G4bool setVgsld(G4int A, G4int Z, G4double value)
std::ostringstream G4ExceptionDescription
G4bool setPace2(G4int A, G4int Z, G4double value)
double A(double temperature)
G4bool setEcnz(G4int A, G4int Z, G4double value)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4bool setAlpha(G4int A, G4int Z, G4double value)
G4double getPace2(G4int A, G4int Z)