Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Friends
G4Element Class Reference

#include <G4Element.hh>

Public Member Functions

 G4Element (const G4String &name, const G4String &symbol, G4double Zeff, G4double Aeff)
 
 G4Element (const G4String &name, const G4String &symbol, G4int nbIsotopes)
 
void AddIsotope (G4Isotope *isotope, G4double RelativeAbundance)
 
virtual ~G4Element ()
 
const G4StringGetName () const
 
const G4StringGetSymbol () const
 
G4double GetZ () const
 
G4double GetN () const
 
G4double GetAtomicMassAmu () const
 
G4double GetA () const
 
G4bool GetNaturalAbundanceFlag () const
 
void SetNaturalAbundanceFlag (G4bool)
 
G4int GetNbOfAtomicShells () const
 
G4double GetAtomicShell (G4int index) const
 
G4int GetNbOfShellElectrons (G4int index) const
 
size_t GetNumberOfIsotopes () const
 
G4IsotopeVectorGetIsotopeVector () const
 
G4doubleGetRelativeAbundanceVector () const
 
const G4IsotopeGetIsotope (G4int iso) const
 
size_t GetIndex () const
 
G4double GetfCoulomb () const
 
G4double GetfRadTsai () const
 
G4IonisParamElmGetIonisation () const
 
G4int operator== (const G4Element &) const
 
G4int operator!= (const G4Element &) const
 
 G4Element (__void__ &)
 
void SetName (const G4String &name)
 

Static Public Member Functions

static G4ElementTableGetElementTable ()
 
static size_t GetNumberOfElements ()
 
static G4ElementGetElement (G4String name, G4bool warning=true)
 

Friends

std::ostream & operator<< (std::ostream &, G4Element *)
 
std::ostream & operator<< (std::ostream &, G4Element &)
 
std::ostream & operator<< (std::ostream &, G4ElementTable)
 

Detailed Description

Definition at line 97 of file G4Element.hh.

Constructor & Destructor Documentation

G4Element::G4Element ( const G4String name,
const G4String symbol,
G4double  Zeff,
G4double  Aeff 
)

Definition at line 74 of file G4Element.cc.

References FatalException, g(), G4endl, G4Exception(), G4lrint(), G4AtomicShells::GetBindingEnergy(), G4AtomicShells::GetNumberOfElectrons(), G4AtomicShells::GetNumberOfShells(), iz, JustWarning, python.hepunit::mole, and python.hepunit::perMillion.

76  : fName(name), fSymbol(symbol)
77 {
78  G4int iz = G4lrint(zeff);
79  if (iz < 1) {
81  ed << "Fail to create G4Element " << name
82  << " Z= " << zeff << " < 1 !";
83  G4Exception ("G4Element::G4Element()", "mat011", FatalException, ed);
84  }
85  if (std::abs(zeff - iz) > perMillion) {
87  ed << "G4Element Warning: " << name << " Z= " << zeff
88  << " A= " << aeff/(g/mole);
89  G4Exception("G4Element::G4Element()", "mat017", JustWarning, ed);
90  }
91 
92  InitializePointers();
93 
94  fZeff = zeff;
95  fNeff = aeff/(g/mole);
96  fAeff = aeff;
97 
98  if(fNeff < 1.0) fNeff = 1.0;
99 
100  if (fNeff < zeff) {
102  ed << "Fail to create G4Element " << name
103  << " with Z= " << zeff << " N= " << fNeff
104  << " N < Z is not allowed" << G4endl;
105  G4Exception("G4Element::G4Element()", "mat012", FatalException, ed);
106  }
107 
108  fNbOfAtomicShells = G4AtomicShells::GetNumberOfShells(iz);
109  fAtomicShells = new G4double[fNbOfAtomicShells];
110  fNbOfShellElectrons = new G4int[fNbOfAtomicShells];
111 
112  AddNaturalIsotopes();
113 
114  for (G4int i=0;i<fNbOfAtomicShells;i++)
115  {
116  fAtomicShells[i] = G4AtomicShells::GetBindingEnergy(iz, i);
117  fNbOfShellElectrons[i] = G4AtomicShells::GetNumberOfElectrons(iz, i);
118  }
119  ComputeDerivedQuantities();
120 }
std::ostringstream G4ExceptionDescription
Definition: globals.hh:76
int G4int
Definition: G4Types.hh:78
function g(Y1, Y2, PT2)
Definition: hijing1.383.f:5205
static G4double GetBindingEnergy(G4int Z, G4int SubshellNb)
G4double iz
Definition: TRTMaterials.hh:39
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
int G4lrint(double ad)
Definition: templates.hh:163
static G4int GetNumberOfElectrons(G4int Z, G4int SubshellNb)
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
float perMillion
Definition: hepunit.py:241
static G4int GetNumberOfShells(G4int Z)
G4Element::G4Element ( const G4String name,
const G4String symbol,
G4int  nbIsotopes 
)

