Geant4  10.02.p03
G4SandiaTable Class Reference

#include <G4SandiaTable.hh>

Collaboration diagram for G4SandiaTable:

Public Member Functions

 G4SandiaTable (G4Material *)
 
 ~G4SandiaTable ()
 
void GetSandiaCofPerAtom (G4int Z, G4double energy, std::vector< G4double > &coeff) const
 
void GetSandiaCofWater (G4double energy, std::vector< G4double > &coeff) const
 
G4double GetWaterEnergyLimit () const
 
G4double GetWaterCofForMaterial (G4int, G4int) const
 
G4int GetMatNbOfIntervals () const
 
G4double GetSandiaCofForMaterial (G4int, G4int) const
 
G4double GetSandiaMatTable (G4int, G4int) const
 
const G4doubleGetSandiaCofForMaterial (G4double energy) const
 
G4double GetSandiaCofForMaterialPAI (G4int, G4int) const
 
G4double GetSandiaMatTablePAI (G4int, G4int) const
 
const G4doubleGetSandiaCofForMaterialPAI (G4double energy) const
 
G4OrderedTableGetSandiaMatrixPAI ()
 
void SetVerbose (G4int ver)
 
 G4SandiaTable (__void__ &)
 
 G4SandiaTable (G4int)
 
 G4SandiaTable ()
 
void Initialize (G4Material *)
 
void Initialize (G4int)
 
void SandiaSwap (G4double **da, G4int i, G4int j)
 
void SandiaSort (G4double **da, G4int sz)
 
G4int SandiaIntervals (G4int Z[], G4int el)
 
G4int SandiaMixing (G4int Z[], const G4double *fractionW, G4int el, G4int mi)
 
G4double GetPhotoAbsorpCof (G4int i, G4int j) const
 
G4int GetMaxInterval () const
 
G4double ** GetPointerToCof ()
 
G4bool GetLowerI1 ()
 
void SetLowerI1 (G4bool flag)
 

Static Public Member Functions

static G4double GetZtoA (G4int Z)
 

Private Member Functions

void ComputeMatSandiaMatrix ()
 
void ComputeMatSandiaMatrixPAI ()
 
G4int GetNbOfIntervals (G4int Z)
 
G4double GetSandiaPerAtom (G4int Z, G4int, G4int)
 
G4double GetIonizationPot (G4int Z) const
 
void ComputeMatTable ()
 
 G4SandiaTable (G4SandiaTable &)
 
G4SandiaTableoperator= (const G4SandiaTable &right)
 

Private Attributes

std::vector< G4doublefSandiaCofPerAtom
 
G4MaterialfMaterial
 
G4int fMatNbOfIntervals
 
G4OrderedTablefMatSandiaMatrix
 
G4OrderedTablefMatSandiaMatrixPAI
 
G4double ** fPhotoAbsorptionCof
 
G4int fMaxInterval
 
G4int fVerbose
 
G4bool fLowerI1
 

Static Private Attributes

static const G4int fNumberOfElements = 100
 
static const G4int fIntervalLimit = 100
 
static const G4int fNumberOfIntervals = 980
 
static const G4int fH2OlowerInt = 23
 
static const G4double fSandiaTable [981][5]
 
static const G4double fH2OlowerI1 [23][5]
 
static const G4int fNbOfIntervals [101]
 
static const G4double fZtoAratio [101]
 
static const G4double fIonizationPotentials [101]
 
static const G4double funitc [5]
 
static const G4double fnulcof [4] = {0.0}
 
static G4int fCumulInterval [101] = {0}
 

Detailed Description

Definition at line 67 of file G4SandiaTable.hh.

Constructor & Destructor Documentation

◆ G4SandiaTable() [1/5]

G4SandiaTable::G4SandiaTable ( G4Material material)

Definition at line 70 of file G4SandiaTable.cc.

71  : fMaterial(material)
72 {
73  fMatSandiaMatrix = 0;
76 
78 
79  fMaxInterval = 0;
80  fVerbose = 0;
81 
82  //build the CumulInterval array
83  if(0 == fCumulInterval[0]) {
84  fCumulInterval[0] = 1;
85 
86  for (G4int Z=1; Z<101; ++Z) {
88  }
89  }
90 
91  fMaxInterval = 0;
92  fSandiaCofPerAtom.resize(4,0.0);
93  fLowerI1 = false;
94  //compute macroscopic Sandia coefs for a material
95  ComputeMatSandiaMatrix(); // mma
96 }
G4OrderedTable * fMatSandiaMatrixPAI
void ComputeMatSandiaMatrix()
G4double ** fPhotoAbsorptionCof
int G4int
Definition: G4Types.hh:78
static G4int fCumulInterval[101]
Float_t Z
G4int fMatNbOfIntervals
static const G4int fNbOfIntervals[101]
G4Material * fMaterial
std::vector< G4double > fSandiaCofPerAtom
G4OrderedTable * fMatSandiaMatrix
Here is the call graph for this function:

◆ ~G4SandiaTable()

G4SandiaTable::~G4SandiaTable ( )

Definition at line 116 of file G4SandiaTable.cc.

117 {
118  if(fMatSandiaMatrix)
119  {
121  delete fMatSandiaMatrix;
122  }
124  {
126  delete fMatSandiaMatrixPAI;
127  }
129  {
130  delete [] fPhotoAbsorptionCof;
131  }
132 }
G4OrderedTable * fMatSandiaMatrixPAI
G4double ** fPhotoAbsorptionCof
void clearAndDestroy()
G4OrderedTable * fMatSandiaMatrix
Here is the call graph for this function:

◆ G4SandiaTable() [2/5]

G4SandiaTable::G4SandiaTable ( __void__ &  )

Definition at line 103 of file G4SandiaTable.cc.

104  : fMaterial(0),fMatSandiaMatrix(0),
106 {
107  fMaxInterval = 0;
108  fMatNbOfIntervals = 0;
109  fLowerI1 = false;
110  fVerbose = 0;
111  fSandiaCofPerAtom.resize(4,0.0);
112 }
G4OrderedTable * fMatSandiaMatrixPAI
G4double ** fPhotoAbsorptionCof
G4int fMatNbOfIntervals
G4Material * fMaterial
std::vector< G4double > fSandiaCofPerAtom
G4OrderedTable * fMatSandiaMatrix

◆ G4SandiaTable() [3/5]

G4SandiaTable::G4SandiaTable ( G4int  matIndex)

Definition at line 614 of file G4SandiaTable.cc.

615 {
616  fMaterial = 0;
617  fMatNbOfIntervals = 0;
618  fMatSandiaMatrix = 0;
621 
622  fMaxInterval = 0;
623  fVerbose = 0;
624  fLowerI1 = false;
625 
626  fSandiaCofPerAtom.resize(4,0.0);
627 
628  const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable();
629  G4int numberOfMat = G4Material::GetNumberOfMaterials();
630 
631  if ( matIndex >= 0 && matIndex < numberOfMat)
632  {
633  fMaterial = (*theMaterialTable)[matIndex];
634  // ComputeMatTable();
635  }
636  else
637  {
638  G4Exception("G4SandiaTable::G4SandiaTable(G4int matIndex)", "mat401",
639  FatalException, "wrong matIndex");
640  }
641 }
G4OrderedTable * fMatSandiaMatrixPAI
static G4MaterialTable * GetMaterialTable()
Definition: G4Material.cc:589
std::vector< G4Material * > G4MaterialTable
G4double ** fPhotoAbsorptionCof
int G4int
Definition: G4Types.hh:78
G4int fMatNbOfIntervals
static size_t GetNumberOfMaterials()
Definition: G4Material.cc:596
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
G4Material * fMaterial
std::vector< G4double > fSandiaCofPerAtom
G4OrderedTable * fMatSandiaMatrix
Here is the call graph for this function:

