Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 "G4ExtendedMaterial.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

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

Definition at line 650 of file G4Material.cc.

651 {
652  std::ios::fmtflags mode = flux.flags();
653  flux.setf(std::ios::fixed,std::ios::floatfield);
654  G4long prec = flux.precision(3);
655 
656  flux
657  << " Material: " << std::setw(8) << material->fName
658  << " " << material->fChemicalFormula << " "
659  << " density: " << std::setw(6) << std::setprecision(3)
660  << G4BestUnit(material->fDensity,"Volumic Mass")
661  << " RadL: " << std::setw(7) << std::setprecision(3)
662  << G4BestUnit(material->fRadlen,"Length")
663  << " Nucl.Int.Length: " << std::setw(7) << std::setprecision(3)
664  << G4BestUnit(material->fNuclInterLen,"Length")
665  << "\n" << std::setw(30)
666  << " Imean: " << std::setw(7) << std::setprecision(3)
668  "Energy");
669 
670  if(material->fState == kStateGas) {
671  flux
672  << " temperature: " << std::setw(6) << std::setprecision(2)
673  << (material->fTemp)/kelvin << " K"
674  << " pressure: " << std::setw(6) << std::setprecision(2)
675  << (material->fPressure)/atmosphere << " atm";
676  }
677  flux << "\n";
678 
679  for (G4int i=0; i<material->fNumberOfElements; i++) {
680  flux
681  << "\n ---> " << (*(material->theElementVector))[i]
682  << "\n ElmMassFraction: "
683  << std::setw(6)<< std::setprecision(2)
684  << (material->fMassFractionVector[i])/perCent << " %"
685  << " ElmAbundance " << std::setw(6)<< std::setprecision(2)
686  << 100*(material->VecNbOfAtomsPerVolume[i])
687  /(material->TotNbOfAtomsPerVolume)
688  << " % \n";
689  }
690  flux.precision(prec);
691  flux.setf(mode,std::ios::floatfield);
692 
693  if(material->IsExtended())
694  { static_cast<const G4ExtendedMaterial*>(material)->Print(flux); }
695 
696  return flux;
697 }
G4IonisParamMat * GetIonisation() const
Definition: G4Material.hh:226
static constexpr double perCent
Definition: G4SIunits.hh:332
long G4long
Definition: G4Types.hh:80
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
int G4int
Definition: G4Types.hh:78
virtual G4bool IsExtended() const
Definition: G4Material.cc:724
static const double prec
Definition: RanecuEngine.cc:58
static constexpr double kelvin
Definition: G4SIunits.hh:281
G4double GetMeanExcitationEnergy() const
inflate_mode mode
Definition: inflate.h:82
static constexpr double atmosphere
Definition: G4SIunits.hh:237

Here is the call graph for this function:

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

Definition at line 701 of file G4Material.cc.

702 {
703  flux << &material;
704  return flux;
705 }
std::ostream& operator<< ( std::ostream &  flux,
G4MaterialTable  MaterialTable 
)

Definition at line 709 of file G4Material.cc.

710 {
711  //Dump info for all known materials
712  flux << "\n***** Table : Nb of materials = " << MaterialTable.size()
713  << " *****\n" << G4endl;
714 
715  for (size_t i=0; i<MaterialTable.size(); ++i) {
716  flux << MaterialTable[i] << G4endl << G4endl;
717  }
718 
719  return flux;
720 }
#define G4endl
Definition: G4ios.hh:61