G4Element.hh

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 //
00027 // $Id: G4Element.hh 67044 2013-01-30 08:50:06Z gcosmo $
00028 //
00029 
00030 //---------------------------------------------------------------------------
00031 //
00032 // ClassName:   G4Element
00033 //
00034 // Description: Contains element properties
00035 //
00036 // Class description:
00037 //
00038 // An element is a chemical element either directly defined in terms of
00039 // its characteristics: its name, symbol,
00040 //                      Z (effective atomic number)
00041 //                      N (effective number of nucleons)
00042 //                      A (effective mass of a mole)
00043 // or in terms of a collection of constituent isotopes with specified 
00044 // relative abundance (i.e. fraction of nb of atoms per volume).
00045 //
00046 // Quantities, with physical meaning or not, which are constant in a given 
00047 // element are computed and stored here as Derived data members.
00048 //
00049 // The class contains as a private static member the table of defined
00050 // elements (an ordered vector of elements).
00051 //
00052 // Elements can be assembled singly or in mixtures into materials used
00053 // in volume definitions via the G4Material class.
00054 //
00055 // It is strongly recommended do not delete G4Element instance in the
00056 // user code. All G4Elements will be automatically deleted at the end 
00057 // of Geant4 session
00058 
00059 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
00060 
00061 // 09-07-96, new data members added by L.Urban
00062 // 17-01-97, aesthetic rearrangement, M.Maire
00063 // 20-01-97, Tsai formula for the rad length, M.Maire
00064 // 21-01-97, remove mixture flag, M.Maire
00065 // 24-01-97, new data member: fTaul
00066 //           new method: ComputeIonisationPara, M.Maire
00067 // 20-03-97, corrected initialization of pointers, M.Maire
00068 // 27-06-97, new function GetIsotope(int), M.Maire
00069 // 24-02-98, fWeightVector becomes fRelativeAbundanceVector
00070 // 27-04-98, atomic shell stuff, V. Grichine
00071 // 09-07-98, Ionisation parameters removed from the class, M.Maire
00072 // 04-08-98, new method GetElement(elementName), M.Maire
00073 // 16-11-98, Subshell -> Shell, mma
00074 // 30-03-01, suppression of the warning message in GetElement
00075 // 17-07-01, migration to STL, M. Verderi
00076 // 13-09-01, stl migration. Suppression of the data member fIndexInTable
00077 // 14-09-01, fCountUse: nb of materials which use this element
00078 // 26-02-02, fIndexInTable renewed 
00079 // 01-04-05, new data member fIndexZ to count the number of elements with same Z
00080 // 17-10-06: Add Get/Set fNaturalAbandances (V.Ivanchenko)
00081 // 17.09.09, add fNbOfShellElectrons and methods (V. Grichine)
00082 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
00083 
00084 #ifndef G4ELEMENT_HH
00085 #define G4ELEMENT_HH 1
00086 
00087 #include "globals.hh"
00088 #include <vector>
00089 #include "G4ios.hh"
00090 #include "G4Isotope.hh"
00091 #include "G4IonisParamElm.hh"
00092 #include "G4IsotopeVector.hh"
00093 #include "G4ElementTable.hh"
00094 
00095 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
00096 
00097 class G4Element
00098 {
00099 public:  // with description
00100 
00101   //
00102   // Constructor to Build an element directly; no reference to isotopes
00103   //
00104   G4Element(const G4String& name,               //its name
00105             const G4String& symbol,             //its symbol
00106                   G4double  Zeff,               //atomic number
00107                   G4double  Aeff);              //mass of mole
00108                   
00109   //
00110   // Constructor to Build an element from isotopes via AddIsotope
00111   //
00112   G4Element(const G4String& name,               //its name
00113             const G4String& symbol,             //its symbol
00114             G4int nbIsotopes);                  //nb of isotopes
00115 
00116   //
00117   // Add an isotope to the element
00118   // 
00119   void AddIsotope(G4Isotope* isotope,                   //isotope 
00120                   G4double   RelativeAbundance);        //fraction of nb of 
00121                                                         //atomes per volume
00122   virtual ~G4Element();
00123   
00124   //
00125   // Retrieval methods
00126   //
00127   inline const G4String& GetName()   const {return fName;}
00128   inline const G4String& GetSymbol() const {return fSymbol;}
00129 
00130   // Atomic number
00131   inline G4double GetZ()             const {return fZeff;}    
00132 
00133   // Atomic weight in atomic units
00134   inline G4double GetN()             const {return fNeff;}     
00135   inline G4double GetAtomicMassAmu() const {return fNeff;}     
00136 
00137   // Mass of a mole in Geant4 units for atoms with atomic shell
00138   inline G4double GetA()             const {return fAeff;}    
00139 
00140   inline G4bool   GetNaturalAbandancesFlag();
00141 
00142   inline void     SetNaturalAbandancesFlag(G4bool);
00143   
00144   //the number of atomic shells in this element:
00145   //
00146   inline G4int GetNbOfAtomicShells() const {return fNbOfAtomicShells;}
00147   
00148   //the binding energy of the shell, ground shell index=0
00149   //
00150   G4double GetAtomicShell(G4int index) const;
00151 
00152   //the number of electrons at the shell, ground shell index=0
00153   //
00154   G4int GetNbOfShellElectrons(G4int index) const;
00155     
00156   //number of isotopes constituing this element:
00157   //
00158   inline size_t GetNumberOfIsotopes() const {return fNumberOfIsotopes;}
00159    
00160   //vector of pointers to isotopes constituing this element:
00161   //
00162   inline G4IsotopeVector* GetIsotopeVector() const {return theIsotopeVector;}
00163     
00164   //vector of relative abundance of each isotope:
00165   //
00166   inline G4double* GetRelativeAbundanceVector() const 
00167                    {return fRelativeAbundanceVector;}
00168     
00169   inline const G4Isotope* GetIsotope(G4int iso) const 
00170                    {return (*theIsotopeVector)[iso];}
00171 
00172   //the (static) Table of Elements:
00173   //
00174   static 
00175   const  G4ElementTable* GetElementTable();
00176   
00177   static 
00178   size_t GetNumberOfElements();
00179   
00180   //the index of this element in the Table:
00181   //
00182   inline size_t GetIndex() const {return fIndexInTable;}
00183     
00184   //return pointer to an element, given its name:
00185   //
00186   static
00187   G4Element* GetElement(G4String name, G4bool warning=true);
00188   
00189   //count number of materials which use this element
00190   //
00191   inline G4int GetCountUse() const {return fCountUse;}
00192   inline void  increaseCountUse()  {fCountUse++;}
00193   inline void  decreaseCountUse()  {fCountUse--;}
00194   
00195   //count elements with same Z
00196   //
00197   inline G4int GetIndexZ() const {return fIndexZ;}
00198         
00199   //Coulomb correction factor:
00200   //
00201   inline G4double GetfCoulomb() const {return fCoulomb;}
00202    
00203   //Tsai formula for the radiation length:
00204   //
00205   inline G4double GetfRadTsai() const {return fRadTsai;}
00206     
00207   //pointer to ionisation parameters:
00208   //
00209   inline G4IonisParamElm* GetIonisation() const {return fIonisation;}
00210     
00211   // printing methods
00212   //    
00213   friend std::ostream& operator<<(std::ostream&, G4Element*);    
00214   friend std::ostream& operator<<(std::ostream&, G4Element&);    
00215   friend std::ostream& operator<<(std::ostream&, G4ElementTable);
00216 
00217 public:  // without description
00218 
00219   G4int operator==(const G4Element&) const;
00220   G4int operator!=(const G4Element&) const;
00221 
00222   G4Element(__void__&);
00223     // Fake default constructor for usage restricted to direct object
00224     // persistency for clients requiring preallocation of memory for
00225     // persistifiable objects.
00226 
00227   inline void SetName(const G4String& name)  {fName=name;}
00228 
00229 private:
00230 
00231   G4Element(G4Element&);
00232   const G4Element & operator=(const G4Element&);
00233 
00234   void InitializePointers();
00235   void ComputeDerivedQuantities();
00236   void ComputeCoulombFactor();
00237   void ComputeLradTsaiFactor();
00238   void AddNaturalIsotopes();
00239 
00240 private:
00241 
00242   //
00243   // Basic data members (which define an Element)
00244   //
00245   G4String fName;              // name
00246   G4String fSymbol;            // symbol
00247   G4double fZeff;              // Effective atomic number
00248   G4double fNeff;              // Effective number of nucleons
00249   G4double fAeff;              // Effective mass of a mole
00250     
00251   G4int fNbOfAtomicShells;     // number  of atomic shells
00252   G4double* fAtomicShells ;    // Pointer to atomic shell binding energies
00253   G4int* fNbOfShellElectrons; // pointer to the number of subshell electrons
00254     
00255   // Isotope vector contains constituent isotopes of the element   
00256   size_t fNumberOfIsotopes;    // Number of isotopes added to the element
00257   G4IsotopeVector* theIsotopeVector;
00258   G4double* fRelativeAbundanceVector;     // Fraction nb of atomes per volume
00259                                           // for each constituent
00260   G4int fCountUse;          // nb of materials which use this element
00261   G4int fIndexZ;            // index for elements with same Z
00262     
00263   // Set up the static Table of Elements
00264   static G4ElementTable theElementTable;
00265   size_t fIndexInTable;
00266   G4bool fNaturalAbandances;
00267 
00268   //
00269   // Derived data members (computed from the basic data members)
00270   //
00271   G4double fCoulomb;             // Coulomb correction factor
00272   G4double fRadTsai;             // Tsai formula for the radiation length
00273   G4IonisParamElm* fIonisation;  // Pointer to ionisation parameters
00274 };
00275 
00276 inline G4bool G4Element::GetNaturalAbandancesFlag()
00277 {
00278   return fNaturalAbandances;
00279 }
00280 
00281 inline void G4Element::SetNaturalAbandancesFlag(G4bool val)
00282 {
00283   fNaturalAbandances = val;
00284 }
00285 
00286 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
00287 
00288 #endif

Generated on Mon May 27 17:48:07 2013 for Geant4 by  doxygen 1.4.7