◆ G4SandiaTable() [4/5]

G4SandiaTable::G4SandiaTable ( )

Definition at line 645 of file G4SandiaTable.cc.

646 {
647  fMaterial = 0;
648  fMatNbOfIntervals = 0;
649  fMatSandiaMatrix = 0;
652 
653  fMaxInterval = 0;
654  fVerbose = 0;
655  fLowerI1 = false;
656 
657  fSandiaCofPerAtom.resize(4,0.0);
658 }
G4OrderedTable * fMatSandiaMatrixPAI
G4double ** fPhotoAbsorptionCof
G4int fMatNbOfIntervals
G4Material * fMaterial
std::vector< G4double > fSandiaCofPerAtom
G4OrderedTable * fMatSandiaMatrix
Here is the caller graph for this function:

◆ G4SandiaTable() [5/5]

G4SandiaTable::G4SandiaTable ( G4SandiaTable )
private

Member Function Documentation

◆ ComputeMatSandiaMatrix()

void G4SandiaTable::ComputeMatSandiaMatrix ( )
private

Definition at line 211 of file G4SandiaTable.cc.

212 {
213  //get list of elements
214  const G4int NbElm = fMaterial->GetNumberOfElements();
215  const G4ElementVector* ElementVector = fMaterial->GetElementVector();
216 
217  G4int* Z = new G4int[NbElm]; //Atomic number
218 
219  //determine the maximum number of energy-intervals for this material
220 
221  G4int MaxIntervals = 0;
222  G4int elm;
223 
224  for ( elm = 0; elm < NbElm; elm++ )
225  {
226  Z[elm] = (G4int)(*ElementVector)[elm]->GetZ();
227  MaxIntervals += fNbOfIntervals[Z[elm]];
228  }
229 
230  //copy the Energy bins in a tmp1 array
231  //(take care of the Ionization Potential of each element)
232 
233  G4double* tmp1 = new G4double[MaxIntervals];
234  G4double IonizationPot;
235  G4int interval1 = 0;
236 
237  for ( elm = 0; elm < NbElm; elm++ )
238  {
239  IonizationPot = GetIonizationPot(Z[elm]);
240 
241  for(G4int row = fCumulInterval[Z[elm]-1]; row<fCumulInterval[Z[elm]]; ++row)
242  {
243  tmp1[interval1++] = std::max(fSandiaTable[row][0]*keV,IonizationPot);
244  }
245  }
246 
247  //sort the energies in strickly increasing values in a tmp2 array
248  //(eliminate redondances)
249 
250  G4double* tmp2 = new G4double[MaxIntervals];
251  G4double Emin;
252  G4int interval2 = 0;
253 
254  do
255  {
256  Emin = DBL_MAX;
257 
258  for ( G4int i1 = 0; i1 < MaxIntervals; i1++ )
259  {
260  if (tmp1[i1] < Emin) Emin = tmp1[i1]; //find the minimum
261  }
262  if (Emin < DBL_MAX) tmp2[interval2++] = Emin;
263  //copy Emin in tmp2
264  for ( G4int j1 = 0; j1 < MaxIntervals; j1++ )
265  {
266  if (tmp1[j1] <= Emin) tmp1[j1] = DBL_MAX; //eliminate from tmp1
267  }
268  // Loop checking, 07-Aug-2015, Vladimir Ivanchenko
269  } while (Emin < DBL_MAX);
270 
271  //create the sandia matrix for this material
272 
274  G4int interval;
275 
276  for (interval = 0; interval < interval2; interval++ )
277  {
278  fMatSandiaMatrix->push_back( new G4DataVector(5,0.) );
279  }
280 
281  //ready to compute the Sandia coefs for the material
282 
283  const G4double* NbOfAtomsPerVolume = fMaterial->GetVecNbOfAtomsPerVolume();
284 
285  static const G4double prec = 1.e-03*eV;
286  G4double coef, oldsum(0.), newsum(0.);
287  fMatNbOfIntervals = 0;
288 
289  for ( interval = 0; interval < interval2; interval++ )
290  {
291  Emin = (*(*fMatSandiaMatrix)[fMatNbOfIntervals])[0] = tmp2[interval];
292 
293  for ( G4int k = 1; k < 5; ++k ) {
294  (*(*fMatSandiaMatrix)[fMatNbOfIntervals])[k] = 0.;
295  }
296  newsum = 0.;
297 
298  for ( elm = 0; elm < NbElm; elm++ )
299  {
300  GetSandiaCofPerAtom(Z[elm], Emin+prec, fSandiaCofPerAtom);
301 
302  for ( G4int j = 1; j < 5; ++j )
303  {
304  coef = NbOfAtomsPerVolume[elm]*fSandiaCofPerAtom[j-1];
305  (*(*fMatSandiaMatrix)[fMatNbOfIntervals])[j] += coef;
306  newsum += std::fabs(coef);
307  }
308  }
309  //check for null or redondant intervals
310 
311  if (newsum != oldsum) { oldsum = newsum; fMatNbOfIntervals++;}
312  }
313  delete [] Z;
314  delete [] tmp1;
315  delete [] tmp2;
316 
317  // fMaxInterval = fMatNbOfIntervals; // vmg 16.02.11
318 
319  if ( fVerbose > 0 && fMaterial->GetName() == "G4_Ar" )
320  {
321  G4cout<<"mma, G4SandiaTable::ComputeMatSandiaMatrix(), mat = "
322  <<fMaterial->GetName()<<G4endl;
323 
324  for( G4int i = 0; i < fMatNbOfIntervals; ++i)
325  {
326  G4cout<<i<<"\t"<<GetSandiaCofForMaterial(i,0)/keV<<" keV \t"
327  <<this->GetSandiaCofForMaterial(i,1)
328  <<"\t"<<this->GetSandiaCofForMaterial(i,2)
329  <<"\t"<<this->GetSandiaCofForMaterial(i,3)
330  <<"\t"<<this->GetSandiaCofForMaterial(i,4)<<G4endl;
331  }
332  }
333 }
std::vector< G4Element * > G4ElementVector
G4double GetSandiaCofForMaterial(G4int, G4int) const
G4double GetIonizationPot(G4int Z) const
int G4int
Definition: G4Types.hh:78
static G4int fCumulInterval[101]
static const double prec
Definition: RanecuEngine.cc:58
G4GLOB_DLL std::ostream G4cout
Float_t Z
G4int fMatNbOfIntervals
const G4double * GetVecNbOfAtomsPerVolume() const
Definition: G4Material.hh:206
static const G4int fNbOfIntervals[101]
static const double eV
Definition: G4SIunits.hh:212
G4Material * fMaterial
size_t GetNumberOfElements() const
Definition: G4Material.hh:186
static const G4double Emin
#define G4endl
Definition: G4ios.hh:61
std::vector< G4double > fSandiaCofPerAtom
static const double keV
Definition: G4SIunits.hh:213
const G4ElementVector * GetElementVector() const
Definition: G4Material.hh:190
double G4double
Definition: G4Types.hh:76
G4OrderedTable * fMatSandiaMatrix
const G4String & GetName() const
Definition: G4Material.hh:178
static const G4double fSandiaTable[981][5]
#define DBL_MAX
Definition: templates.hh:83
void GetSandiaCofPerAtom(G4int Z, G4double energy, std::vector< G4double > &coeff) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputeMatSandiaMatrixPAI()

void G4SandiaTable::ComputeMatSandiaMatrixPAI ( )
private

Definition at line 339 of file G4SandiaTable.cc.

