34#define ABLAXX_IN_GEANT4_MODE 1
40#ifdef ABLAXX_IN_GEANT4_MODE
51#ifdef ABLAXX_IN_GEANT4_MODE
70#ifdef ABLAXX_IN_GEANT4_MODE
82 ed <<
" Data missing: set environment variable G4ABLADATA\n"
83 <<
" to point to the directory containing data files needed\n"
84 <<
" by the ABLA model" <<
G4endl;
85 G4Exception(
"G4AblaDataFile::readData()",
"ABLA_001",
90 G4String dataPath(theConfig->getABLAXXDataFilePath().c_str());
92 G4String flAlphaFile(dataPath +
"/flalpha.dat");
93 G4String frldmFile( dataPath +
"/frldm.dat");
94 G4String vgsldFile( dataPath +
"/vgsld.dat");
95 G4String pace2File( dataPath +
"/pace2.dat");
96 G4String rmsFile( dataPath +
"/rms.dat");
97 G4String defoFile( dataPath +
"/defo.dat");
98 G4String massFile( dataPath +
"/mass2003.dat");
100 if(verboseLevel > 1) {
108 std::ifstream flalphain(flAlphaFile.c_str());
109 std::ifstream frldmin(frldmFile.c_str());
110 std::ifstream vgsldin(vgsldFile.c_str());
111 std::ifstream pace2in(pace2File.c_str());
112 std::ifstream rmsin(rmsFile.c_str());
113 std::ifstream defoin(defoFile.c_str());
114 std::ifstream massin(massFile.c_str());
116 std::filebuf *buf1 = flalphain.rdbuf();
117 std::filebuf *buf2 = frldmin.rdbuf();
118 std::filebuf *buf3 = vgsldin.rdbuf();
119 std::filebuf *buf4 = pace2in.rdbuf();
120 std::filebuf *buf5 = rmsin.rdbuf();
121 std::filebuf *buf6 = defoin.rdbuf();
122 std::filebuf *buf7 = massin.rdbuf();
123 if (!((buf1->is_open()) && (buf2->is_open()) && (buf3->is_open()) && (buf4->is_open()) && (buf5->is_open()) && (buf6->is_open()) && (buf7->is_open()))) {
124#ifdef ABLAXX_IN_GEANT4_MODE
126 ed <<
"Data missing: could not find ABLA data file in " << dataPath
127 <<
"defined by environment variable G4ABLADATA" <<
G4endl;
130 std::cerr <<
"Error opening file." << std::endl;
134 G4double fflalpha, ffrldm, fvgsld, fpace2, frms;
138 const G4int rows = 99;
139 const G4int cols = 154;
140 const G4int rowsbeta = 137;
141 const G4int colsbeta = 251;
142 const G4int rowsmass = 13;
143 const G4int colsmass = 154;
144 const G4int massnumbers = 263;
145 for(
int i = 0; i < rows; i++) {
146 for(
int j = 0; j < cols; j++) {
154 for(
int i = 0; i < rows; i++) {
155 for(
int j = 0; j < cols; j++) {
156 flalphain >> fflalpha;
168 for(
int i = 0; i < rowsbeta; i++) {
169 for(
int j = 0; j < colsbeta; j++) {
175 for(
int i = 0; i < 8983; i++) {
176 defoin >> fj >> fk >> fbeta2 >> fbeta4;
181 for(
int i = 0; i < rowsmass; i++) {
182 for(
int j = 0; j < colsmass; j++) {
187 massin >> a2 >> a3 >> a4 >> a7 ;
188 while(!massin.eof()){
192 setMexp(a2,a3,938.7829835*a3+939.5653301*a2-1.*a4*a7/1000.);
194 massin >> a2 >> a3 >> a4 >> a7 ;
205 for(
int i = 0; i < 500; i++) {
206 for(
int j = 0; j < 500; j++) {
211 int A = 0, Zbegin = 0, Zend = 0;
212 for(
int i = 0; i < massnumbers; i++) {
213 pace2in >> str1 >>
A >> str2 >> Zbegin >> str3 >> Zend;
216 for(
int j = Zbegin; j <= Zend; j++) {
223 if(std::abs(
getPace2(
A, Zend) - 114516.10) > 1e-6) {
224 std::cerr <<
"ERROR: Problem in parsing datafile " + pace2File << std::endl;
const char * G4FindDataDir(const char *)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
G4bool setVgsld(G4int A, G4int Z, G4double value)
G4double getPace2(G4int A, G4int Z)
G4bool setMexp(G4int A, G4int Z, G4double value)
G4bool setEcnz(G4int A, G4int Z, G4double value)
G4bool setPace2(G4int A, G4int Z, G4double value)
G4bool setRms(G4int A, G4int Z, G4double value)
G4bool setMexpID(G4int A, G4int Z, G4int value)
G4bool setAlpha(G4int A, G4int Z, G4double value)
G4bool setBeta2(G4int A, G4int Z, G4double value)
G4bool setBeta4(G4int A, G4int Z, G4double value)