Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4PWATotalXsecTable Class Reference

#include <G4PWATotalXsecTable.hh>

Public Member Functions

 G4PWATotalXsecTable ()
 
 ~G4PWATotalXsecTable ()
 
void Initialise ()
 
const G4PWATotalXsecZGetPWATotalXsecForZet (G4int Z) const
 

Detailed Description

Definition at line 132 of file G4PWATotalXsecTable.hh.

Constructor & Destructor Documentation

G4PWATotalXsecTable::G4PWATotalXsecTable ( )
inline

Definition at line 135 of file G4PWATotalXsecTable.hh.

135 {};
G4PWATotalXsecTable::~G4PWATotalXsecTable ( )

Definition at line 200 of file G4PWATotalXsecTable.cc.

200  {
201  for(G4int i = 0; i < fgNumZet; ++i)
202  if(fgPWATotalXsecTable[i]) {
203  delete fgPWATotalXsecTable[i];
204  fgPWATotalXsecTable[i] = 0;
205  }
206 }
int G4int
Definition: G4Types.hh:78

Member Function Documentation

const G4PWATotalXsecZ* G4PWATotalXsecTable::GetPWATotalXsecForZet ( G4int  Z) const
inline

Definition at line 140 of file G4PWATotalXsecTable.hh.

140  {
141  Z = Z>fgNumZet ? fgNumZet : Z;
142  return fgPWATotalXsecTable[Z-1];
143  }

Here is the caller graph for this function:

void G4PWATotalXsecTable::Initialise ( )

Definition at line 209 of file G4PWATotalXsecTable.cc.

209  {
210  G4int isUsedZ[fgNumZet] ={0}; //xsec data available up to fgNumZet Z-number
211  // check used elements
212  G4MaterialTable *theMaterialTable = G4Material::GetMaterialTable();
213  for(unsigned int imat = 0; imat < theMaterialTable->size(); ++imat) {
214  const G4ElementVector *theElemVect = ((*theMaterialTable)[imat])->GetElementVector();
215  for(unsigned int ielem = 0; ielem < theElemVect->size(); ++ielem) {
216  G4int zet = G4lrint((*theElemVect)[ielem]->GetZ());
217  zet = zet>fgNumZet ? fgNumZet : zet;
218  if(!isUsedZ[zet-1])
219  isUsedZ[zet-1] = 1;
220  }
221  }
222 
223  for(G4int i = 0; i < fgNumZet; ++i)
224  if(isUsedZ[i] && !fgPWATotalXsecTable[i]) // used but not there yet -> load it
225  fgPWATotalXsecTable[i] = new G4PWATotalXsecZ(i+1);
226  else if(!isUsedZ[i] && fgPWATotalXsecTable[i]) { // there but not used now -> delete
227  delete fgPWATotalXsecTable[i];
228  fgPWATotalXsecTable[i] = 0;
229  }
230 }
std::vector< G4Element * > G4ElementVector
static G4MaterialTable * GetMaterialTable()
Definition: G4Material.cc:587
std::vector< G4Material * > G4MaterialTable
int G4int
Definition: G4Types.hh:78
int G4lrint(double ad)
Definition: templates.hh:163

Here is the call graph for this function:

Here is the caller graph for this function:


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