340 {
341  G4int MaxIntervals = 0;
342  G4int elm, c, i, j, jj, k, k1, k2, c1, n1;
343 
344  const G4int noElm = fMaterial->GetNumberOfElements();
345  const G4ElementVector* ElementVector = fMaterial->GetElementVector();
346 
347  std::vector<G4int> Z(noElm); //Atomic number
348 
349  for ( elm = 0; elm < noElm; elm++ )
350  {
351  Z[elm] = (G4int)(*ElementVector)[elm]->GetZ();
352  MaxIntervals += fNbOfIntervals[Z[elm]];
353  }
354  fMaxInterval = MaxIntervals + 2;
355 
356  if ( fVerbose > 0 )
357  {
358  G4cout<<"fMaxInterval = "<<fMaxInterval<<G4endl;
359  }
360 
361  G4DataVector fPhotoAbsorptionCof0(fMaxInterval);
362  G4DataVector fPhotoAbsorptionCof1(fMaxInterval);
363  G4DataVector fPhotoAbsorptionCof2(fMaxInterval);
364  G4DataVector fPhotoAbsorptionCof3(fMaxInterval);
365  G4DataVector fPhotoAbsorptionCof4(fMaxInterval);
366 
367  for( c = 0; c < fMaxInterval; ++c ) // just in case
368  {
369  fPhotoAbsorptionCof0[c] = 0.;
370  fPhotoAbsorptionCof1[c] = 0.;
371  fPhotoAbsorptionCof2[c] = 0.;
372  fPhotoAbsorptionCof3[c] = 0.;
373  fPhotoAbsorptionCof4[c] = 0.;
374  }
375  c = 1;
376 
377  for(i = 0; i < noElm; ++i)
378  {
379  G4double I1 = fIonizationPotentials[Z[i]]*keV; // I1 in keV
380  n1 = 1;
381 
382  for( j = 1; j < Z[i]; ++j ) n1 += fNbOfIntervals[j];
383 
384  G4int n2 = n1 + fNbOfIntervals[Z[i]];
385 
386  for( k1 = n1; k1 < n2; k1++ )
387  {
388  if( I1 > fSandiaTable[k1][0] )
389  {
390  continue; // no ionization for energies smaller than I1 (first
391  } // ionisation potential)
392  break;
393  }
394  G4int flag = 0;
395 
396  for( c1 = 1; c1 < c; c1++ )
397  {
398  if( fPhotoAbsorptionCof0[c1] == I1 ) // this value already has existed
399  {
400  flag = 1;
401  break;
402  }
403  }
404  if(flag == 0)
405  {
406  fPhotoAbsorptionCof0[c] = I1;
407  ++c;
408  }
409  for( k2 = k1; k2 < n2; k2++ )
410  {
411  flag = 0;
412 
413  for( c1 = 1; c1 < c; c1++ )
414  {
415  if( fPhotoAbsorptionCof0[c1] == fSandiaTable[k2][0] )
416  {
417  flag = 1;
418  break;
419  }
420  }
421  if(flag == 0)
422  {
423  fPhotoAbsorptionCof0[c] = fSandiaTable[k2][0];
424  ++c;
425  }
426  }
427  } // end for(i)
428  // sort out
429 
430  for( i = 1; i < c; ++i )
431  {
432  for( j = i + 1; j < c; ++j )
433  {
434  if( fPhotoAbsorptionCof0[i] > fPhotoAbsorptionCof0[j] )
435  {
436  G4double tmp = fPhotoAbsorptionCof0[i];
437  fPhotoAbsorptionCof0[i] = fPhotoAbsorptionCof0[j];
438  fPhotoAbsorptionCof0[j] = tmp;
439  }
440  }
441  if ( fVerbose > 0 && fMaterial->GetName() == "G4_Ar" )
442  {
443  G4cout<<i<<"\t energy = "<<fPhotoAbsorptionCof0[i]<<G4endl;
444  }
445  }
446  fMaxInterval = c;
447 
448  const G4double* fractionW = fMaterial->GetFractionVector();
449 
450  if ( fVerbose > 0 && fMaterial->GetName() == "G4_Ar" )
451  {
452  for( i = 0; i < noElm; ++i )
453  G4cout<<i<<" = elN, fraction = "<<fractionW[i]<<G4endl;
454  }
455 
456  for( i = 0; i < noElm; ++i )
457  {
458  n1 = 1;
460 
461  for( j = 1; j < Z[i]; ++j ) n1 += fNbOfIntervals[j];
462 
463  G4int n2 = n1 + fNbOfIntervals[Z[i]] - 1;
464 
465  for(k = n1; k < n2; ++k)
466  {
467  G4double B1 = fSandiaTable[k][0];
468  G4double B2 = fSandiaTable[k+1][0];
469 
470  for(G4int q = 1; q < fMaxInterval-1; q++)
471  {
472  G4double E1 = fPhotoAbsorptionCof0[q];
473  G4double E2 = fPhotoAbsorptionCof0[q+1];
474 
475  if ( fVerbose > 0 )
476  {
477  G4cout<<"k = "<<k<<", q = "<<q<<", B1 = "<<B1<<", B2 = "<<B2
478  <<", E1 = "<<E1<<", E2 = "<<E2<<G4endl;
479  }
480  if( B1 > E1 || B2 < E2 || E1 < I1 )
481  {
482  if ( fVerbose > 0 )
483  {
484  G4cout<<"continue for: B1 = "<<B1<<", B2 = "<<B2<<", E1 = "
485  <<E1<<", E2 = "<<E2<<G4endl;
486  }
487  continue;
488  }
489  fPhotoAbsorptionCof1[q] += fSandiaTable[k][1]*fractionW[i];
490  fPhotoAbsorptionCof2[q] += fSandiaTable[k][2]*fractionW[i];
491  fPhotoAbsorptionCof3[q] += fSandiaTable[k][3]*fractionW[i];
492  fPhotoAbsorptionCof4[q] += fSandiaTable[k][4]*fractionW[i];
493  }
494  }
495  // Last interval
496 
497  fPhotoAbsorptionCof1[fMaxInterval-1] += fSandiaTable[k][1]*fractionW[i];
498  fPhotoAbsorptionCof2[fMaxInterval-1] += fSandiaTable[k][2]*fractionW[i];
499  fPhotoAbsorptionCof3[fMaxInterval-1] += fSandiaTable[k][3]*fractionW[i];
500  fPhotoAbsorptionCof4[fMaxInterval-1] += fSandiaTable[k][4]*fractionW[i];
501  } // for(i)
502  c = 0; // Deleting of first intervals where all coefficients = 0
503 
504  do
505  {
506  ++c;
507 
508  if( fPhotoAbsorptionCof1[c] != 0.0 ||
509  fPhotoAbsorptionCof2[c] != 0.0 ||
510  fPhotoAbsorptionCof3[c] != 0.0 ||
511  fPhotoAbsorptionCof4[c] != 0.0 ) continue;
512 
513  if ( fVerbose > 0 )
514  {
515  G4cout<<c<<" = number with zero cofs"<<G4endl;
516  }
517  for( jj = 2; jj < fMaxInterval; ++jj )
518  {
519  fPhotoAbsorptionCof0[jj-1] = fPhotoAbsorptionCof0[jj];
520  fPhotoAbsorptionCof1[jj-1] = fPhotoAbsorptionCof1[jj];
521  fPhotoAbsorptionCof2[jj-1] = fPhotoAbsorptionCof2[jj];
522  fPhotoAbsorptionCof3[jj-1] = fPhotoAbsorptionCof3[jj];
523  fPhotoAbsorptionCof4[jj-1] = fPhotoAbsorptionCof4[jj];
524  }
525  --fMaxInterval;
526  --c;
527  }
528  // Loop checking, 07-Aug-2015, Vladimir Ivanchenko
529  while( c < fMaxInterval - 1 );
530 
531  if( fPhotoAbsorptionCof0[fMaxInterval-1] == 0.0 ) fMaxInterval--;
532 
533  // create the sandia matrix for this material
534 
536 
538 
539  for (i = 0; i < fMaxInterval; ++i) // -> G4units
540  {
541  fPhotoAbsorptionCof0[i+1] *= funitc[0];
542  fPhotoAbsorptionCof1[i+1] *= funitc[1]*density;
543  fPhotoAbsorptionCof2[i+1] *= funitc[2]*density;
544  fPhotoAbsorptionCof3[i+1] *= funitc[3]*density;
545  fPhotoAbsorptionCof4[i+1] *= funitc[4]*density;
546  }
547  if(fLowerI1)
548  {
549  if( fMaterial->GetName() == "G4_WATER")
550  {
551  fMaxInterval += fH2OlowerInt;
552 
553  for (i = 0; i < fMaxInterval; ++i) // init vector table
554  {
555  fMatSandiaMatrixPAI->push_back( new G4DataVector(5,0.) );
556  }
557  for (i = 0; i < fH2OlowerInt; ++i)
558  {
559  (*(*fMatSandiaMatrixPAI)[i])[0] = fH2OlowerI1[i][0];
560  (*(*fMatSandiaMatrixPAI)[i])[1] = fH2OlowerI1[i][1]; // *density;
561  (*(*fMatSandiaMatrixPAI)[i])[2] = fH2OlowerI1[i][2]; // *density;
562  (*(*fMatSandiaMatrixPAI)[i])[3] = fH2OlowerI1[i][3]; // *density;
563  (*(*fMatSandiaMatrixPAI)[i])[4] = fH2OlowerI1[i][4]; // *density;
564  }
565  for (i = fH2OlowerInt; i < fMaxInterval; ++i)
566  {
567  (*(*fMatSandiaMatrixPAI)[i])[0] = fPhotoAbsorptionCof0[i+1-fH2OlowerInt];
568  (*(*fMatSandiaMatrixPAI)[i])[1] = fPhotoAbsorptionCof1[i+1-fH2OlowerInt]; // *density;
569  (*(*fMatSandiaMatrixPAI)[i])[2] = fPhotoAbsorptionCof2[i+1-fH2OlowerInt]; // *density;
570  (*(*fMatSandiaMatrixPAI)[i])[3] = fPhotoAbsorptionCof3[i+1-fH2OlowerInt]; // *density;
571  (*(*fMatSandiaMatrixPAI)[i])[4] = fPhotoAbsorptionCof4[i+1-fH2OlowerInt]; // *density;
572  }
573  }
574  }
575  else
576  {
577  for (i = 0; i < fMaxInterval; ++i) // init vector table
578  {
579  fMatSandiaMatrixPAI->push_back( new G4DataVector(5,0.) );
580  }
581  for (i = 0; i < fMaxInterval; ++i)
582  {
583  (*(*fMatSandiaMatrixPAI)[i])[0] = fPhotoAbsorptionCof0[i+1];
584  (*(*fMatSandiaMatrixPAI)[i])[1] = fPhotoAbsorptionCof1[i+1]; // *density;
585  (*(*fMatSandiaMatrixPAI)[i])[2] = fPhotoAbsorptionCof2[i+1]; // *density;
586  (*(*fMatSandiaMatrixPAI)[i])[3] = fPhotoAbsorptionCof3[i+1]; // *density;
587  (*(*fMatSandiaMatrixPAI)[i])[4] = fPhotoAbsorptionCof4[i+1]; // *density;
588  }
589  }
590  // --fMaxInterval;
591  // to avoid duplicate at 500 keV or extra zeros in last interval
592 
593  if ( fVerbose > 0 )
594  {
595  G4cout<<"vmg, G4SandiaTable::ComputeMatSandiaMatrixPAI(), mat = "
596  <<fMaterial->GetName()<<G4endl;
597 
598  for( i = 0; i < fMaxInterval; ++i)
599  {
600  G4cout<<i<<"\t"<<GetSandiaMatTablePAI(i,0)/keV<<" keV \t"
601  <<this->GetSandiaMatTablePAI(i,1)
602  <<"\t"<<this->GetSandiaMatTablePAI(i,2)
603  <<"\t"<<this->GetSandiaMatTablePAI(i,3)
604  <<"\t"<<this->GetSandiaMatTablePAI(i,4)<<G4endl;
605  }
606  }
607  return;
608 }
G4OrderedTable * fMatSandiaMatrixPAI
Float_t tmp
std::vector< G4Element * > G4ElementVector
static const G4double funitc[5]
const G4double * GetFractionVector() const
Definition: G4Material.hh:194
G4double GetDensity() const
Definition: G4Material.hh:180
static const G4double fH2OlowerI1[23][5]
int G4int
Definition: G4Types.hh:78
G4double density
Definition: TRTMaterials.hh:39
G4GLOB_DLL std::ostream G4cout
Float_t Z
G4double GetSandiaMatTablePAI(G4int, G4int) const
static const G4int fNbOfIntervals[101]
G4Material * fMaterial
size_t GetNumberOfElements() const
Definition: G4Material.hh:186
static const G4int fH2OlowerInt
static const G4double fIonizationPotentials[101]
#define G4endl
Definition: G4ios.hh:61
static const double keV
Definition: G4SIunits.hh:213
const G4ElementVector * GetElementVector() const
Definition: G4Material.hh:190
double G4double
Definition: G4Types.hh:76
const G4String & GetName() const
Definition: G4Material.hh:178
static const G4double fSandiaTable[981][5]
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputeMatTable()

