86 for (
G4int Z=1; Z<101; ++Z) {
104 : fMaterial(0),fMatSandiaMatrix(0),
105 fMatSandiaMatrixPAI(0),fPhotoAbsorptionCof(0)
138 std::vector<G4double>& coeff)
const
140 assert(4 <= coeff.size());
146 if (energy <= Emin) {
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];
171 std::vector<G4double>& coeff)
const
173 assert(4 <= coeff.size());
182 coeff[1]=
funitc[2]*fH2OlowerI1[i][2];
183 coeff[2]=
funitc[3]*fH2OlowerI1[i][3];
184 coeff[3]=
funitc[4]*fH2OlowerI1[i][4];
205 assert (Z>0 && Z<101);
221 G4int MaxIntervals = 0;
224 for ( elm = 0; elm < NbElm; elm++ )
226 Z[elm] = (
G4int)(*ElementVector)[elm]->GetZ();
237 for ( elm = 0; elm < NbElm; elm++ )
258 for (
G4int i1 = 0; i1 < MaxIntervals; i1++ )
260 if (tmp1[i1] < Emin) Emin = tmp1[i1];
264 for (
G4int j1 = 0; j1 < MaxIntervals; j1++ )
266 if (tmp1[j1] <= Emin) tmp1[j1] =
DBL_MAX;
276 for (interval = 0; interval < interval2; interval++ )
286 G4double coef, oldsum(0.), newsum(0.);
289 for ( interval = 0; interval < interval2; interval++ )
293 for (
G4int k = 1; k < 5; ++k ) {
298 for ( elm = 0; elm < NbElm; elm++ )
302 for (
G4int j = 1; j < 5; ++j )
306 newsum += std::fabs(coef);
321 G4cout<<
"mma, G4SandiaTable::ComputeMatSandiaMatrix(), mat = "
341 G4int MaxIntervals = 0;
342 G4int elm, c, i, j, jj, k, k1, k2,
c1, n1;
347 std::vector<G4int> Z(noElm);
349 for ( elm = 0; elm < noElm; elm++ )
351 Z[elm] = (
G4int)(*ElementVector)[elm]->GetZ();
369 fPhotoAbsorptionCof0[c] = 0.;
370 fPhotoAbsorptionCof1[c] = 0.;
371 fPhotoAbsorptionCof2[c] = 0.;
372 fPhotoAbsorptionCof3[c] = 0.;
373 fPhotoAbsorptionCof4[c] = 0.;
377 for(i = 0; i < noElm; ++i)
386 for( k1 = n1; k1 < n2; k1++ )
396 for( c1 = 1; c1 < c; c1++ )
398 if( fPhotoAbsorptionCof0[c1] == I1 )
406 fPhotoAbsorptionCof0[c] = I1;
409 for( k2 = k1; k2 < n2; k2++ )
413 for( c1 = 1; c1 < c; c1++ )
430 for( i = 1; i < c; ++i )
432 for( j = i + 1; j < c; ++j )
434 if( fPhotoAbsorptionCof0[i] > fPhotoAbsorptionCof0[j] )
436 G4double tmp = fPhotoAbsorptionCof0[i];
437 fPhotoAbsorptionCof0[i] = fPhotoAbsorptionCof0[j];
438 fPhotoAbsorptionCof0[j] = tmp;
443 G4cout<<i<<
"\t energy = "<<fPhotoAbsorptionCof0[i]<<
G4endl;
452 for( i = 0; i < noElm; ++i )
456 for( i = 0; i < noElm; ++i )
465 for(k = n1; k < n2; ++k)
470 for(
G4int q = 1; q < fMaxInterval-1; q++)
472 G4double E1 = fPhotoAbsorptionCof0[q];
473 G4double E2 = fPhotoAbsorptionCof0[q+1];
477 G4cout<<
"k = "<<k<<
", q = "<<q<<
", B1 = "<<B1<<
", B2 = "<<B2
478 <<
", E1 = "<<E1<<
", E2 = "<<E2<<
G4endl;
480 if( B1 > E1 || B2 < E2 || E1 < I1 )
484 G4cout<<
"continue for: B1 = "<<B1<<
", B2 = "<<B2<<
", E1 = "
485 <<E1<<
", E2 = "<<E2<<
G4endl;
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];
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];
508 if( fPhotoAbsorptionCof1[c] != 0.0 ||
509 fPhotoAbsorptionCof2[c] != 0.0 ||
510 fPhotoAbsorptionCof3[c] != 0.0 ||
511 fPhotoAbsorptionCof4[c] != 0.0 )
continue;
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];
529 while( c < fMaxInterval - 1 );
531 if( fPhotoAbsorptionCof0[fMaxInterval-1] == 0.0 ) fMaxInterval--;
541 fPhotoAbsorptionCof0[i+1] *=
funitc[0];
559 (*(*fMatSandiaMatrixPAI)[i])[0] =
fH2OlowerI1[i][0];
560 (*(*fMatSandiaMatrixPAI)[i])[1] =
fH2OlowerI1[i][1];
561 (*(*fMatSandiaMatrixPAI)[i])[2] =
fH2OlowerI1[i][2];
562 (*(*fMatSandiaMatrixPAI)[i])[3] =
fH2OlowerI1[i][3];
563 (*(*fMatSandiaMatrixPAI)[i])[4] =
fH2OlowerI1[i][4];
567 (*(*fMatSandiaMatrixPAI)[i])[0] = fPhotoAbsorptionCof0[i+1-fH2OlowerInt];
568 (*(*fMatSandiaMatrixPAI)[i])[1] = fPhotoAbsorptionCof1[i+1-fH2OlowerInt];
569 (*(*fMatSandiaMatrixPAI)[i])[2] = fPhotoAbsorptionCof2[i+1-fH2OlowerInt];
570 (*(*fMatSandiaMatrixPAI)[i])[3] = fPhotoAbsorptionCof3[i+1-fH2OlowerInt];
571 (*(*fMatSandiaMatrixPAI)[i])[4] = fPhotoAbsorptionCof4[i+1-fH2OlowerInt];
583 (*(*fMatSandiaMatrixPAI)[i])[0] = fPhotoAbsorptionCof0[i+1];
584 (*(*fMatSandiaMatrixPAI)[i])[1] = fPhotoAbsorptionCof1[i+1];
585 (*(*fMatSandiaMatrixPAI)[i])[2] = fPhotoAbsorptionCof2[i+1];
586 (*(*fMatSandiaMatrixPAI)[i])[3] = fPhotoAbsorptionCof3[i+1];
587 (*(*fMatSandiaMatrixPAI)[i])[4] = fPhotoAbsorptionCof4[i+1];
595 G4cout<<
"vmg, G4SandiaTable::ComputeMatSandiaMatrixPAI(), mat = "
631 if ( matIndex >= 0 && matIndex < numberOfMat)
633 fMaterial = (*theMaterialTable)[matIndex];
638 G4Exception(
"G4SandiaTable::G4SandiaTable(G4int matIndex)",
"mat401",
675 if ( matIndex >= 0 && matIndex < numberOfMat )
677 fMaterial = (*theMaterialTable)[matIndex];
682 G4Exception(
"G4SandiaTable::Initialize(G4int matIndex)",
"mat401",
709 da[i][0] = da[j][0] ;
728 for(
G4int i = 1;i < sz; ++i )
730 for(
G4int j = i + 1;j < sz; ++j )
744 G4int c, i, flag = 0, n1 = 1;
768 for( i = 0; i < el; ++i )
777 for( k1 = n1; k1 < n2; k1++ )
787 for( c1 = 1; c1 < c; c1++ )
800 for( k2 = k1; k2 < n2; k2++ )
804 for( c1 = 1; c1 < c; c1++ )
827 G4cout<<
"end SanInt, fMaxInterval = "<<fMaxInterval<<
G4endl;
843 G4int i, j, n1, k, c=1, jj, kk;
846 for( i = 0; i < mi; ++i )
850 for( i = 0; i < el; ++i )
859 for( k = n1; k < n2; ++k )
864 for( c = 1; c < mi-1; ++c )
869 if( B1 > E1 || B2 < E2 || E1 < I1 )
continue;
871 for( j = 1; j < 5; ++j )
877 <<
"; frW="<<fractionW[i]<<
G4endl;
882 for( j = 1; j < 5; ++j )
888 <<
"; frW="<<fractionW[i]<<
G4endl;
903 for( jj = 2; jj < mi; ++jj )
905 for( kk = 0; kk < 5; ++kk ) {
931 assert (Z>0 && Z<101);
956 assert (interval>=0 && interval<fMatNbOfIntervals && j>=0 && j<5);
972 return &((*(*fMatSandiaMatrix)[interval])[1]);
980 assert(interval >= 0 && interval < fMaxInterval && j >= 0 && j < 5 );
990 interval<fMatNbOfIntervals && j>=0 && j<5);
1007 x = &((*(*fMatSandiaMatrixPAI)[interval])[1]);
1018 interval < fMaxInterval && j >= 0 && j < 5 );
1027 assert (Z>0 && Z<101);
1047 G4int MaxIntervals = 0;
1048 G4int elm, c, i, j, jj, k, kk, k1, k2,
c1, n1;
1054 for (elm = 0; elm<noElm; ++elm)
1056 Z[elm] = (
G4int)(*ElementVector)[elm]->GetZ();
1082 for(i = 0; i < noElm; ++i)
1087 for(j = 1; j < Z[i]; ++j)
1093 for(k1 = n1; k1 < n2; ++k1)
1103 for(c1 = 1; c1 < c; ++
c1)
1116 for(k2 = k1; k2 < n2; ++k2)
1120 for(c1 = 1; c1 < c; ++
c1)
1145 for(i = 0; i < noElm; ++i)
1150 for(j = 1; j < Z[i]; ++j)
1156 for(k = n1; k < n2; ++k)
1160 for(
G4int q = 1; q < fMaxInterval-1; q++)
1164 if(B1 > E1 || B2 < E2 || E1 < I1)
1168 for(j = 1; j < 5; ++j)
1174 for(j = 1; j < 5; ++j)
1194 for(kk = 0; kk < 5; ++kk)
1203 while( c < fMaxInterval - 1 );
1217 for( j = 0; j < 5; ++j )
1226 G4cout<<
"vmg, G4SandiaTable::ComputeMatTable(), mat = "
G4OrderedTable * fMatSandiaMatrixPAI
void SandiaSwap(G4double **da, G4int i, G4int j)
void ComputeMatSandiaMatrix()
G4double GetSandiaPerAtom(G4int Z, G4int, G4int)
std::vector< G4Element * > G4ElementVector
G4double GetSandiaCofForMaterial(G4int, G4int) const
static const G4double funitc[5]
const G4String & GetName() const
static G4MaterialTable * GetMaterialTable()
std::vector< G4Material * > G4MaterialTable
G4double GetDensity() const
G4int GetMaxInterval() const
G4double GetSandiaMatTablePAI(G4int, G4int) const
G4double ** fPhotoAbsorptionCof
static const G4double fH2OlowerI1[23][5]
const G4ElementVector * GetElementVector() const
G4double GetIonizationPot(G4int Z) const
static const G4double fnulcof[4]
static G4int fCumulInterval[101]
G4int SandiaMixing(G4int Z[], const G4double *fractionW, G4int el, G4int mi)
const G4double * GetVecNbOfAtomsPerVolume() const
G4GLOB_DLL std::ostream G4cout
void SandiaSort(G4double **da, G4int sz)
G4double GetWaterCofForMaterial(G4int, G4int) const
static size_t GetNumberOfMaterials()
G4int GetMatNbOfIntervals() const
G4int SandiaIntervals(G4int Z[], G4int el)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
static const G4int fNbOfIntervals[101]
void ComputeMatSandiaMatrixPAI()
T max(const T t1, const T t2)
brief Return the largest of the two arguments
G4OrderedTable * GetSandiaMatrixPAI()
G4double energy(const ThreeVector &p, const G4double m)
const G4double x[NPOINTSGL]
static G4double GetZtoA(G4int Z)
static const G4int fH2OlowerInt
G4double GetPhotoAbsorpCof(G4int i, G4int j) const
G4double GetSandiaCofForMaterialPAI(G4int, G4int) const
static const G4double fIonizationPotentials[101]
static const G4double Emin
G4double GetSandiaMatTable(G4int, G4int) const
size_t GetNumberOfElements() const
std::vector< G4double > fSandiaCofPerAtom
void GetSandiaCofWater(G4double energy, std::vector< G4double > &coeff) const
G4OrderedTable * fMatSandiaMatrix
G4double ** GetPointerToCof()
const G4double * GetFractionVector() const
static const G4double fSandiaTable[981][5]
void GetSandiaCofPerAtom(G4int Z, G4double energy, std::vector< G4double > &coeff) const
static const G4double fZtoAratio[101]
G4double GetWaterEnergyLimit() const
void Initialize(G4Material *)
G4int GetNbOfIntervals(G4int Z)