Definition at line 127 of file G4Element.cc.

References FatalException, G4Exception(), and n.

129  : fName(name),fSymbol(symbol)
130 {
131  InitializePointers();
132 
133  size_t n = size_t(nIsotopes);
134 
135  if(0 >= nIsotopes) {
137  ed << "Fail to create G4Element " << name
138  << " <" << symbol << "> with " << nIsotopes
139  << " isotopes";
140  G4Exception ("G4Element::G4Element()", "mat012", FatalException, ed);
141  } else {
142  theIsotopeVector = new G4IsotopeVector(n,0);
143  fRelativeAbundanceVector = new G4double[nIsotopes];
144  }
145 }
std::vector< G4Isotope * > G4IsotopeVector
std::ostringstream G4ExceptionDescription
Definition: globals.hh:76
const G4int n
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
double G4double
Definition: G4Types.hh:76
G4Element::~G4Element ( )
virtual

Definition at line 260 of file G4Element.cc.

261 {
262  // G4cout << "### Destruction of element " << fName << " started" <<G4endl;
263 
264  if (theIsotopeVector) { delete theIsotopeVector; }
265  if (fRelativeAbundanceVector) { delete [] fRelativeAbundanceVector; }
266  if (fAtomicShells) { delete [] fAtomicShells; }
267  if (fNbOfShellElectrons) { delete [] fNbOfShellElectrons; }
268  if (fIonisation) { delete fIonisation; }
269 
270  //remove this element from theElementTable
271  theElementTable[fIndexInTable] = 0;
272 }
G4Element::G4Element ( __void__ &  )

Definition at line 252 of file G4Element.cc.

253  : fZeff(0), fNeff(0), fAeff(0)
254 {
255  InitializePointers();
256 }

Member Function Documentation

void G4Element::AddIsotope ( G4Isotope isotope,
G4double  RelativeAbundance 
)

Definition at line 151 of file G4Element.cc.

References FatalException, G4Exception(), G4AtomicShells::GetBindingEnergy(), G4AtomicShells::GetNumberOfElectrons(), G4AtomicShells::GetNumberOfShells(), G4Isotope::GetZ(), and iz.

Referenced by exrdmMaterial::AddMaterial(), G4tgbElement::BuildG4ElementFromIsotopes(), export_G4Element(), DetectorConstruction::MaterialWithSingleIsotope(), and G4GDMLReadMaterials::MixtureRead().