void G4SandiaTable::ComputeMatTable ( )
private

Definition at line 1045 of file G4SandiaTable.cc.

1046 {
1047  G4int MaxIntervals = 0;
1048  G4int elm, c, i, j, jj, k, kk, k1, k2, c1, n1;
1049 
1050  const G4int noElm = fMaterial->GetNumberOfElements();
1051  const G4ElementVector* ElementVector = fMaterial->GetElementVector();
1052  G4int* Z = new G4int[noElm]; //Atomic number
1053 
1054  for (elm = 0; elm<noElm; ++elm)
1055  {
1056  Z[elm] = (G4int)(*ElementVector)[elm]->GetZ();
1057  MaxIntervals += fNbOfIntervals[Z[elm]];
1058  }
1059  fMaxInterval = 0;
1060 
1061  for(i = 0; i < noElm; ++i) fMaxInterval += fNbOfIntervals[Z[i]];
1062 
1063  fMaxInterval += 2;
1064 
1065  // G4cout<<"fMaxInterval = "<<fMaxInterval<<G4endl;
1066 
1068 
1069  for(i = 0; i < fMaxInterval; ++i)
1070  {
1071  fPhotoAbsorptionCof[i] = new G4double[5];
1072  }
1073 
1074  // for(c = 0; c < fIntervalLimit; ++c) // just in case
1075 
1076  for(c = 0; c < fMaxInterval; ++c) // just in case
1077  {
1078  fPhotoAbsorptionCof[c][0] = 0.;
1079  }
1080  c = 1;
1081 
1082  for(i = 0; i < noElm; ++i)
1083  {
1084  G4double I1 = fIonizationPotentials[Z[i]]*keV; // First ionization
1085  n1 = 1; // potential in keV
1086 
1087  for(j = 1; j < Z[i]; ++j)
1088  {
1089  n1 += fNbOfIntervals[j];
1090  }
1091  G4int n2 = n1 + fNbOfIntervals[Z[i]];
1092 
1093  for(k1 = n1; k1 < n2; ++k1)
1094  {
1095  if(I1 > fSandiaTable[k1][0])
1096  {
1097  continue; // no ionization for energies smaller than I1 (first
1098  } // ionisation potential)
1099  break;
1100  }
1101  G4int flag = 0;
1102 
1103  for(c1 = 1; c1 < c; ++c1)
1104  {
1105  if(fPhotoAbsorptionCof[c1][0] == I1) // this value already has existed
1106  {
1107  flag = 1;
1108  break;
1109  }
1110  }
1111  if(flag == 0)
1112  {
1113  fPhotoAbsorptionCof[c][0] = I1;
1114  ++c;
1115  }
1116  for(k2 = k1; k2 < n2; ++k2)
1117  {
1118  flag = 0;
1119 
1120  for(c1 = 1; c1 < c; ++c1)
1121  {
1122  if(fPhotoAbsorptionCof[c1][0] == fSandiaTable[k2][0])
1123  {
1124  flag = 1;
1125  break;
1126  }
1127  }
1128  if(flag == 0)
1129  {
1130  fPhotoAbsorptionCof[c][0] = fSandiaTable[k2][0];
1131  ++c;
1132  }
1133  }
1134  } // end for(i)
1135 
1137  fMaxInterval = c;
1138 
1139  const G4double* fractionW = fMaterial->GetFractionVector();
1140 
1141  for(i = 0; i < fMaxInterval; ++i)
1142  {
1143  for(j = 1; j < 5; ++j) fPhotoAbsorptionCof[i][j] = 0.;
1144  }
1145  for(i = 0; i < noElm; ++i)
1146  {
1147  n1 = 1;
1148  G4double I1 = fIonizationPotentials[Z[i]]*keV;
1149 
1150  for(j = 1; j < Z[i]; ++j)
1151  {
1152  n1 += fNbOfIntervals[j];
1153  }
1154  G4int n2 = n1 + fNbOfIntervals[Z[i]] - 1;
1155 
1156  for(k = n1; k < n2; ++k)
1157  {
1158  G4double B1 = fSandiaTable[k][0];
1159  G4double B2 = fSandiaTable[k+1][0];
1160  for(G4int q = 1; q < fMaxInterval-1; q++)
1161  {
1162  G4double E1 = fPhotoAbsorptionCof[q][0];
1163  G4double E2 = fPhotoAbsorptionCof[q+1][0];
1164  if(B1 > E1 || B2 < E2 || E1 < I1)
1165  {
1166  continue;
1167  }
1168  for(j = 1; j < 5; ++j)
1169  {
1170  fPhotoAbsorptionCof[q][j] += fSandiaTable[k][j]*fractionW[i];
1171  }
1172  }
1173  }
1174  for(j = 1; j < 5; ++j) // Last interval
1175  {
1176  fPhotoAbsorptionCof[fMaxInterval-1][j] +=
1177  fSandiaTable[k][j]*fractionW[i];
1178  }
1179  } // for(i)
1180 
1181  c = 0; // Deleting of first intervals where all coefficients = 0
1182 
1183  do
1184  {
1185  ++c;
1186 
1187  if( fPhotoAbsorptionCof[c][1] != 0.0 ||
1188  fPhotoAbsorptionCof[c][2] != 0.0 ||
1189  fPhotoAbsorptionCof[c][3] != 0.0 ||
1190  fPhotoAbsorptionCof[c][4] != 0.0 ) continue;
1191 
1192  for(jj = 2; jj < fMaxInterval; ++jj)
1193  {
1194  for(kk = 0; kk < 5; ++kk)
1195  {
1196  fPhotoAbsorptionCof[jj-1][kk]= fPhotoAbsorptionCof[jj][kk];
1197  }
1198  }
1199  --fMaxInterval;
1200  --c;
1201  }
1202  // Loop checking, 07-Aug-2015, Vladimir Ivanchenko
1203  while( c < fMaxInterval - 1 );
1204 
1205  // create the sandia matrix for this material
1206 
1207  --fMaxInterval; // vmg 20.11.10
1208 
1210 
1211  for (i = 0; i < fMaxInterval; ++i)
1212  {
1213  fMatSandiaMatrix->push_back(new G4DataVector(5,0.));
1214  }
1215  for ( i = 0; i < fMaxInterval; ++i )
1216  {
1217  for( j = 0; j < 5; ++j )
1218  {
1219  (*(*fMatSandiaMatrix)[i])[j] = fPhotoAbsorptionCof[i+1][j];
1220  }
1221  }
1223 
1224  if ( fVerbose > 0 )
1225  {
1226  G4cout<<"vmg, G4SandiaTable::ComputeMatTable(), mat = "
1227  <<fMaterial->GetName()<<G4endl;
1228 
1229  for ( i = 0; i < fMaxInterval; ++i )
1230  {
1231  // G4cout<<i<<"\t"<<(*(*fMatSandiaMatrix)[i])[0]<<" keV \t"
1232  // <<(*(*fMatSandiaMatrix)[i])[1]
1233  // <<"\t"<<(*(*fMatSandiaMatrix)[i])[2]<<"\t"
1234  // <<(*(*fMatSandiaMatrix)[i])[3]
1235  // <<"\t"<<(*(*fMatSandiaMatrix)[i])[4]<<G4endl;
1236 
1237  G4cout<<i<<"\t"<<GetSandiaCofForMaterial(i,0)/keV
1238  <<" keV \t"<<this->GetSandiaCofForMaterial(i,1)
1239  <<"\t"<<this->GetSandiaCofForMaterial(i,2)
1240  <<"\t"<<this->GetSandiaCofForMaterial(i,3)
1241  <<"\t"<<this->GetSandiaCofForMaterial(i,4)<<G4endl;
1242  }
1243  }
1244  delete [] Z;
1245  return;
1246 }
std::vector< G4Element * > G4ElementVector
G4double GetSandiaCofForMaterial(G4int, G4int) const
const G4double * GetFractionVector() const
Definition: G4Material.hh:194
G4double ** fPhotoAbsorptionCof
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
void SandiaSort(G4double **da, G4int sz)
Float_t Z
G4int fMatNbOfIntervals
static const G4int fNbOfIntervals[101]
G4Material * fMaterial
size_t GetNumberOfElements() const
Definition: G4Material.hh:186
static const G4double fIonizationPotentials[101]
#define G4endl
Definition: G4ios.hh:61
static const double keV
Definition: G4SIunits.hh:213
const G4ElementVector * GetElementVector() const
Definition: G4Material.hh:190
double G4double
Definition: G4Types.hh:76
G4OrderedTable * fMatSandiaMatrix
const G4String & GetName() const
Definition: G4Material.hh:178
static const G4double fSandiaTable[981][5]
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetIonizationPot()

