Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4Element.cc File Reference
#include <iomanip>
#include <sstream>
#include "G4Element.hh"
#include "G4AtomicShells.hh"
#include "G4NistManager.hh"
#include "G4PhysicalConstants.hh"
#include "G4SystemOfUnits.hh"
#include "G4Log.hh"

Go to the source code of this file.

Functions

std::ostream & operator<< (std::ostream &flux, const G4Element *element)
 
std::ostream & operator<< (std::ostream &flux, const G4Element &element)
 
std::ostream & operator<< (std::ostream &flux, G4ElementTable ElementTable)
 

Function Documentation

◆ operator<<() [1/3]

std::ostream & operator<< ( std::ostream &  flux,
const G4Element element 
)

Definition at line 458 of file G4Element.cc.

459{
460 flux << &element;
461 return flux;
462}

◆ operator<<() [2/3]

std::ostream & operator<< ( std::ostream &  flux,
const G4Element element 
)

Definition at line 431 of file G4Element.cc.

432{
433 std::ios::fmtflags mode = flux.flags();
434 flux.setf(std::ios::fixed,std::ios::floatfield);
435 G4long prec = flux.precision(3);
436
437 flux
438 << " Element: " << element->fName << " (" << element->fSymbol << ")"
439 << " Z = " << std::setw(4) << std::setprecision(1) << element->fZeff
440 << " N = " << std::setw(5) << std::setprecision(1)
441 << G4lrint(element->fNeff)
442 << " A = " << std::setw(6) << std::setprecision(3)
443 << (element->fAeff)/(g/mole) << " g/mole";
444
445 for (G4int i=0; i<element->fNumberOfIsotopes; i++)
446 flux
447 << "\n ---> " << (*(element->theIsotopeVector))[i]
448 << " abundance: " << std::setw(6) << std::setprecision(3)
449 << (element->fRelativeAbundanceVector[i])/perCent << " %";
450
451 flux.precision(prec);
452 flux.setf(mode,std::ios::floatfield);
453 return flux;
454}
long G4long
Definition: G4Types.hh:87
int G4int
Definition: G4Types.hh:85
int G4lrint(double ad)
Definition: templates.hh:134

◆ operator<<() [3/3]

std::ostream & operator<< ( std::ostream &  flux,
G4ElementTable  ElementTable 
)

Definition at line 466 of file G4Element.cc.

467{
468 //Dump info for all known elements
469 flux << "\n***** Table : Nb of elements = " << ElementTable.size()
470 << " *****\n" << G4endl;
471
472 for (size_t i=0; i<ElementTable.size(); i++) flux << ElementTable[i]
473 << G4endl << G4endl;
474
475 return flux;
476}
#define G4endl
Definition: G4ios.hh:57