G4ElementData Class Reference

#include <G4ElementData.hh>


Public Member Functions

 G4ElementData ()
 ~G4ElementData ()
void InitialiseForElement (G4int Z, G4PhysicsVector *v)
void InitialiseForComponent (G4int Z, G4int nComponents=0)
void AddComponent (G4int Z, G4int id, G4PhysicsVector *v)
void SetName (const G4String &nam)
G4PhysicsVectorGetElementData (G4int Z)
size_t GetNumberOfComponents (G4int Z)
G4int GetComponentID (G4int Z, size_t idx)
G4PhysicsVectorGetComponentDataByIndex (G4int Z, size_t idx)
G4PhysicsVectorGetComponentDataByID (G4int Z, G4int id)
G4double GetValueForElement (G4int Z, G4double kinEnergy)
G4double GetValueForComponent (G4int Z, size_t idx, G4double kinEnergy)


Detailed Description

Definition at line 55 of file G4ElementData.hh.


Constructor & Destructor Documentation

G4ElementData::G4ElementData (  ) 

Definition at line 48 of file G4ElementData.cc.

References maxNumElements.

00049 {
00050   name = "";
00051   for(G4int i=0; i<maxNumElements; ++i) {
00052     elmData[i] = 0;
00053     compLength[i] = 0;
00054   }
00055 }

G4ElementData::~G4ElementData (  ) 

Definition at line 59 of file G4ElementData.cc.

References maxNumElements.

00060 {
00061   for(G4int i=0; i<maxNumElements; ++i) {
00062     delete elmData[i];
00063     if(compLength[i] > 0) {
00064       for(size_t j=0; j<compLength[i]; ++j) {
00065         delete (compData[i])[j];
00066       }
00067     }
00068   }
00069 }


Member Function Documentation

void G4ElementData::AddComponent ( G4int  Z,
G4int  id,
G4PhysicsVector v 
)

Definition at line 103 of file G4ElementData.cc.

References FatalException, G4cout, G4endl, G4Exception(), and maxNumElements.

00104 {
00105   if(Z < 1 || Z >= maxNumElements) {
00106     G4cout << "G4ElementData::AddComponent ERROR for " << name 
00107            << "  Z = " << Z << " is out of range!" << G4endl;
00108     G4Exception("G4ElementData::AddComponent()", "mat603", 
00109                  FatalException, "Wrong data handling");           
00110     return;
00111   }
00112   (compData[Z]).push_back(v);
00113   (compID[Z]).push_back(id);
00114   ++compLength[Z];
00115 }

G4PhysicsVector * G4ElementData::GetComponentDataByID ( G4int  Z,
G4int  id 
) [inline]

Definition at line 141 of file G4ElementData.hh.

Referenced by G4NeutronCaptureXS::GetIsoCrossSection(), and G4NeutronCaptureXS::SelectIsotope().

00142 {
00143   G4PhysicsVector* v = 0;
00144   for(size_t i=0; i<compLength[Z]; ++i) {
00145     if(id == (compID[Z])[i]) {
00146       v = (compData[Z])[i];
00147       break;
00148     }
00149   }
00150   return v;
00151 }

G4PhysicsVector * G4ElementData::GetComponentDataByIndex ( G4int  Z,
size_t  idx 
) [inline]

Definition at line 135 of file G4ElementData.hh.

00136 {
00137   return (compData[Z])[idx];
00138 }

G4int G4ElementData::GetComponentID ( G4int  Z,
size_t  idx 
) [inline]

Definition at line 129 of file G4ElementData.hh.

Referenced by G4LivermorePhotoElectricModel::SampleSecondaries().

00130 {
00131   return (compID[Z])[idx];
00132 }

G4PhysicsVector * G4ElementData::GetElementData ( G4int  Z  )  [inline]

Definition at line 118 of file G4ElementData.hh.

Referenced by G4NeutronCaptureXS::BuildPhysicsTable(), G4NeutronCaptureXS::GetElementCrossSection(), and G4NeutronCaptureXS::GetIsoCrossSection().

00119 {
00120   return elmData[Z];
00121 }

size_t G4ElementData::GetNumberOfComponents ( G4int  Z  )  [inline]

Definition at line 124 of file G4ElementData.hh.

Referenced by G4NeutronCaptureXS::SelectIsotope().

00125 {
00126   return compLength[Z];
00127 }

G4double G4ElementData::GetValueForComponent ( G4int  Z,
size_t  idx,
G4double  kinEnergy 
) [inline]

Definition at line 160 of file G4ElementData.hh.

Referenced by G4LivermorePhotoElectricModel::SampleSecondaries().

00161 {
00162   return ((compData[Z])[idx])->Value(kinEnergy);
00163 }

G4double G4ElementData::GetValueForElement ( G4int  Z,
G4double  kinEnergy 
) [inline]

Definition at line 154 of file G4ElementData.hh.

References G4PhysicsVector::Value().

00155 {
00156   return elmData[Z]->Value(kinEnergy);
00157 }

void G4ElementData::InitialiseForComponent ( G4int  Z,
G4int  nComponents = 0 
)

Definition at line 84 of file G4ElementData.cc.

References FatalException, G4cout, G4endl, G4Exception(), and maxNumElements.

00085 {
00086   if(Z < 1 || Z >= maxNumElements) {
00087     G4cout << "G4ElementData::InitialiseForComponent ERROR for " << name 
00088            << "  Z = " << Z << " is out of range!" << G4endl;
00089     G4Exception("G4ElementData::InitialiseForComponent()", "mat602", 
00090                  FatalException, "Wrong data handling");           
00091     return;
00092   }
00093 
00094   // only one initialisation is allowed
00095   if(0 != compLength[Z]) { return; }
00096 
00097   // reserve a new structure
00098   (compData[Z]).reserve(nComponents);
00099   (compID[Z]).reserve(nComponents);
00100 }

void G4ElementData::InitialiseForElement ( G4int  Z,
G4PhysicsVector v 
)

Definition at line 71 of file G4ElementData.cc.

References FatalException, G4cout, G4endl, G4Exception(), and maxNumElements.

00072 {
00073   if(Z < 1 || Z >= maxNumElements) {
00074     G4cout << "G4ElementData::InitialiseForElement ERROR for " << name 
00075            << "  Z = " << Z << " is out of range!" << G4endl;
00076     G4Exception("G4ElementData::InitialiseForElement()", "mat601", 
00077                  FatalException, "Wrong data handling");
00078     return;
00079   } 
00080   if(elmData[Z]) { delete elmData[Z]; }
00081   elmData[Z] = v;
00082 }

void G4ElementData::SetName ( const G4String nam  )  [inline]

Definition at line 112 of file G4ElementData.hh.

Referenced by G4NeutronCaptureXS::G4NeutronCaptureXS().

00113 {
00114   name = nam;
00115 }


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