G4double G4SandiaTable::GetIonizationPot ( G4int  Z) const
private

Definition at line 1025 of file G4SandiaTable.cc.

1026 {
1027  assert (Z>0 && Z<101);
1029 }
Float_t Z
static const G4double fIonizationPotentials[101]
static const double eV
Here is the caller graph for this function:

◆ GetLowerI1()

G4bool G4SandiaTable::GetLowerI1 ( )
inline

Definition at line 175 of file G4SandiaTable.hh.

175 {return fLowerI1;};
Here is the caller graph for this function:

◆ GetMatNbOfIntervals()

G4int G4SandiaTable::GetMatNbOfIntervals ( ) const

Definition at line 922 of file G4SandiaTable.cc.

923 {
924  return fMatNbOfIntervals;
925 }
G4int fMatNbOfIntervals

◆ GetMaxInterval()

G4int G4SandiaTable::GetMaxInterval ( ) const

Definition at line 689 of file G4SandiaTable.cc.

690 {
691  return fMaxInterval;
692 }
Here is the caller graph for this function:

◆ GetNbOfIntervals()

G4int G4SandiaTable::GetNbOfIntervals ( G4int  Z)
private

Definition at line 929 of file G4SandiaTable.cc.

930 {
931  assert (Z>0 && Z<101);
932  return fNbOfIntervals[Z];
933 }
Float_t Z
static const G4int fNbOfIntervals[101]
Here is the caller graph for this function:

◆ GetPhotoAbsorpCof()

G4double G4SandiaTable::GetPhotoAbsorpCof ( G4int  i,
G4int  j 
) const

