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

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, const G4ElementTable &ElementTable)
 
std::ostream & operator<< (std::ostream &flux, const G4ElementVector &ElementVector)
 

Function Documentation

◆ operator<<() [1/4]

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

Definition at line 441 of file G4Element.cc.

442{
443 flux << &element;
444 return flux;
445}

◆ operator<<() [2/4]

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

Definition at line 416 of file G4Element.cc.

417{
418 std::ios::fmtflags mode = flux.flags();
419 flux.setf(std::ios::fixed, std::ios::floatfield);
420 G4long prec = flux.precision(3);
421
422 flux << " Element: " << element->fName << " (" << element->fSymbol << ")"
423 << " Z = " << std::setw(4) << std::setprecision(1) << element->fZeff
424 << " N = " << std::setw(5) << std::setprecision(1) << G4lrint(element->fNeff)
425 << " A = " << std::setw(6) << std::setprecision(3) << (element->fAeff) / (g / mole)
426 << " g/mole";
427
428 for (G4int i = 0; i < element->fNumberOfIsotopes; i++) {
429 flux << "\n ---> " << (*(element->theIsotopeVector))[i]
430 << " abundance: " << std::setw(6) << std::setprecision(3)
431 << (element->fRelativeAbundanceVector[i]) / perCent << " %";
432 }
433
434 flux.precision(prec);
435 flux.setf(mode, std::ios::floatfield);
436 return flux;
437}
long G4long
Definition G4Types.hh:87
int G4int
Definition G4Types.hh:85
int G4lrint(double ad)
Definition templates.hh:134

◆ operator<<() [3/4]

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

Definition at line 449 of file G4Element.cc.

450{
451 // Dump info for all known elements
452 flux << "\n***** Table : Nb of elements = " << ElementTable.size() << " *****\n" << G4endl;
453
454 for (auto i : ElementTable) {
455 flux << i << G4endl << G4endl;
456 }
457
458 return flux;
459}
#define G4endl
Definition G4ios.hh:67

◆ operator<<() [4/4]

std::ostream & operator<< ( std::ostream & flux,
const G4ElementVector & ElementVector )

Definition at line 463 of file G4Element.cc.

464{
465 // Dump info for all known elements
466 flux << "\n***** Vector : Nb of elements = " << ElementVector.size() << " *****\n" << G4endl;
467
468 for (auto i : ElementVector) {
469 flux << i << G4endl << G4endl;
470 }
471
472 return flux;
473}