// $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 << G4endl; //fOutFile.open(filePath, ios::out, filebuf::openprot); fOutFile.open(filePath, G4std::ios::out); //, G4std::filebuf::openprot); if (!fOutFile) { G4String text = "Cannot open "; text = text + filePath; TG4Globals::Warning(text); } // use FORTRAN compatibility output fOutFile << G4std::setiosflags(G4std::ios::showpoint | G4std::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 << G4std::setw(5) << nmed << G4std::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 << G4std::setw(5) << itmed << space << '"' << name << '"' << G4std::setw(3) << nmat << G4std::setw(3) << isvol << G4std::setw(3) << ifield << space << G4std::setw(16) << G4std::setprecision(8) << fieldm << space << G4std::setw(16) << G4std::setprecision(8) << tmaxfd << space << G4std::setw(16) << G4std::setprecision(8) << stemax << space << G4std::setw(16) << G4std::setprecision(8) << deemax << space << G4std::setw(16) << G4std::setprecision(8) << epsil << space << G4std::setw(16) << G4std::setprecision(8) << stmin << space << G4std::setw(3) << nwbuf; for (G4int i=0; i