Definition at line 715 of file G4SandiaTable.cc.

716 {
717  return fPhotoAbsorptionCof[i][j]*funitc[j];
718 }
static const G4double funitc[5]
G4double ** fPhotoAbsorptionCof
Here is the caller graph for this function:

◆ GetPointerToCof()

G4double ** G4SandiaTable::GetPointerToCof ( )

Definition at line 696 of file G4SandiaTable.cc.

697 {
699  return fPhotoAbsorptionCof;
700 }
void ComputeMatTable()
G4double ** fPhotoAbsorptionCof
Here is the call graph for this function:

◆ GetSandiaCofForMaterial() [1/2]

G4double G4SandiaTable::GetSandiaCofForMaterial ( G4int  interval,
G4int  j 
) const

Definition at line 954 of file G4SandiaTable.cc.

955 {
956  assert (interval>=0 && interval<fMatNbOfIntervals && j>=0 && j<5);
957  return ((*(*fMatSandiaMatrix)[interval])[j]);
958 }
G4OrderedTable * fMatSandiaMatrix
Here is the caller graph for this function:

◆ GetSandiaCofForMaterial() [2/2]

const G4double * G4SandiaTable::GetSandiaCofForMaterial ( G4double  energy) const

Definition at line 963 of file G4SandiaTable.cc.

964 {
965  G4int interval = 0;
966  if (energy > (*(*fMatSandiaMatrix)[0])[0]) {
967  interval = fMatNbOfIntervals - 1;
968  // Loop checking, 07-Aug-2015, Vladimir Ivanchenko
969  while ((interval>0)&&(energy<(*(*fMatSandiaMatrix)[interval])[0]))
970  { --interval; }
971  }
972  return &((*(*fMatSandiaMatrix)[interval])[1]);
973 }
int G4int
Definition: G4Types.hh:78
double energy
Definition: plottest35.C:25
G4int fMatNbOfIntervals
G4OrderedTable * fMatSandiaMatrix

◆ GetSandiaCofForMaterialPAI() [1/2]

G4double G4SandiaTable::GetSandiaCofForMaterialPAI ( G4int  interval,
G4int  j 
) const

Definition at line 987 of file G4SandiaTable.cc.

988 {
989  assert(fMatSandiaMatrixPAI && interval>=0 &&
990  interval<fMatNbOfIntervals && j>=0 && j<5);
991  return ((*(*fMatSandiaMatrixPAI)[interval])[j]);
992 }
G4OrderedTable * fMatSandiaMatrixPAI

◆ GetSandiaCofForMaterialPAI() [2/2]

const G4double * G4SandiaTable::GetSandiaCofForMaterialPAI ( G4double  energy) const

Definition at line 997 of file G4SandiaTable.cc.

998 {
999  assert(fMatSandiaMatrixPAI);
1000  const G4double* x = fnulcof;
1001  if (energy >= (*(*fMatSandiaMatrixPAI)[0])[0]) {
1002 
1003  G4int interval = fMatNbOfIntervals - 1;
1004  // Loop checking, 07-Aug-2015, Vladimir Ivanchenko
1005  while ((interval>0)&&(energy<(*(*fMatSandiaMatrixPAI)[interval])[0]))
1006  {interval--;}
1007  x = &((*(*fMatSandiaMatrixPAI)[interval])[1]);
1008  }
1009  return x;
1010 }
G4OrderedTable * fMatSandiaMatrixPAI
int G4int
Definition: G4Types.hh:78
static const G4double fnulcof[4]
double energy
Definition: plottest35.C:25
G4int fMatNbOfIntervals
double G4double
Definition: G4Types.hh:76

◆ GetSandiaCofPerAtom()

void G4SandiaTable::GetSandiaCofPerAtom ( G4int  Z,
G4double  energy,
std::vector< G4double > &  coeff 
) const

Definition at line 137 of file G4SandiaTable.cc.

139 {
140  assert(4 <= coeff.size());
142  //G4double Iopot = fIonizationPotentials[Z]*eV;
143  //if (Emin < Iopot) Emin = Iopot;
144 
145  G4int row = 0;
146  if (energy <= Emin) {
147  energy = Emin;
148 
149  } else {
150  G4int interval = fNbOfIntervals[Z] - 1;
151  row = fCumulInterval[Z-1] + interval;
152  // Loop checking, 07-Aug-2015, Vladimir Ivanchenko
153  while ((interval>0) && (energy<fSandiaTable[row][0]*keV)) {
154  --interval;
155  row = fCumulInterval[Z-1] + interval;
156  }
157  }
158 
159  G4double AoverAvo = Z*amu/fZtoAratio[Z];
160 
161  coeff[0]=AoverAvo*funitc[1]*fSandiaTable[row][1];
162  coeff[1]=AoverAvo*funitc[2]*fSandiaTable[row][2];
163  coeff[2]=AoverAvo*funitc[3]*fSandiaTable[row][3];
164  coeff[3]=AoverAvo*funitc[4]*fSandiaTable[row][4];
165 }
static const G4double funitc[5]
int G4int
Definition: G4Types.hh:78
static G4int fCumulInterval[101]
double energy
Definition: plottest35.C:25
Float_t Z
static const G4int fNbOfIntervals[101]
static const G4double Emin
static const double keV
Definition: G4SIunits.hh:213
double G4double
Definition: G4Types.hh:76
static const G4double fSandiaTable[981][5]
static const G4double fZtoAratio[101]
Here is the caller graph for this function:

◆ GetSandiaCofWater()

void G4SandiaTable::GetSandiaCofWater ( G4double  energy,
std::vector< G4double > &  coeff 
) const

Definition at line 170 of file G4SandiaTable.cc.

172 {
173  assert(4 <= coeff.size());
174  G4int i = 0;
175  if(energy > fH2OlowerI1[0][0]*keV) {
176  i = fH2OlowerInt - 1;
177  for(; i>0; --i) {
178  if(energy >= fH2OlowerI1[i][0]*keV) { break; }
179  }
180  }
181  coeff[0]=funitc[1]*fH2OlowerI1[i][1];
182  coeff[1]=funitc[2]*fH2OlowerI1[i][2];
183  coeff[2]=funitc[3]*fH2OlowerI1[i][3];
184  coeff[3]=funitc[4]*fH2OlowerI1[i][4];
185 }
static const G4double funitc[5]
static const G4double fH2OlowerI1[23][5]
int G4int
Definition: G4Types.hh:78
double energy
Definition: plottest35.C:25
static const G4int fH2OlowerInt
static const double keV
Definition: G4SIunits.hh:213
Here is the caller graph for this function:

◆ GetSandiaMatrixPAI()

G4OrderedTable * G4SandiaTable::GetSandiaMatrixPAI ( )

Definition at line 1034 of file G4SandiaTable.cc.

1035 {
1037  return fMatSandiaMatrixPAI;
1038 }
G4OrderedTable * fMatSandiaMatrixPAI
void ComputeMatSandiaMatrixPAI()
Here is the call graph for this function:

◆ GetSandiaMatTable()

G4double G4SandiaTable::GetSandiaMatTable ( G4int  interval,
G4int  j 
) const

Definition at line 978 of file G4SandiaTable.cc.

979 {
980  assert(interval >= 0 && interval < fMaxInterval && j >= 0 && j < 5 );
981  return ((*(*fMatSandiaMatrix)[interval])[j])*funitc[j];
982 }
static const G4double funitc[5]
G4OrderedTable * fMatSandiaMatrix
Here is the caller graph for this function:

◆ GetSandiaMatTablePAI()

G4double G4SandiaTable::GetSandiaMatTablePAI ( G4int  interval,
G4int  j 
) const

Definition at line 1015 of file G4SandiaTable.cc.