152 {
153  if (theIsotopeVector == 0) {
155  ed << "Fail to add Isotope to G4Element " << fName
156  << " with Z= " << fZeff << " N= " << fNeff;
157  G4Exception ("G4Element::AddIsotope()", "mat013", FatalException, ed);
158  return;
159  }
160  G4int iz = isotope->GetZ();
161 
162  // filling ...
163  if ( fNumberOfIsotopes < theIsotopeVector->size() ) {
164  // check same Z
165  if (fNumberOfIsotopes==0) { fZeff = G4double(iz); }
166  else if (G4double(iz) != fZeff) {
168  ed << "Fail to add Isotope Z= " << iz << " to G4Element " << fName
169  << " with different Z= " << fZeff << fNeff;
170  G4Exception ("G4Element::AddIsotope()", "mat014", FatalException, ed);
171  return;
172  }
173  //Z ok
174  fRelativeAbundanceVector[fNumberOfIsotopes] = abundance;
175  (*theIsotopeVector)[fNumberOfIsotopes] = isotope;
176  ++fNumberOfIsotopes;
177 
178  } else {
180  ed << "Fail to add Isotope Z= " << iz << " to G4Element " << fName
181  << " - more isotopes than declaired ";
182  G4Exception ("G4Element::AddIsotope()", "mat015", FatalException, ed);
183  return;
184  }
185 
186  // filled.
187  if ( fNumberOfIsotopes == theIsotopeVector->size() ) {
188  // Compute Neff, Aeff
189  G4double wtSum=0.0;
190 
191  G4double aeff = 0.0;
192  G4double neff = 0.0;
193  for (size_t i=0;i<fNumberOfIsotopes;i++) {
194  aeff += fRelativeAbundanceVector[i]*(*theIsotopeVector)[i]->GetA();
195  neff += fRelativeAbundanceVector[i]*(*theIsotopeVector)[i]->GetN();
196  wtSum += fRelativeAbundanceVector[i];
197  }
198  aeff /= wtSum;
199  neff /= wtSum;
200  if(0.0 == fAeff) {
201  fAeff = aeff;
202  fNeff = neff;
203  }
204 
205  if(wtSum != 1.0) {
206  for(size_t i=0; i<fNumberOfIsotopes; ++i) {
207  fRelativeAbundanceVector[i] /= wtSum;
208  }
209  }
210 
211  fNbOfAtomicShells = G4AtomicShells::GetNumberOfShells(iz);
212  fAtomicShells = new G4double[fNbOfAtomicShells];
213  fNbOfShellElectrons = new G4int[fNbOfAtomicShells];
214 
215  for ( G4int j = 0; j < fNbOfAtomicShells; j++ )
216  {
217  fAtomicShells[j] = G4AtomicShells::GetBindingEnergy(iz, j);
218  fNbOfShellElectrons[j] = G4AtomicShells::GetNumberOfElectrons(iz, j);
219  }
220  ComputeDerivedQuantities();
221 
222  }
223 }
std::ostringstream G4ExceptionDescription
Definition: globals.hh:76
int G4int
Definition: G4Types.hh:78
static G4double GetBindingEnergy(G4int Z, G4int SubshellNb)
G4double iz
Definition: TRTMaterials.hh:39
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
G4int GetZ() const
Definition: G4Isotope.hh:91
static G4int GetNumberOfElectrons(G4int Z, G4int SubshellNb)
double G4double
Definition: G4Types.hh:76
static G4int GetNumberOfShells(G4int Z)
G4double G4Element::GetA ( ) const
inline
G4double G4Element::GetAtomicMassAmu ( ) const
inline

Definition at line 135 of file G4Element.hh.

135 {return fNeff;}
G4double G4Element::GetAtomicShell ( G4int  index) const

Definition at line 365 of file G4Element.cc.

References FatalException, and G4Exception().

Referenced by G4AdjointPhotoElectricModel::AdjointCrossSectionPerAtom(), export_G4Element(), G4LivermorePolarizedPhotoElectricModel::SampleSecondaries(), G4KleinNishinaModel::SampleSecondaries(), and G4PEEffectFluoModel::SampleSecondaries().

