// $Id$ // Category: geometry // // See the class description in the header file. #include "TG4GeometryOutputManager.h" #include #include TG4GeometryOutputManager::TG4GeometryOutputManager() { // } TG4GeometryOutputManager::~TG4GeometryOutputManager() { // } // public methods void TG4GeometryOutputManager::OpenFile(G4String filePath) { // Opens output files. // --- G4cout << "TG4GeometryOutputManager::OpenFile: " << filePath << endl; fOutFile.open(filePath, ios::out, filebuf::openprot); if (!fOutFile) { G4String text = "Cannot open "; text = text + filePath; TG4Globals::Warning(text); } // use FORTRAN compatibility output fOutFile << setiosflags(ios::showpoint | ios::uppercase); } void TG4GeometryOutputManager::CloseFile() { // Closess output files. // --- fOutFile.close(); } void TG4GeometryOutputManager::WriteGsvolu( G4String vname, G4String shape, G4int nmed, G4double* Rpar, G4int npar) { // from fortran (g3routines.F) // write(fmt,'(A,I2,A)')'(a4,1x,a6,1x,a4,1x,a4,2i5,',max(npar,1), //> '(1x,e16.8))' // write(lunlist,fmt) context, rname, name, shape, nmed, npar, //+ (par(k),k=1,npar) // --- G4String context("----"); G4String rname("GSVOLU"); G4String space(" "); fOutFile << context << space << rname << space << vname << space << shape << setw(5) << nmed << setw(5) << npar; for (G4int i=0; i '(a4,1x,a6,i5,1x,''"'',a,''"'',3i3,6(1x,e16.8),i3,', //> max(nwbuf,1),'(1x,e16.8))' // write(lunlist,fmt) //+ context, rname, itmed, name, nmat, isvol, ifield, fieldm, //+ tmaxfd, stemax, deemax, epsil, stmin, //+ nwbuf, (ubuf(k),k=1,nwbuf) // --- G4String context("----"); G4String rname("GSTMED"); G4String space(" "); fOutFile << context << space << rname << space << setw(5) << itmed << space << '"' << name << '"' << setw(3) << nmat << setw(3) << isvol << setw(3) << ifield << space << setw(16) << setprecision(8) << fieldm << space << setw(16) << setprecision(8) << tmaxfd << space << setw(16) << setprecision(8) << stemax << space << setw(16) << setprecision(8) << deemax << space << setw(16) << setprecision(8) << epsil << space << setw(16) << setprecision(8) << stmin << space << setw(3) << nwbuf; for (G4int i=0; i