1016 {
1017  assert(fMatSandiaMatrixPAI && interval >= 0 &&
1018  interval < fMaxInterval && j >= 0 && j < 5 );
1019  return ((*(*fMatSandiaMatrixPAI)[interval])[j]); // *funitc[j];-> to method
1020 }
G4OrderedTable * fMatSandiaMatrixPAI
Here is the caller graph for this function:

◆ GetSandiaPerAtom()

G4double G4SandiaTable::GetSandiaPerAtom ( G4int  Z,
G4int  interval,
G4int  j 
)
private

Definition at line 938 of file G4SandiaTable.cc.

939 {
940  assert (Z>0 && Z<101 && interval>=0 && interval<fNbOfIntervals[Z]
941  && j>=0 && j<5);
942 
943  G4int row = fCumulInterval[Z-1] + interval;
944  G4double x = fSandiaTable[row][0]*CLHEP::keV;
945  if (j > 0) {
946  x = Z*CLHEP::amu/fZtoAratio[Z]*fSandiaTable[row][j]*funitc[j];
947  }
948  return x;
949 }
static const G4double funitc[5]
static const double amu
int G4int
Definition: G4Types.hh:78
static G4int fCumulInterval[101]
Float_t Z
static const G4int fNbOfIntervals[101]
double G4double
Definition: G4Types.hh:76
static const G4double fSandiaTable[981][5]
static const double keV
static const G4double fZtoAratio[101]
Here is the caller graph for this function:

◆ GetWaterCofForMaterial()

G4double G4SandiaTable::GetWaterCofForMaterial ( G4int  i,
G4int  j 
) const

Definition at line 196 of file G4SandiaTable.cc.

197 {
198  return fH2OlowerI1[i][j]*funitc[j];
199 }
static const G4double funitc[5]
static const G4double fH2OlowerI1[23][5]

◆ GetWaterEnergyLimit()

G4double G4SandiaTable::GetWaterEnergyLimit ( ) const

Definition at line 189 of file G4SandiaTable.cc.

190 {
191  return fH2OlowerI1[fH2OlowerInt - 1][0]*keV;
192 }
static const G4double fH2OlowerI1[23][5]
static const G4int fH2OlowerInt
static const double keV
Definition: G4SIunits.hh:213

◆ GetZtoA()

G4double G4SandiaTable::GetZtoA ( G4int  Z)
static

Definition at line 203 of file G4SandiaTable.cc.

204 {
205  assert (Z>0 && Z<101);
206  return fZtoAratio[Z];
207 }
Float_t Z
static const G4double fZtoAratio[101]
Here is the caller graph for this function:

◆ Initialize() [1/2]

void G4SandiaTable::Initialize ( G4Material mat)

Definition at line 662 of file G4SandiaTable.cc.

663 {
664  fMaterial = mat;
666 }
Float_t mat
void ComputeMatSandiaMatrixPAI()
G4Material * fMaterial
Here is the call graph for this function:

◆ Initialize() [2/2]

void G4SandiaTable::Initialize ( G4int  matIndex)

Definition at line 670 of file G4SandiaTable.cc.

671 {
672  const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable();
673  G4int numberOfMat = G4Material::GetNumberOfMaterials();
674 
675  if ( matIndex >= 0 && matIndex < numberOfMat )
676  {
677  fMaterial = (*theMaterialTable)[matIndex];
678  ComputeMatTable();
679  }
680  else
681  {
682  G4Exception("G4SandiaTable::Initialize(G4int matIndex)", "mat401",
683  FatalException, "wrong matIndex");
684  }
685 }
void ComputeMatTable()
static G4MaterialTable * GetMaterialTable()
Definition: G4Material.cc:589
std::vector< G4Material * > G4MaterialTable
int G4int
Definition: G4Types.hh:78
static size_t GetNumberOfMaterials()
Definition: G4Material.cc:596
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
G4Material * fMaterial
Here is the call graph for this function:

◆ operator=()

G4SandiaTable& G4SandiaTable::operator= ( const G4SandiaTable right)
private
Here is the caller graph for this function:

◆ SandiaIntervals()

G4int G4SandiaTable::SandiaIntervals ( G4int  Z[],
G4int  el 
)

Definition at line 742 of file G4SandiaTable.cc.

743 {
744  G4int c, i, flag = 0, n1 = 1;
745  G4int j, c1, k1, k2;
746  G4double I1;
747  fMaxInterval = 0;
748 
749  for( i = 0; i < el; ++i ) fMaxInterval += fNbOfIntervals[ Z[i] ];
750 
751  fMaxInterval += 2;
752 
753  if( fVerbose > 0 ) {
754  G4cout<<"begin sanInt, fMaxInterval = "<<fMaxInterval<<G4endl;
755  }
756 
758 
759  for( i = 0; i < fMaxInterval; ++i ) {
760  fPhotoAbsorptionCof[i] = new G4double[5];
761  }
762  // for(c = 0; c < fIntervalLimit; ++c) // just in case
763 
764  for( c = 0; c < fMaxInterval; ++c ) { fPhotoAbsorptionCof[c][0] = 0.; }
765 
766  c = 1;
767 
768  for( i = 0; i < el; ++i )
769  {
770  I1 = fIonizationPotentials[ Z[i] ]*keV; // First ionization
771  n1 = 1; // potential in keV
772 
773  for( j = 1; j < Z[i]; ++j ) n1 += fNbOfIntervals[j];
774 
775  G4int n2 = n1 + fNbOfIntervals[Z[i]];
776 
777  for( k1 = n1; k1 < n2; k1++ )
778  {
779  if( I1 > fSandiaTable[k1][0] )
780  {
781  continue; // no ionization for energies smaller than I1 (first
782  } // ionisation potential)
783  break;
784  }
785  flag = 0;
786 
787  for( c1 = 1; c1 < c; c1++ )
788  {
789  if( fPhotoAbsorptionCof[c1][0] == I1 ) // this value already has existed
790  {
791  flag = 1;
792  break;
793  }
794  }
795  if( flag == 0 )
796  {
797  fPhotoAbsorptionCof[c][0] = I1;
798  ++c;
799  }
800  for( k2 = k1; k2 < n2; k2++ )
801  {
802  flag = 0;
803 
804  for( c1 = 1; c1 < c; c1++ )
805  {
806  if( fPhotoAbsorptionCof[c1][0] == fSandiaTable[k2][0] )
807  {
808  flag = 1;
809  break;
810  }
811  }
812  if( flag == 0 )
813  {
814  fPhotoAbsorptionCof[c][0] = fSandiaTable[k2][0];
815  if( fVerbose > 0 ) {
816  G4cout<<"sanInt, c = "<<c<<", E_c = "<<fPhotoAbsorptionCof[c][0]
817  <<G4endl;
818  }
819  ++c;
820  }
821  }
822  } // end for(i)
823 
825  fMaxInterval = c;
826  if( fVerbose > 0 ) {
827  G4cout<<"end SanInt, fMaxInterval = "<<fMaxInterval<<G4endl;
828  }
829  return c;
830 }
G4double ** fPhotoAbsorptionCof
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
void SandiaSort(G4double **da, G4int sz)
Float_t Z
static const G4int fNbOfIntervals[101]
static const G4double fIonizationPotentials[101]
#define G4endl
Definition: G4ios.hh:61
static const double keV
Definition: G4SIunits.hh:213
double G4double
Definition: G4Types.hh:76
static const G4double fSandiaTable[981][5]
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SandiaMixing()

G4int G4SandiaTable::SandiaMixing ( G4int  Z[],
const G4double fractionW,
G4int  el,
G4int  mi 
)

Definition at line 838 of file G4SandiaTable.cc.