366 {
367  if (i<0 || i>=fNbOfAtomicShells) {
369  ed << "Invalid argument " << i << " in for G4Element " << fName
370  << " with Z= " << fZeff
371  << " and Nshells= " << fNbOfAtomicShells;
372  G4Exception("G4Element::GetAtomicShell()", "mat016", FatalException, ed);
373  return 0.0;
374  }
375  return fAtomicShells[i];
376 }
std::ostringstream G4ExceptionDescription
Definition: globals.hh:76
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
G4Element * G4Element::GetElement ( G4String  name,
G4bool  warning = true 
)
static

Definition at line 409 of file G4Element.cc.

References G4cout, G4endl, and GetName().

Referenced by exrdmMaterial::AddMaterial(), RE06DetectorConstruction::AddMaterial(), export_G4Element(), and G4GDMLReadMaterials::GetElement().

410 {
411  // search the element by its name
412  for (size_t J=0 ; J<theElementTable.size() ; J++)
413  {
414  if (theElementTable[J]->GetName() == elementName)
415  return theElementTable[J];
416  }
417 
418  // the element does not exist in the table
419  if (warning) {
420  G4cout << "\n---> warning from G4Element::GetElement(). The element: "
421  << elementName << " does not exist in the table. Return NULL pointer."
422  << G4endl;
423  }
424  return 0;
425 }
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
const G4String & GetName() const
Definition: G4Element.hh:127
G4ElementTable * G4Element::GetElementTable ( )
static

Definition at line 395 of file G4Element.cc.

Referenced by G4AdjointCSManager::BuildCrossSectionMatrices(), G4KokoulinMuonNuclearXS::BuildCrossSectionTable(), G4VRangeToEnergyConverter::BuildLossTable(), G4NeutronHPJENDLHEData::BuildPhysicsTable(), G4NeutronHPFissionData::BuildPhysicsTable(), G4NeutronElasticXS::BuildPhysicsTable(), G4NeutronHPCaptureData::BuildPhysicsTable(), G4NeutronHPInelasticData::BuildPhysicsTable(), G4NeutronHPElasticData::BuildPhysicsTable(), G4NeutronHPThermalScatteringData::BuildPhysicsTable(), G4NeutronCaptureXS::BuildPhysicsTable(), G4NeutronInelasticXS::BuildPhysicsTable(), ExP02DetectorConstruction::Construct(), G4LENDModel::create_used_target_map(), G4LENDCrossSection::create_used_target_map(), G4NeutronHPFissionData::DumpPhysicsTable(), G4NeutronHPCaptureData::DumpPhysicsTable(), G4NeutronHPInelasticData::DumpPhysicsTable(), G4NeutronHPElasticData::DumpPhysicsTable(), ExP02GeoTree::ExP02GeoTree(), export_G4Element(), CCalMaterialFactory::findElement(), G4NistElementBuilder::FindOrBuildElement(), G4FissLib::G4FissLib(), G4NeutronHPCapture::G4NeutronHPCapture(), G4NeutronHPData::G4NeutronHPData(), G4NeutronHPElastic::G4NeutronHPElastic(), G4NeutronHPFission::G4NeutronHPFission(), G4NeutronHPInelastic::G4NeutronHPInelastic(), G4NistManager::GetElement(), G4NuclNuclDiffuseElastic::Initialise(), G4SeltzerBergerModel::Initialise(), G4LivermoreBremsstrahlungModel::Initialise(), G4DiffuseElastic::Initialise(), G03DetectorConstruction::ListOfMaterials(), G02DetectorConstruction::ListOfMaterials(), G4NistManager::PrintG4Element(), CCalMaterialFactory::readElements(), G4GDMLRead::StripNames(), and G4NistManager::~G4NistManager().

396 {
397  return &theElementTable;
398 }
G4double G4Element::GetfCoulomb ( ) const
inline
G4double G4Element::GetfRadTsai ( ) const
inline

Definition at line 194 of file G4Element.hh.

Referenced by export_G4Element().

