G4Material.cc File Reference

#include <iomanip>
#include "G4Material.hh"
#include "G4UnitsTable.hh"
#include "G4Pow.hh"
#include "G4PhysicalConstants.hh"
#include "G4SystemOfUnits.hh"

Go to the source code of this file.

Functions

std::ostream & operator<< (std::ostream &flux, G4Material *material)
std::ostream & operator<< (std::ostream &flux, G4Material &material)
std::ostream & operator<< (std::ostream &flux, G4MaterialTable MaterialTable)


Function Documentation

std::ostream& operator<< ( std::ostream &  flux,
G4MaterialTable  MaterialTable 
)

Definition at line 748 of file G4Material.cc.

References G4endl.

00749 {
00750   //Dump info for all known materials
00751   flux << "\n***** Table : Nb of materials = " << MaterialTable.size() 
00752        << " *****\n" << G4endl;
00753         
00754   for (size_t i=0; i<MaterialTable.size(); ++i) { 
00755     flux << MaterialTable[i] << G4endl << G4endl; 
00756   }
00757 
00758   return flux;
00759 }      

std::ostream& operator<< ( std::ostream &  flux,
G4Material material 
)

Definition at line 740 of file G4Material.cc.

00741 {
00742   flux << &material;        
00743   return flux;
00744 }

std::ostream& operator<< ( std::ostream &  flux,
G4Material material 
)

Definition at line 697 of file G4Material.cc.

References G4Material::fChemicalFormula, G4Material::fDensity, G4Material::fMassFractionVector, G4Material::fName, G4Material::fNuclInterLen, G4Material::fNumberOfElements, G4Material::fPressure, G4Material::fRadlen, G4Material::fState, G4Material::fTemp, G4BestUnit, G4Material::GetIonisation(), G4IonisParamMat::GetMeanExcitationEnergy(), kStateGas, G4Material::theElementVector, G4Material::TotNbOfAtomsPerVolume, and G4Material::VecNbOfAtomsPerVolume.

00698 {
00699   std::ios::fmtflags mode = flux.flags();
00700   flux.setf(std::ios::fixed,std::ios::floatfield);
00701   G4long prec = flux.precision(3);
00702   
00703   flux
00704     << " Material: "         << std::setw(8) <<  material->fName
00705     << " " << material->fChemicalFormula << " "
00706     << "  density: "         << std::setw(6) << std::setprecision(3)  
00707     << G4BestUnit(material->fDensity,"Volumic Mass") 
00708     << "  RadL: "            << std::setw(7)  << std::setprecision(3)  
00709     << G4BestUnit(material->fRadlen,"Length")
00710     << "  Nucl.Int.Length: " << std::setw(7)  << std::setprecision(3)  
00711     << G4BestUnit(material->fNuclInterLen,"Length")    
00712     << "  Imean: "           << std::setw(7)  << std::setprecision(3)  
00713     << G4BestUnit(material->GetIonisation()->GetMeanExcitationEnergy(),"Energy");
00714     
00715   if(material->fState == kStateGas) {
00716     flux
00717       << "  temperature: " << std::setw(6) << std::setprecision(2)  
00718       << (material->fTemp)/kelvin << " K"
00719       << "  pressure: "    << std::setw(6) << std::setprecision(2)   
00720       << (material->fPressure)/atmosphere << " atm";
00721   }
00722   for (size_t i=0; i<material->fNumberOfElements; i++) {
00723     flux 
00724       << "\n   ---> " << (*(material->theElementVector))[i] 
00725       << "\n          ElmMassFraction: " 
00726       << std::setw(6)<< std::setprecision(2) 
00727       << (material->fMassFractionVector[i])/perCent << " %" 
00728       << "  ElmAbundance "     << std::setw(6)<< std::setprecision(2) 
00729       << 100*(material->VecNbOfAtomsPerVolume[i])/(material->TotNbOfAtomsPerVolume)
00730       << " % \n";
00731   }
00732   flux.precision(prec);    
00733   flux.setf(mode,std::ios::floatfield);
00734             
00735   return flux;
00736 }


Generated on Mon May 27 17:50:51 2013 for Geant4 by  doxygen 1.4.7