Geant4 11.1.1
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, 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 467 of file G4Element.cc.

468{
469 flux << &element;
470 return flux;
471}

◆ operator<<() [2/4]

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

Definition at line 439 of file G4Element.cc.

440{
441 std::ios::fmtflags mode = flux.flags();
442 flux.setf(std::ios::fixed,std::ios::floatfield);
443 G4long prec = flux.precision(3);
444
445 flux
446 << " Element: " << element->fName << " (" << element->fSymbol << ")"
447 << " Z = " << std::setw(4) << std::setprecision(1) << element->fZeff
448 << " N = " << std::setw(5) << std::setprecision(1)
449 << G4lrint(element->fNeff)
450 << " A = " << std::setw(6) << std::setprecision(3)
451 << (element->fAeff)/(g/mole) << " g/mole";
452
453 for(G4int i = 0; i < element->fNumberOfIsotopes; i++)
454 {
455 flux << "\n ---> " << (*(element->theIsotopeVector))[i]
456 << " abundance: " << std::setw(6) << std::setprecision(3)
457 << (element->fRelativeAbundanceVector[i]) / perCent << " %";
458 }
459
460 flux.precision(prec);
461 flux.setf(mode,std::ios::floatfield);
462 return flux;
463}
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 475 of file G4Element.cc.

476{
477 //Dump info for all known elements
478 flux << "\n***** Table : Nb of elements = " << ElementTable.size()
479 << " *****\n" << G4endl;
480
481 for(auto i : ElementTable)
482 {
483 flux << i << G4endl << G4endl;
484 }
485
486 return flux;
487}
#define G4endl
Definition: G4ios.hh:57

◆ operator<<() [4/4]

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

Definition at line 491 of file G4Element.cc.

492{
493 //Dump info for all known elements
494 flux << "\n***** Vector : Nb of elements = " << ElementVector.size()
495 << " *****\n" << G4endl;
496
497 for(auto i : ElementVector)
498 {
499 flux << i << G4endl << G4endl;
500 }
501
502 return flux;
503}