G4Isotope Class Reference

#include <G4Isotope.hh>


Public Member Functions

 G4Isotope (const G4String &name, G4int z, G4int n, G4double a=0., G4int m=0)
virtual ~G4Isotope ()
const G4StringGetName () const
G4int GetZ () const
G4int GetN () const
G4double GetA () const
G4int Getm () const
G4int GetCountUse () const
size_t GetIndex () const
G4int operator== (const G4Isotope &) const
G4int operator!= (const G4Isotope &) const
 G4Isotope (__void__ &)
void SetName (const G4String &name)
void increaseCountUse ()
void decreaseCountUse ()

Static Public Member Functions

static G4IsotopeGetIsotope (const G4String &name, G4bool warning=false)
static const G4IsotopeTableGetIsotopeTable ()
static size_t GetNumberOfIsotopes ()

Friends

std::ostream & operator<< (std::ostream &, G4Isotope *)
std::ostream & operator<< (std::ostream &, G4Isotope &)
std::ostream & operator<< (std::ostream &, G4IsotopeTable)


Detailed Description

Definition at line 72 of file G4Isotope.hh.


Constructor & Destructor Documentation

G4Isotope::G4Isotope ( const G4String name,
G4int  z,
G4int  n,
G4double  a = 0.,
G4int  m = 0 
)

Definition at line 59 of file G4Isotope.cc.

References FatalException, G4endl, G4Exception(), G4NistManager::GetAtomicMass(), and G4NistManager::Instance().

00060 : fName(Name), fZ(Z), fN(N), fA(A), fm(il), fCountUse(0)
00061 {
00062   if (Z<1) { 
00063     G4ExceptionDescription ed;
00064     ed << "Wrong Isotope " << Name << " Z= " << Z << G4endl;
00065     G4Exception ("G4Isotope::G4Isotope()", "mat001", FatalException, ed);
00066   }
00067   if (N<Z) {
00068     G4ExceptionDescription ed;
00069     ed << "Wrong Isotope " << Name << " Z= " << Z << " > N= " << N << G4endl;
00070     G4Exception ("G4Isotope::G4Isotope()", "mat002", FatalException, ed);
00071   }
00072   if (A<=0.0) {
00073     fA = (G4NistManager::Instance()->GetAtomicMass(Z,N))*g/(mole*amu_c2);  
00074   }
00075   theIsotopeTable.push_back(this);
00076   fIndexInTable = theIsotopeTable.size() - 1;
00077 }

G4Isotope::~G4Isotope (  )  [virtual]

Definition at line 91 of file G4Isotope.cc.

00092 {
00093   theIsotopeTable[fIndexInTable] = 0;
00094 }  

G4Isotope::G4Isotope ( __void__ &   ) 

Definition at line 84 of file G4Isotope.cc.

00085   : fZ(0), fN(0), fA(0), fm(0), fCountUse(0), fIndexInTable(0)
00086 {
00087 }


Member Function Documentation

void G4Isotope::decreaseCountUse (  )  [inline]

Definition at line 136 of file G4Isotope.hh.

00136 {fCountUse--;}

G4double G4Isotope::GetA (  )  const [inline]

Definition at line 97 of file G4Isotope.hh.

Referenced by G4tgbGeometryDumper::DumpIsotope(), and G4GDMLWriteMaterials::IsotopeWrite().

00097 {return fA;}

G4int G4Isotope::GetCountUse (  )  const [inline]

Definition at line 102 of file G4Isotope.hh.

00102 {return fCountUse;}

size_t G4Isotope::GetIndex (  )  const [inline]

Definition at line 113 of file G4Isotope.hh.

00113 {return fIndexInTable;}

G4Isotope * G4Isotope::GetIsotope ( const G4String name,
G4bool  warning = false 
) [static]

Definition at line 196 of file G4Isotope.cc.

References G4cout, G4endl, and GetName().

Referenced by G4GDMLReadMaterials::GetIsotope().

00197 {  
00198   // search the isotope by its name 
00199   for (size_t J=0 ; J<theIsotopeTable.size() ; J++)
00200    {
00201      if (theIsotopeTable[J]->GetName() == isotopeName)
00202        { return theIsotopeTable[J]; }
00203    }
00204    
00205   // the isotope does not exist in the table
00206   if (warning) {
00207     G4cout << "\n---> warning from G4Isotope::GetIsotope(). The isotope: "
00208            << isotopeName << " does not exist in the table. Return NULL pointer."
00209            << G4endl;
00210   }     
00211   return 0;          
00212 }

const G4IsotopeTable * G4Isotope::GetIsotopeTable (  )  [static]

Definition at line 182 of file G4Isotope.cc.

Referenced by G4NistManager::~G4NistManager().

