Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4Material.cc File Reference
#include "G4Material.hh"
#include "G4ApplicationState.hh"
#include "G4AtomicShells.hh"
#include "G4Exp.hh"
#include "G4ExtendedMaterial.hh"
#include "G4Log.hh"
#include "G4NistManager.hh"
#include "G4PhysicalConstants.hh"
#include "G4StateManager.hh"
#include "G4SystemOfUnits.hh"
#include "G4UnitsTable.hh"
#include <iomanip>

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 767 of file G4Material.cc.

768{
769 flux << &material;
770 return flux;
771}

◆ operator<<() [2/3]

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

Definition at line 726 of file G4Material.cc.

727{
728 std::ios::fmtflags mode = flux.flags();
729 flux.setf(std::ios::fixed, std::ios::floatfield);
730 G4long prec = flux.precision(3);
731
732 flux << " Material: " << std::setw(8) << material->fName << " " << material->fChemicalFormula
733 << " "
734 << " density: " << std::setw(6) << std::setprecision(3)
735 << G4BestUnit(material->fDensity, "Volumic Mass") << " RadL: " << std::setw(7)
736 << std::setprecision(3) << G4BestUnit(material->fRadlen, "Length")
737 << " Nucl.Int.Length: " << std::setw(7) << std::setprecision(3)
738 << G4BestUnit(material->fNuclInterLen, "Length") << "\n"
739 << std::setw(30) << " Imean: " << std::setw(7) << std::setprecision(3)
740 << G4BestUnit(material->GetIonisation()->GetMeanExcitationEnergy(), "Energy")
741 << " temperature: " << std::setw(6) << std::setprecision(2)
742 << (material->fTemp) / CLHEP::kelvin << " K"
743 << " pressure: " << std::setw(6) << std::setprecision(2)
744 << (material->fPressure) / CLHEP::atmosphere << " atm"
745 << "\n";
746
747 for (G4int i = 0; i < material->fNumberOfElements; i++) {
748 flux << "\n ---> " << (*(material->theElementVector))[i]
749 << "\n ElmMassFraction: " << std::setw(6) << std::setprecision(2)
750 << (material->fMassFractionVector[i]) / perCent << " %"
751 << " ElmAbundance " << std::setw(6) << std::setprecision(2)
752 << 100 * (material->fVecNbOfAtomsPerVolume[i]) / (material->fTotNbOfAtomsPerVolume)
753 << " % \n";
754 }
755 flux.precision(prec);
756 flux.setf(mode, std::ios::floatfield);
757
758 if (material->IsExtended()) {
759 static_cast<const G4ExtendedMaterial*>(material)->Print(flux);
760 }
761
762 return flux;
763}
#define G4BestUnit(a, b)
long G4long
Definition G4Types.hh:87
int G4int
Definition G4Types.hh:85
G4double GetMeanExcitationEnergy() const
virtual G4bool IsExtended() const
G4IonisParamMat * GetIonisation() const

◆ operator<<() [3/3]

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

Definition at line 775 of file G4Material.cc.

776{
777 // Dump info for all known materials
778 flux << "\n***** Table : Nb of materials = " << MaterialTable.size() << " *****\n" << G4endl;
779
780 for (auto i : MaterialTable) {
781 flux << i << G4endl << G4endl;
782 }
783
784 return flux;
785}
#define G4endl
Definition G4ios.hh:67