46 using namespace CLHEP;
49 :particleGun(0),gamma(0),
electron(0),
positron(0),primaryParticleData(0),particles(0)
165 static bool bFirstTime=
true;
199 static int currentFilePosition=0;
200 static int currentFileSize=0;
201 int startDataFilePosition;
210 static bool bFirstTime=
true;
213 in.seekg(-1,std::ios::end);
214 currentFileSize=in.tellg();
215 in.seekg(0,std::ios::beg);
220 in.getline(a,1000,
'\n');
221 in.getline(a,1000,
'\n');
222 startDataFilePosition=in.tellg();
223 if (currentFilePosition>0)
224 {in.seekg(currentFilePosition, std::ios::beg);}
229 static bool checkFileRewind=
false;
230 static bool bRewindTheFile=
false;
231 static int nPhSpFileRewind=0;
239 in.seekg(startDataFilePosition, std::ios::beg);
240 checkFileRewind=
true;
241 bRewindTheFile=
false;
242 G4cout<<
"\n################\nI have reached the end of the phase space file "<<++nPhSpFileRewind <<
" times, I rewind the file\n" <<
G4endl;
243 G4cout <<
"loaded " <<i <<
"/"<< nMaxParticlesInRamPhaseSpace<<
" particles" <<
G4endl;
246 in >>
x; in >>
y; in >>
z;
251 in >>
x; in >>
y; in >>
z;
258 if (in.eof()) {bRewindTheFile=
true;}
259 if (checkFileRewind) {checkFileRewind=
false;}
261 G4cout <<
"loaded " <<i <<
"/"<< nMaxParticlesInRamPhaseSpace<<
" particles" <<
G4endl;
262 currentFilePosition=in.tellg();
263 if (currentFilePosition>=currentFileSize)
264 {currentFilePosition=startDataFilePosition;}