00183 {
00184   return &theIsotopeTable;
00185 }

G4int G4Isotope::Getm (  )  const [inline]

Definition at line 100 of file G4Isotope.hh.

Referenced by G4NeutronHPElementData::Init(), and G4NeutronHPChannel::Register().

00100 {return fm;}

G4int G4Isotope::GetN (  )  const [inline]

Definition at line 94 of file G4Isotope.hh.

Referenced by G4QCaptureAtRest::AtRestDoIt(), G4MuonMinusCaptureAtRest::AtRestDoIt(), G4Nucleus::ChooseParameters(), G4VCrossSectionDataSet::ComputeCrossSection(), G4tgbGeometryDumper::DumpIsotope(), G4NeutronHPJENDLHEData::GetCrossSection(), G4CrossSectionDataStore::GetCrossSection(), G4NeutronHPElementData::Init(), G4ElementIsoCrossSections< IsoIsoCrossSectionType >::Init(), G4GDMLWriteMaterials::IsotopeWrite(), G4QAtomicElectronScattering::PostStepDoIt(), G4NeutronHPChannel::Register(), G4VEmModel::SelectIsotopeNumber(), G4ElementSelector::SelectZandA(), and G4Nucleus::SetIsotope().

00094 {return fN;}

const G4String& G4Isotope::GetName (  )  const [inline]

Definition at line 88 of file G4Isotope.hh.

Referenced by G4GDMLWriteMaterials::ElementWrite(), G4tgbMaterialMgr::FindOrBuildG4Isotope(), GetIsotope(), and G4GDMLWriteMaterials::IsotopeWrite().

00088 {return fName;}

size_t G4Isotope::GetNumberOfIsotopes (  )  [static]

Definition at line 189 of file G4Isotope.cc.

00190 {
00191   return theIsotopeTable.size();
00192 }

G4int G4Isotope::GetZ (  )  const [inline]

Definition at line 91 of file G4Isotope.hh.

Referenced by G4Element::AddIsotope(), G4QCaptureAtRest::AtRestDoIt(), G4Nucleus::ChooseParameters(), G4tgbGeometryDumper::DumpIsotope(), G4GDMLWriteMaterials::IsotopeWrite(), G4QAtomicElectronScattering::PostStepDoIt(), and G4Nucleus::SetIsotope().

00091 {return fZ;}

void G4Isotope::increaseCountUse (  )  [inline]

Definition at line 135 of file G4Isotope.hh.

Referenced by G4Element::AddIsotope().

00135 {fCountUse++;}

G4int G4Isotope::operator!= ( const G4Isotope  )  const

Definition at line 132 of file G4Isotope.cc.

00133 {
00134   return (this != (G4Isotope *) &right);
00135 }

G4int G4Isotope::operator== ( const G4Isotope  )  const

Definition at line 125 of file G4Isotope.cc.

00126 {
00127   return (this == (G4Isotope *) &right);
00128 }

void G4Isotope::SetName ( const G4String name  )  [inline]

Definition at line 134 of file G4Isotope.hh.

00134 {fName=name;}


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  flux,
G4IsotopeTable  IsotopeTable 
) [friend]

Definition at line 167 of file G4Isotope.cc.

00168 {
00169  //Dump info for all known isotopes
00170    flux 
00171      << "\n***** Table : Nb of isotopes = " << IsotopeTable.size() 
00172      << " *****\n" << G4endl;
00173         
00174    for (size_t i=0; i<IsotopeTable.size(); i++)
00175      flux << IsotopeTable[i] << G4endl;
00176 
00177    return flux;
00178 }

std::ostream& operator<< ( std::ostream &  flux,
G4Isotope isotope 
) [friend]

Definition at line 159 of file G4Isotope.cc.

00160 {
00161   flux << &isotope;        
00162   return flux;
00163 }

std::ostream& operator<< ( std::ostream &  flux,
G4Isotope isotope 
) [friend]

Definition at line 139 of file G4Isotope.cc.

00140 {
00141   std::ios::fmtflags mode = flux.flags();
00142   flux.setf(std::ios::fixed,std::ios::floatfield);
00143   G4long prec = flux.precision(3);
00144     
00145   flux
00146     << " Isotope: " << std::setw(5) << isotope->fName 
00147     << "   Z = " << std::setw(2)    << isotope->fZ 
00148     << "   N = " << std::setw(3)    << isotope->fN
00149     << "   A = " << std::setw(6) << std::setprecision(2) 
00150     << (isotope->fA)/(g/mole) << " g/mole";
00151 
00152   flux.precision(prec);       
00153   flux.setf(mode,std::ios::floatfield);       
00154   return flux;
00155 }


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:52:18 2013 for Geant4 by  doxygen 1.4.7