Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
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

◆ operator<<() [1/3]

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

Definition at line 740 of file G4Material.cc.

741{
742 flux << &material;
743 return flux;
744}

◆ operator<<() [2/3]

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

Definition at line 697 of file G4Material.cc.

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")
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 for (size_t i=0; i<material->fNumberOfElements; i++) {
723 flux
724 << "\n ---> " << (*(material->theElementVector))[i]
725 << "\n ElmMassFraction: "
726 << std::setw(6)<< std::setprecision(2)
727 << (material->fMassFractionVector[i])/perCent << " %"
728 << " ElmAbundance " << std::setw(6)<< std::setprecision(2)
729 << 100*(material->VecNbOfAtomsPerVolume[i])/(material->TotNbOfAtomsPerVolume)
730 << " % \n";
731 }
732 flux.precision(prec);
733 flux.setf(mode,std::ios::floatfield);
734
735 return flux;
736}
@ kStateGas
Definition: G4Material.hh:114
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
long G4long
Definition: G4Types.hh:68
G4double GetMeanExcitationEnergy() const
G4IonisParamMat * GetIonisation() const
Definition: G4Material.hh:225

◆ operator<<() [3/3]

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

Definition at line 748 of file G4Material.cc.

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