842 {
843  G4int i, j, n1, k, c=1, jj, kk;
844  G4double I1, B1, B2, E1, E2;
845 
846  for( i = 0; i < mi; ++i )
847  {
848  for( j = 1; j < 5; ++j ) fPhotoAbsorptionCof[i][j] = 0.;
849  }
850  for( i = 0; i < el; ++i )
851  {
852  n1 = 1;
853  I1 = fIonizationPotentials[Z[i]]*keV;
854 
855  for( j = 1; j < Z[i]; ++j ) n1 += fNbOfIntervals[j];
856 
857  G4int n2 = n1 + fNbOfIntervals[Z[i]] - 1;
858 
859  for( k = n1; k < n2; ++k )
860  {
861  B1 = fSandiaTable[k][0];
862  B2 = fSandiaTable[k+1][0];
863 
864  for( c = 1; c < mi-1; ++c )
865  {
866  E1 = fPhotoAbsorptionCof[c][0];
867  E2 = fPhotoAbsorptionCof[c+1][0];
868 
869  if( B1 > E1 || B2 < E2 || E1 < I1 ) continue;
870 
871  for( j = 1; j < 5; ++j )
872  {
873  fPhotoAbsorptionCof[c][j] += fSandiaTable[k][j]*fractionW[i];
874  if( fVerbose > 0 )
875  {
876  G4cout<<"c="<<c<<"; j="<<j<<"; fST="<<fSandiaTable[k][j]
877  <<"; frW="<<fractionW[i]<<G4endl;
878  }
879  }
880  }
881  }
882  for( j = 1; j < 5; ++j ) // Last interval
883  {
884  fPhotoAbsorptionCof[mi-1][j] += fSandiaTable[k][j]*fractionW[i];
885  if( fVerbose > 0 )
886  {
887  G4cout<<"mi-1="<<mi-1<<"; j="<<j<<"; fST="<<fSandiaTable[k][j]
888  <<"; frW="<<fractionW[i]<<G4endl;
889  }
890  }
891  } // for(i)
892  c = 0; // Deleting of first intervals where all coefficients = 0
893 
894  do
895  {
896  ++c;
897 
898  if( fPhotoAbsorptionCof[c][1] != 0.0 ||
899  fPhotoAbsorptionCof[c][2] != 0.0 ||
900  fPhotoAbsorptionCof[c][3] != 0.0 ||
901  fPhotoAbsorptionCof[c][4] != 0.0 ) continue;
902 
903  for( jj = 2; jj < mi; ++jj )
904  {
905  for( kk = 0; kk < 5; ++kk ) {
906  fPhotoAbsorptionCof[jj-1][kk] = fPhotoAbsorptionCof[jj][kk];
907  }
908  }
909  mi--;
910  c--;
911  }
912  // Loop checking, 07-Aug-2015, Vladimir Ivanchenko
913  while( c < mi - 1 );
914 
915  if( fVerbose > 0 ) G4cout<<"end SanMix, mi = "<<mi<<G4endl;
916 
917  return mi;
918 }
G4double ** fPhotoAbsorptionCof
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
Float_t Z
static const G4int fNbOfIntervals[101]
static const G4double fIonizationPotentials[101]
#define G4endl
Definition: G4ios.hh:61
static const double keV
Definition: G4SIunits.hh:213
double G4double
Definition: G4Types.hh:76
static const G4double fSandiaTable[981][5]
Here is the caller graph for this function:

◆ SandiaSort()

void G4SandiaTable::SandiaSort ( G4double **  da,
G4int  sz 
)

Definition at line 726 of file G4SandiaTable.cc.

727 {
728  for(G4int i = 1;i < sz; ++i )
729  {
730  for(G4int j = i + 1;j < sz; ++j )
731  {
732  if(da[i][0] > da[j][0]) SandiaSwap(da,i,j);
733  }
734  }
735 }
void SandiaSwap(G4double **da, G4int i, G4int j)
int G4int
Definition: G4Types.hh:78
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SandiaSwap()

void G4SandiaTable::SandiaSwap ( G4double **  da,
G4int  i,
G4int  j 
)

Definition at line 704 of file G4SandiaTable.cc.

707 {
708  G4double tmp = da[i][0] ;
709  da[i][0] = da[j][0] ;
710  da[j][0] = tmp ;
711 }
Float_t tmp
double G4double
Definition: G4Types.hh:76
Here is the caller graph for this function:

◆ SetLowerI1()

void G4SandiaTable::SetLowerI1 ( G4bool  flag)
inline

Definition at line 176 of file G4SandiaTable.hh.

176 {fLowerI1=flag;};
Here is the call graph for this function:

◆ SetVerbose()

void G4SandiaTable::SetVerbose ( G4int  ver)
inline

Definition at line 98 of file G4SandiaTable.hh.

98 { fVerbose = ver; };
Here is the call graph for this function:

Member Data Documentation

◆ fCumulInterval

G4int G4SandiaTable::fCumulInterval = {0}
staticprivate

Definition at line 132 of file G4SandiaTable.hh.

◆ fH2OlowerI1

const G4double G4SandiaTable::fH2OlowerI1
staticprivate

Definition at line 124 of file G4SandiaTable.hh.

◆ fH2OlowerInt

const G4int G4SandiaTable::fH2OlowerInt = 23
staticprivate

Definition at line 121 of file G4SandiaTable.hh.

◆ fIntervalLimit

const G4int G4SandiaTable::fIntervalLimit = 100
staticprivate

Definition at line 119 of file G4SandiaTable.hh.

◆ fIonizationPotentials

const G4double G4SandiaTable::fIonizationPotentials
staticprivate

Definition at line 127 of file G4SandiaTable.hh.

◆ fLowerI1

G4bool G4SandiaTable::fLowerI1
private

Definition at line 192 of file G4SandiaTable.hh.

◆ fMaterial

G4Material* G4SandiaTable::fMaterial
private

Definition at line 138 of file G4SandiaTable.hh.

◆ fMatNbOfIntervals

G4int G4SandiaTable::fMatNbOfIntervals
private

Definition at line 139 of file G4SandiaTable.hh.

◆ fMatSandiaMatrix

G4OrderedTable* G4SandiaTable::fMatSandiaMatrix
private

Definition at line 140 of file G4SandiaTable.hh.

◆ fMatSandiaMatrixPAI

G4OrderedTable* G4SandiaTable::fMatSandiaMatrixPAI
private

Definition at line 141 of file G4SandiaTable.hh.

◆ fMaxInterval

G4int G4SandiaTable::fMaxInterval
private

Definition at line 190 of file G4SandiaTable.hh.

◆ fNbOfIntervals

const G4int G4SandiaTable::fNbOfIntervals
staticprivate

Definition at line 125 of file G4SandiaTable.hh.

◆ fnulcof

const G4double G4SandiaTable::fnulcof = {0.0}
staticprivate

Definition at line 129 of file G4SandiaTable.hh.

◆ fNumberOfElements

const G4int G4SandiaTable::fNumberOfElements = 100
staticprivate

Definition at line 118 of file G4SandiaTable.hh.

◆ fNumberOfIntervals

const G4int G4SandiaTable::fNumberOfIntervals = 980
staticprivate

Definition at line 120 of file G4SandiaTable.hh.

◆ fPhotoAbsorptionCof

G4double** G4SandiaTable::fPhotoAbsorptionCof
private

Definition at line 188 of file G4SandiaTable.hh.

◆ fSandiaCofPerAtom

std::vector<G4double> G4SandiaTable::fSandiaCofPerAtom
private

Definition at line 135 of file G4SandiaTable.hh.

◆ fSandiaTable

const G4double G4SandiaTable::fSandiaTable
staticprivate

Definition at line 123 of file G4SandiaTable.hh.

◆ funitc

◆ fVerbose

G4int G4SandiaTable::fVerbose
private

Definition at line 191 of file G4SandiaTable.hh.

◆ fZtoAratio

const G4double G4SandiaTable::fZtoAratio
staticprivate

Definition at line 126 of file G4SandiaTable.hh.


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