Geant4  10.02.p03
G4Material.cc File Reference
#include <iomanip>
#include "G4Material.hh"
#include "G4NistManager.hh"
#include "G4UnitsTable.hh"
#include "G4PhysicalConstants.hh"
#include "G4SystemOfUnits.hh"
#include "G4Exp.hh"
#include "G4Log.hh"
Include dependency graph for G4Material.cc:

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, G4MaterialTable MaterialTable)
 

Function Documentation

◆ operator<<() [1/3]

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

Definition at line 665 of file G4Material.cc.

666 {
667  std::ios::fmtflags mode = flux.flags();
668  flux.setf(std::ios::fixed,std::ios::floatfield);
669  G4long prec = flux.precision(3);
670 
671  flux
672  << " Material: " << std::setw(8) << material->fName
673  << " " << material->fChemicalFormula << " "
674  << " density: " << std::setw(6) << std::setprecision(3)
675  << G4BestUnit(material->fDensity,"Volumic Mass")
676  << " RadL: " << std::setw(7) << std::setprecision(3)
677  << G4BestUnit(material->fRadlen,"Length")
678  << " Nucl.Int.Length: " << std::setw(7) << std::setprecision(3)
679  << G4BestUnit(material->fNuclInterLen,"Length")
680  << "\n" << std::setw(30)
681  << " Imean: " << std::setw(7) << std::setprecision(3)
683  "Energy");
684 
685  if(material->fState == kStateGas) {
686  flux
687  << " temperature: " << std::setw(6) << std::setprecision(2)
688  << (material->fTemp)/kelvin << " K"
689  << " pressure: " << std::setw(6) << std::setprecision(2)
690  << (material->fPressure)/atmosphere << " atm";
691  }
692  flux << "\n";
693 
694  for (G4int i=0; i<material->fNumberOfElements; i++) {
695  flux
696  << "\n ---> " << (*(material->theElementVector))[i]
697  << "\n ElmMassFraction: "
698  << std::setw(6)<< std::setprecision(2)
699  << (material->fMassFractionVector[i])/perCent << " %"
700  << " ElmAbundance " << std::setw(6)<< std::setprecision(2)
701  << 100*(material->VecNbOfAtomsPerVolume[i])
702  /(material->TotNbOfAtomsPerVolume)
703  << " % \n";
704  }
705  flux.precision(prec);
706  flux.setf(mode,std::ios::floatfield);
707 
708  return flux;
709 }
G4IonisParamMat * GetIonisation() const
Definition: G4Material.hh:226
G4int fNumberOfElements
Definition: G4Material.hh:322
G4ElementVector * theElementVector
Definition: G4Material.hh:323
long G4long
Definition: G4Types.hh:80
G4double fDensity
Definition: G4Material.hh:311
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
G4double * fMassFractionVector
Definition: G4Material.hh:324
int G4int
Definition: G4Types.hh:78
static const double prec
Definition: RanecuEngine.cc:58
G4double GetMeanExcitationEnergy() const
G4double TotNbOfAtomsPerVolume
Definition: G4Material.hh:339
G4double fRadlen
Definition: G4Material.hh:341
static const double perCent
Definition: G4SIunits.hh:329
G4double fNuclInterLen
Definition: G4Material.hh:342
static const double kelvin
Definition: G4SIunits.hh:278
G4String fChemicalFormula
Definition: G4Material.hh:310
static const double atmosphere
Definition: G4SIunits.hh:234
G4State fState
Definition: G4Material.hh:313
G4double fTemp
Definition: G4Material.hh:315
G4double fPressure
Definition: G4Material.hh:316
G4double * VecNbOfAtomsPerVolume
Definition: G4Material.hh:338
G4String fName
Definition: G4Material.hh:309
Here is the call graph for this function:

◆ operator<<() [2/3]

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

Definition at line 713 of file G4Material.cc.

714 {
715  flux << &material;
716  return flux;
717 }
string material
Definition: eplot.py:19

◆ operator<<() [3/3]

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

Definition at line 721 of file G4Material.cc.

722 {
723  //Dump info for all known materials
724  flux << "\n***** Table : Nb of materials = " << MaterialTable.size()
725  << " *****\n" << G4endl;
726 
727  for (size_t i=0; i<MaterialTable.size(); ++i) {
728  flux << MaterialTable[i] << G4endl << G4endl;
729  }
730 
731  return flux;
732 }
#define G4endl
Definition: G4ios.hh:61