Geant4 11.1.1
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 "G4NistManager.hh"
#include "G4UnitsTable.hh"
#include "G4PhysicalConstants.hh"
#include "G4SystemOfUnits.hh"
#include "G4ExtendedMaterial.hh"
#include "G4AtomicShells.hh"
#include "G4ApplicationState.hh"
#include "G4StateManager.hh"
#include "G4Exp.hh"
#include "G4Log.hh"

Go to the source code of this file.

Functions

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

Function Documentation

◆ operator<<() [1/3]

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

Definition at line 818 of file G4Material.cc.

819{
820 flux << &material;
821 return flux;
822}

◆ operator<<() [2/3]

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

Definition at line 773 of file G4Material.cc.

774{
775 std::ios::fmtflags mode = flux.flags();
776 flux.setf(std::ios::fixed,std::ios::floatfield);
777 G4long prec = flux.precision(3);
778
779 flux
780 << " Material: " << std::setw(8) << material->fName
781 << " " << material->fChemicalFormula << " "
782 << " density: " << std::setw(6) << std::setprecision(3)
783 << G4BestUnit(material->fDensity,"Volumic Mass")
784 << " RadL: " << std::setw(7) << std::setprecision(3)
785 << G4BestUnit(material->fRadlen,"Length")
786 << " Nucl.Int.Length: " << std::setw(7) << std::setprecision(3)
787 << G4BestUnit(material->fNuclInterLen,"Length")
788 << "\n" << std::setw(30)
789 << " Imean: " << std::setw(7) << std::setprecision(3)
790 << G4BestUnit(material->GetIonisation()->GetMeanExcitationEnergy(),"Energy")
791 << " temperature: " << std::setw(6) << std::setprecision(2)
792 << (material->fTemp)/CLHEP::kelvin << " K"
793 << " pressure: " << std::setw(6) << std::setprecision(2)
794 << (material->fPressure)/CLHEP::atmosphere << " atm" << "\n";
795
796 for (G4int i=0; i<material->fNumberOfElements; i++) {
797 flux
798 << "\n ---> " << (*(material->theElementVector))[i]
799 << "\n ElmMassFraction: "
800 << std::setw(6)<< std::setprecision(2)
801 << (material->fMassFractionVector[i])/perCent << " %"
802 << " ElmAbundance " << std::setw(6)<< std::setprecision(2)
803 << 100*(material->fVecNbOfAtomsPerVolume[i])
804 /(material->fTotNbOfAtomsPerVolume)
805 << " % \n";
806 }
807 flux.precision(prec);
808 flux.setf(mode,std::ios::floatfield);
809
810 if(material->IsExtended())
811 { static_cast<const G4ExtendedMaterial*>(material)->Print(flux); }
812
813 return flux;
814}
#define G4BestUnit(a, b)
long G4long
Definition: G4Types.hh:87
int G4int
Definition: G4Types.hh:85
G4double GetMeanExcitationEnergy() const
virtual G4bool IsExtended() const
Definition: G4Material.cc:842
G4IonisParamMat * GetIonisation() const
Definition: G4Material.hh:221

◆ operator<<() [3/3]

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

Definition at line 826 of file G4Material.cc.

827{
828 //Dump info for all known materials
829 flux << "\n***** Table : Nb of materials = " << MaterialTable.size()
830 << " *****\n" << G4endl;
831
832 for(auto i : MaterialTable)
833 {
834 flux << i << G4endl << G4endl;
835 }
836
837 return flux;
838}
#define G4endl
Definition: G4ios.hh:57