194 {return fRadTsai;}
size_t G4Element::GetIndex ( ) const
inline
G4IonisParamElm* G4Element::GetIonisation ( ) const
inline
const G4Isotope* G4Element::GetIsotope ( G4int  iso) const
inline
G4IsotopeVector* G4Element::GetIsotopeVector ( ) const
inline
G4double G4Element::GetN ( ) const
inline

Definition at line 134 of file G4Element.hh.

Referenced by G4MuonMinusCaptureAtRest::AtRestDoIt(), G4Nucleus::ChooseParameters(), G4EmCalculator::ComputeCrossSectionPerAtom(), G4VEmModel::ComputeCrossSectionPerAtom(), export_G4Element(), G4NeutronHPFissionData::GetCrossSection(), G4NeutronHPCaptureData::GetCrossSection(), G4NeutronHPInelasticData::GetCrossSection(), G4NeutronHPElasticData::GetCrossSection(), G4VComponentCrossSection::GetElasticElementCrossSection(), G4ChargeExchangeProcess::GetElementCrossSection(), G4GlauberGribovCrossSection::GetHadronNucleonXsc(), G4GGNuclNuclCrossSection::GetHadronNucleonXsc(), G4ComponentGGHadronNucleusXsc::GetHadronNucleonXsc(), G4ComponentGGNuclNuclXsc::GetHadronNucleonXsc(), G4GlauberGribovCrossSection::GetHadronNucleonXscNS(), G4ComponentGGHadronNucleusXsc::GetHadronNucleonXscNS(), G4GlauberGribovCrossSection::GetHadronNucleonXscPDG(), G4ComponentGGHadronNucleusXsc::GetHadronNucleonXscPDG(), G4GlauberGribovCrossSection::GetHNinelasticXsc(), G4ComponentGGHadronNucleusXsc::GetHNinelasticXsc(), G4VComponentCrossSection::GetInelasticElementCrossSection(), G4GlauberGribovCrossSection::GetNucleusRadius(), G4GGNuclNuclCrossSection::GetNucleusRadius(), G4ComponentGGHadronNucleusXsc::GetNucleusRadius(), G4ComponentGGNuclNuclXsc::GetNucleusRadius(), G4NeutronHPThermalBoost::GetThermalEnergy(), G4VComponentCrossSection::GetTotalElementCrossSection(), G4HadronNucleonXsc::IsApplicable(), G4VEmModel::SelectIsotopeNumber(), and G4ScreenedCoulombCrossSection::SelectRandomUnweightedTarget().

134 {return fNeff;}
const G4String& G4Element::GetName ( void  ) const
inline
G4bool G4Element::GetNaturalAbundanceFlag ( ) const
inline

Definition at line 263 of file G4Element.hh.

Referenced by G4CrossSectionDataStore::GetCrossSection().

264 {
265  return fNaturalAbundance;
266 }
G4int G4Element::GetNbOfAtomicShells ( ) const
inline
G4int G4Element::GetNbOfShellElectrons ( G4int  index) const

Definition at line 380 of file G4Element.cc.

References FatalException, and G4Exception().

Referenced by G4KleinNishinaModel::SampleSecondaries().

381 {
382  if (i<0 || i>=fNbOfAtomicShells) {
384  ed << "Invalid argument " << i << " for G4Element " << fName
385  << " with Z= " << fZeff
386  << " and Nshells= " << fNbOfAtomicShells;
387  G4Exception("G4Element::GetNbOfShellElectrons()", "mat016", FatalException, ed);
388  return 0;
389  }
390  return fNbOfShellElectrons[i];
391 }
std::ostringstream G4ExceptionDescription
Definition: globals.hh:76
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
size_t G4Element::GetNumberOfElements ( )
static
size_t G4Element::GetNumberOfIsotopes ( ) const
inline
G4double* G4Element::GetRelativeAbundanceVector ( ) const
inline
const G4String& G4Element::GetSymbol ( ) const
inline

Definition at line 128 of file G4Element.hh.

