Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
G4Material.cc File Reference
#include <iomanip>
#include "G4Material.hh"
#include "G4UnitsTable.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,
G4Material material 
)

Definition at line 697 of file G4Material.cc.

References python.hepunit::atmosphere, G4BestUnit, G4Material::GetIonisation(), G4IonisParamMat::GetMeanExcitationEnergy(), python.hepunit::kelvin, kStateGas, and python.hepunit::perCent.

698 {
699  std::ios::fmtflags mode = flux.flags();
700  flux.setf(std::ios::fixed,std::ios::floatfield);
701  G4long prec = flux.precision(3);
702 
703  flux
704  << " Material: " << std::setw(8) << material->fName
705  << " " << material->fChemicalFormula << " "
706  << " density: " << std::setw(6) << std::setprecision(3)
707  << G4BestUnit(material->fDensity,"Volumic Mass")
708  << " RadL: " << std::setw(7) << std::setprecision(3)
709  << G4BestUnit(material->fRadlen,"Length")
710  << " Nucl.Int.Length: " << std::setw(7) << std::setprecision(3)
711  << G4BestUnit(material->fNuclInterLen,"Length") <<"\n" << std::setw(30)
712  << " Imean: " << std::setw(7) << std::setprecision(3)
713  << G4BestUnit(material->GetIonisation()->GetMeanExcitationEnergy(),"Energy");
714 
715  if(material->fState == kStateGas) {
716  flux
717  << " temperature: " << std::setw(6) << std::setprecision(2)
718  << (material->fTemp)/kelvin << " K"
719  << " pressure: " << std::setw(6) << std::setprecision(2)
720  << (material->fPressure)/atmosphere << " atm";
721  }
722  flux << "\n";
723 
724  for (size_t i=0; i<material->fNumberOfElements; i++) {
725  flux
726  << "\n ---> " << (*(material->theElementVector))[i]
727  << "\n ElmMassFraction: "
728  << std::setw(6)<< std::setprecision(2)
729  << (material->fMassFractionVector[i])/perCent << " %"
730  << " ElmAbundance " << std::setw(6)<< std::setprecision(2)
731  << 100*(material->VecNbOfAtomsPerVolume[i])/(material->TotNbOfAtomsPerVolume)
732  << " % \n";
733  }
734  flux.precision(prec);
735  flux.setf(mode,std::ios::floatfield);
736 
737  return flux;
738 }
G4IonisParamMat * GetIonisation() const
Definition: G4Material.hh:224
int atmosphere
Definition: hepunit.py:151
long G4long
Definition: G4Types.hh:80
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
float perCent
Definition: hepunit.py:239
G4double GetMeanExcitationEnergy() const
std::ostream& operator<< ( std::ostream &  flux,
G4Material material 
)

Definition at line 742 of file G4Material.cc.

References eplot::material.

743 {
744  flux << &material;
745  return flux;
746 }
string material
Definition: eplot.py:19
std::ostream& operator<< ( std::ostream &  flux,
G4MaterialTable  MaterialTable 
)

Definition at line 750 of file G4Material.cc.

References G4endl.

751 {
752  //Dump info for all known materials
753  flux << "\n***** Table : Nb of materials = " << MaterialTable.size()
754  << " *****\n" << G4endl;
755 
756  for (size_t i=0; i<MaterialTable.size(); ++i) {
757  flux << MaterialTable[i] << G4endl << G4endl;
758  }
759 
760  return flux;
761 }
#define G4endl
Definition: G4ios.hh:61