Referenced by G4tgbGeometryDumper::DumpElement(), and export_G4Element().

128 {return fSymbol;}
G4double G4Element::GetZ ( ) const
inline

Definition at line 131 of file G4Element.hh.

Referenced by G4RDVCrossSectionHandler::ActiveElements(), G4VCrossSectionHandler::ActiveElements(), G4AdjointPhotoElectricModel::AdjointCrossSectionPerAtom(), G4NeutronHPThermalScattering::ApplyYourself(), G4MuonMinusCaptureAtRest::AtRestDoIt(), G4AugerData::BuildAugerTransitionTable(), G4RDAugerData::BuildAugerTransitionTable(), G4AdjointCSManager::BuildCrossSectionMatrices(), G4ScreenedCoulombCrossSection::BuildMFPTables(), G4NeutronHPJENDLHEData::BuildPhysicsTable(), G4Nucleus::ChooseParameters(), G4AdjointCSManager::ComputeAdjointCS(), G4VCrossSectionDataSet::ComputeCrossSection(), G4EmCalculator::ComputeCrossSectionPerAtom(), G4VEmModel::ComputeCrossSectionPerAtom(), G4ICRU49NuclearStoppingModel::ComputeDEDXPerVolume(), G4PAIySection::ComputeLowEnergyCof(), G4PAIxSection::ComputeLowEnergyCof(), MuCrossSections::CR_PerAtom(), G4LENDModel::create_used_target_map(), G4LENDCrossSection::create_used_target_map(), G4tgbGeometryDumper::DumpElement(), G4GDMLWriteMaterials::ElementWrite(), export_G4Element(), G4NeutronHPJENDLHEData::GetCrossSection(), G4CrossSectionDataStore::GetCrossSection(), G4NeutronHPFissionData::GetCrossSection(), G4NeutronHPCaptureData::GetCrossSection(), G4NeutronHPInelasticData::GetCrossSection(), G4NeutronHPElasticData::GetCrossSection(), G4GammaConversionToMuons::GetCrossSectionPerAtom(), GVFlashShowerParameterisation::GetEffZ(), G4VComponentCrossSection::GetElasticElementCrossSection(), G4ChargeExchangeProcess::GetElementCrossSection(), G4GlauberGribovCrossSection::GetHadronNucleonXsc(), G4GGNuclNuclCrossSection::GetHadronNucleonXsc(), G4ComponentGGHadronNucleusXsc::GetHadronNucleonXsc(), G4ComponentGGNuclNuclXsc::GetHadronNucleonXsc(), G4GlauberGribovCrossSection::GetHadronNucleonXscNS(), G4ComponentGGHadronNucleusXsc::GetHadronNucleonXscNS(), G4GlauberGribovCrossSection::GetHadronNucleonXscPDG(), G4ComponentGGHadronNucleusXsc::GetHadronNucleonXscPDG(), G4GlauberGribovCrossSection::GetHNinelasticXsc(), G4ComponentGGHadronNucleusXsc::GetHNinelasticXsc(), G4VComponentCrossSection::GetInelasticElementCrossSection(), G4NeutronHPThermalBoost::GetThermalEnergy(), G4VComponentCrossSection::GetTotalElementCrossSection(), G4NeutronHPElementData::Init(), G4HadronNucleonXsc::IsApplicable(), G4NativeScreenedCoulombCrossSection::LoadData(), G4EmCorrections::NuclearDEDX(), G4LindhardRobinsonPartition::PartitionNIEL(), G4GammaConversionToMuons::PostStepDoIt(), G4NeutronHPChannel::Register(), G4LivermorePolarizedPhotoElectricModel::SampleSecondaries(), G4XrayRayleighModel::SampleSecondaries(), G4LivermorePolarizedRayleighModel::SampleSecondaries(), G4LivermoreRayleighModel::SampleSecondaries(), G4LivermorePolarizedComptonModel::SampleSecondaries(), G4LivermoreComptonModifiedModel::SampleSecondaries(), G4LivermorePhotoElectricModel::SampleSecondaries(), G4LivermoreComptonModel::SampleSecondaries(), G4PenelopePhotoElectricModel::SampleSecondaries(), G4KleinNishinaModel::SampleSecondaries(), G4PEEffectFluoModel::SampleSecondaries(), G4hCoulombScatteringModel::SampleSecondaries(), G4PAIPhotModel::SampleSecondaries(), G4PAIModel::SampleSecondaries(), G4LowEPComptonModel::SampleSecondaries(), G4MuPairProductionModel::SampleSecondaries(), G4eCoulombScatteringModel::SampleSecondaries(), G4MuBremsstrahlungModel::SampleSecondaries(), G4CrossSectionDataStore::SampleZandA(), HistoManager::ScoreNewTrack(), G4NeutronCaptureXS::SelectIsotope(), G4NeutronInelasticXS::SelectIsotope(), G4ScreenedCoulombCrossSection::SelectRandomUnweightedTarget(), and G4ElementSelector::SelectZandA().

131 {return fZeff;}
G4int G4Element::operator!= ( const G4Element right) const

Definition at line 492 of file G4Element.cc.

493 {
494  return (this != (G4Element*) &right);
495 }
G4int G4Element::operator== ( const G4Element right) const

Definition at line 485 of file G4Element.cc.

486 {
487  return (this == (G4Element*) &right);
488 }
void G4Element::SetName ( const G4String name)
inline

Definition at line 216 of file G4Element.hh.

Referenced by export_G4Element(), and G4GDMLRead::StripNames().

216 {fName=name;}
const XML_Char * name
void G4Element::SetNaturalAbundanceFlag ( G4bool  val)
inline

Definition at line 268 of file G4Element.hh.

269 {
270  fNaturalAbundance = val;
271 }

Friends And Related Function Documentation

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

Definition at line 499 of file G4Element.cc.

500 {
501  std::ios::fmtflags mode = flux.flags();
502  flux.setf(std::ios::fixed,std::ios::floatfield);
503  G4long prec = flux.precision(3);
504 
505  flux
506  << " Element: " << element->fName << " (" << element->fSymbol << ")"
507  << " Z = " << std::setw(4) << std::setprecision(1) << element->fZeff
508  << " N = " << std::setw(5) << std::setprecision(1) << element->fNeff
509  << " A = " << std::setw(6) << std::setprecision(2)
510  << (element->fAeff)/(g/mole) << " g/mole";
511 
512  for (size_t i=0; i<element->fNumberOfIsotopes; i++)
513  flux
514  << "\n ---> " << (*(element->theIsotopeVector))[i]
515  << " abundance: " << std::setw(6) << std::setprecision(2)
516  << (element->fRelativeAbundanceVector[i])/perCent << " %";
517 
518  flux.precision(prec);
519  flux.setf(mode,std::ios::floatfield);
520  return flux;
521 }
long G4long
Definition: G4Types.hh:80
function g(Y1, Y2, PT2)
Definition: hijing1.383.f:5205
float perCent
Definition: hepunit.py:239
std::ostream& operator<< ( std::ostream &  flux,
G4Element element 
)
friend

Definition at line 525 of file G4Element.cc.

526 {
527  flux << &element;
528  return flux;
529 }
std::ostream& operator<< ( std::ostream &  flux,
G4ElementTable  ElementTable 
)
friend

Definition at line 533 of file G4Element.cc.

534 {
535  //Dump info for all known elements
536  flux << "\n***** Table : Nb of elements = " << ElementTable.size()
537  << " *****\n" << G4endl;
538 
539  for (size_t i=0; i<ElementTable.size(); i++) flux << ElementTable[i]
540  << G4endl << G4endl;
541 
542  return flux;
543 }
#define G4endl
Definition: G4ios.hh:61

The documentation for this class was generated from the following files: