Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4SandiaTable Class Reference

#include <G4SandiaTable.hh>

Public Member Functions

 G4SandiaTable (G4Material *)
 
 ~G4SandiaTable ()
 
G4int GetMatNbOfIntervals ()
 
G4double GetSandiaCofForMaterial (G4int, G4int)
 
G4doubleGetSandiaCofForMaterial (G4double energy)
 
G4double GetSandiaMatTable (G4int, G4int)
 
G4double GetSandiaCofForMaterialPAI (G4int, G4int)
 
G4doubleGetSandiaCofForMaterialPAI (G4double energy)
 
G4double GetSandiaMatTablePAI (G4int, G4int)
 
G4OrderedTableGetSandiaMatrixPAI ()
 
void SetVerbose (G4int ver)
 
 G4SandiaTable (__void__ &)
 
 G4SandiaTable (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 ()
 

Static Public Member Functions

static G4doubleGetSandiaCofPerAtom (G4int Z, G4double energy)
 
static G4double GetZtoA (G4int Z)
 

Detailed Description

Definition at line 64 of file G4SandiaTable.hh.

Constructor & Destructor Documentation

◆ G4SandiaTable() [1/3]

G4SandiaTable::G4SandiaTable ( G4Material material)

Definition at line 63 of file G4SandiaTable.cc.

64 : fMaterial(material)
65{
66 fMatSandiaMatrix = 0;
67 fMatSandiaMatrixPAI = 0;
68 fPhotoAbsorptionCof = 0;
69
70 fMatNbOfIntervals = 0;
71
72
73 fMaxInterval = 0;
74 fVerbose = 0;
75
76 //build the CumulInterval array
77
78 fCumulInterval[0] = 1;
79
80 for (G4int Z=1; Z<101; ++Z) {
81 fCumulInterval[Z] = fCumulInterval[Z-1] + fNbOfIntervals[Z];
82 }
83
84 //initialisation of fnulcof
85 fnulcof[0] = fnulcof[1] = fnulcof[2] = fnulcof[3] = 0.;
86
87 fMaxInterval = 0;
88
89 //compute macroscopic Sandia coefs for a material
90 ComputeMatSandiaMatrix(); // mma
91
92 // ComputeMatTable(); // vmg
93}
int G4int
Definition: G4Types.hh:66

◆ ~G4SandiaTable()

G4SandiaTable::~G4SandiaTable ( )

Definition at line 111 of file G4SandiaTable.cc.

112{
113 if(fMatSandiaMatrix) {
114 fMatSandiaMatrix->clearAndDestroy();
115 delete fMatSandiaMatrix;
116 }
117 if(fMatSandiaMatrixPAI) {
118 fMatSandiaMatrixPAI->clearAndDestroy();
119 delete fMatSandiaMatrixPAI;
120 }
121 if(fPhotoAbsorptionCof)
122 {
123 delete [] fPhotoAbsorptionCof;
124 }
125}
void clearAndDestroy()

◆ G4SandiaTable() [2/3]

G4SandiaTable::G4SandiaTable ( __void__ &  )

Definition at line 100 of file G4SandiaTable.cc.

101 : fMaterial(0),fMatSandiaMatrix(0),fMatSandiaMatrixPAI(0),fPhotoAbsorptionCof(0)
102{
103 fnulcof[0] = fnulcof[1] = fnulcof[2] = fnulcof[3] = 0.;
104 fMaxInterval = 0;
105 fMatNbOfIntervals = 0;
106 fVerbose = 0;
107}

◆ G4SandiaTable() [3/3]

G4SandiaTable::G4SandiaTable ( G4int  matIndex)

Definition at line 523 of file G4SandiaTable.cc.

524{
525 fMaterial = 0;
526 fMatNbOfIntervals = 0;
527 fMatSandiaMatrix = 0;
528 fMatSandiaMatrixPAI = 0;
529 fPhotoAbsorptionCof = 0;
530
531
532 fMaxInterval = 0;
533 fVerbose = 0;
534
535 //initialisation of fnulcof
536 fnulcof[0] = fnulcof[1] = fnulcof[2] = fnulcof[3] = 0.;
537
538 const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable();
540
541 if ( matIndex >= 0 && matIndex < numberOfMat)
542 {
543 fMaterial = (*theMaterialTable)[matIndex];
544 ComputeMatTable();
545 }
546 else
547 {
548 G4Exception("G4SandiaTable::G4SandiaTable(G4int matIndex)", "mat401",
549 FatalException, "wrong matIndex");
550 }
551}
@ FatalException
std::vector< G4Material * > G4MaterialTable
static const G4MaterialTable * GetMaterialTable()
Definition: G4Material.cc:562
static size_t GetNumberOfMaterials()
Definition: G4Material.cc:569
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41

Member Function Documentation

◆ GetMatNbOfIntervals()

G4int G4SandiaTable::GetMatNbOfIntervals ( )

Definition at line 745 of file G4SandiaTable.cc.

746{
747 return fMatNbOfIntervals;
748}

◆ GetMaxInterval()

G4int G4SandiaTable::GetMaxInterval ( ) const
inline

Definition at line 189 of file G4SandiaTable.hh.

189 {
190 return fMaxInterval;
191}

Referenced by G4InitXscPAI::G4InitXscPAI(), G4PAIxSection::G4PAIxSection(), and G4PAIySection::Initialize().

◆ GetPhotoAbsorpCof()

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

Definition at line 211 of file G4SandiaTable.hh.

212{
213 return fPhotoAbsorptionCof[i][j]*funitc[j];
214}

Referenced by G4PAIModel::ComputeSandiaPhotoAbsCof(), G4PAIPhotonModel::ComputeSandiaPhotoAbsCof(), and G4PAIxSection::G4PAIxSection().

◆ GetPointerToCof()

G4double ** G4SandiaTable::GetPointerToCof ( )
inline

Definition at line 194 of file G4SandiaTable.hh.

195{
196 if(!fPhotoAbsorptionCof) { ComputeMatTable(); }
197 return fPhotoAbsorptionCof;
198}

◆ GetSandiaCofForMaterial() [1/2]

G4double * G4SandiaTable::GetSandiaCofForMaterial ( G4double  energy)

Definition at line 786 of file G4SandiaTable.cc.

787{
788 G4double* x = fnulcof;
789 if (energy >= (*(*fMatSandiaMatrix)[0])[0]) {
790
791 G4int interval = fMatNbOfIntervals - 1;
792 while ((interval>0)&&(energy<(*(*fMatSandiaMatrix)[interval])[0]))
793 {interval--;}
794 x = &((*(*fMatSandiaMatrix)[interval])[1]);
795 }
796 return x;
797}
double G4double
Definition: G4Types.hh:64

◆ GetSandiaCofForMaterial() [2/2]

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

Definition at line 777 of file G4SandiaTable.cc.

778{
779 assert (interval>=0 && interval<fMatNbOfIntervals && j>=0 && j<5);
780 return ((*(*fMatSandiaMatrix)[interval])[j]);
781}

Referenced by G4PEEffectFluoModel::CrossSectionPerVolume(), G4PEEffectModel::CrossSectionPerVolume(), G4VXTRenergyLoss::GetGasLinearPhotoAbs(), G4StrawTubeXTRadiator::GetMediumLinearPhotoAbs(), and G4VXTRenergyLoss::GetPlateLinearPhotoAbs().

◆ GetSandiaCofForMaterialPAI() [1/2]

G4double * G4SandiaTable::GetSandiaCofForMaterialPAI ( G4double  energy)

Definition at line 821 of file G4SandiaTable.cc.

822{
823 if(!fMatSandiaMatrixPAI) ComputeMatSandiaMatrixPAI();
824 G4double* x = fnulcof;
825 if (energy >= (*(*fMatSandiaMatrixPAI)[0])[0]) {
826
827 G4int interval = fMatNbOfIntervals - 1;
828 while ((interval>0)&&(energy<(*(*fMatSandiaMatrixPAI)[interval])[0]))
829 {interval--;}
830 x = &((*(*fMatSandiaMatrixPAI)[interval])[1]);
831 }
832 return x;
833}

◆ GetSandiaCofForMaterialPAI() [2/2]

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

Definition at line 811 of file G4SandiaTable.cc.

812{
813 assert (interval>=0 && interval<fMatNbOfIntervals && j>=0 && j<5);
814 if(!fMatSandiaMatrixPAI) ComputeMatSandiaMatrixPAI();
815 return ((*(*fMatSandiaMatrixPAI)[interval])[j]);
816}

Referenced by G4PAIModel::BuildPAIonisationTable().

◆ GetSandiaCofPerAtom()

G4double * G4SandiaTable::GetSandiaCofPerAtom ( G4int  Z,
G4double  energy 
)
static

Definition at line 130 of file G4SandiaTable.cc.

131{
132 G4double Emin = fSandiaTable[fCumulInterval[Z-1]][0]*keV;
133 G4double Iopot = fIonizationPotentials[Z]*eV;
134 if (Iopot > Emin) Emin = Iopot;
135
136 G4int interval = fNbOfIntervals[Z] - 1;
137 G4int row = fCumulInterval[Z-1] + interval;
138 while ((interval>0) && (energy<fSandiaTable[row][0]*keV)) {
139 --interval;
140 row = fCumulInterval[Z-1] + interval;
141 }
142 if (energy >= Emin)
143 {
144 G4double AoverAvo = Z*amu/fZtoAratio[Z];
145
146 fSandiaCofPerAtom[0]=AoverAvo*funitc[1]*fSandiaTable[row][1];
147 fSandiaCofPerAtom[1]=AoverAvo*funitc[2]*fSandiaTable[row][2];
148 fSandiaCofPerAtom[2]=AoverAvo*funitc[3]*fSandiaTable[row][3];
149 fSandiaCofPerAtom[3]=AoverAvo*funitc[4]*fSandiaTable[row][4];
150 }
151 else
152 {
153 fSandiaCofPerAtom[0] = fSandiaCofPerAtom[1] = fSandiaCofPerAtom[2] =
154 fSandiaCofPerAtom[3] = 0.;
155 }
156 return fSandiaCofPerAtom;
157}

Referenced by G4PEEffectFluoModel::ComputeCrossSectionPerAtom(), and G4PEEffectModel::ComputeCrossSectionPerAtom().

◆ GetSandiaMatrixPAI()

G4OrderedTable * G4SandiaTable::GetSandiaMatrixPAI ( )

Definition at line 857 of file G4SandiaTable.cc.

858{
859 if(!fMatSandiaMatrixPAI) { ComputeMatSandiaMatrixPAI(); }
860 return fMatSandiaMatrixPAI;
861}

◆ GetSandiaMatTable()

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

Definition at line 802 of file G4SandiaTable.cc.

803{
804 assert (interval >= 0 && interval < fMaxInterval && j >= 0 && j < 5 );
805 return ((*(*fMatSandiaMatrix)[interval])[j])*funitc[j];
806}

Referenced by G4InitXscPAI::G4InitXscPAI(), and G4PAIxSection::G4PAIxSection().

◆ GetSandiaMatTablePAI()

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

Definition at line 838 of file G4SandiaTable.cc.

839{
840 assert (interval >= 0 && interval < fMaxInterval && j >= 0 && j < 5 );
841 if(!fMatSandiaMatrixPAI) { ComputeMatSandiaMatrixPAI(); }
842 return ((*(*fMatSandiaMatrixPAI)[interval])[j])*funitc[j];
843}

Referenced by G4PAIySection::Initialize().

◆ GetZtoA()

G4double G4SandiaTable::GetZtoA ( G4int  Z)
static

Definition at line 161 of file G4SandiaTable.cc.

162{
163 assert (Z>0 && Z<101);
164 return fZtoAratio[Z];
165}

Referenced by G4NeutronHPNames::GetName().

◆ SandiaIntervals()

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

Definition at line 577 of file G4SandiaTable.cc.

579{
580 G4int c, i, flag = 0, n1 = 1;
581 G4int j, c1, k1, k2;
582 G4double I1;
583 fMaxInterval = 0;
584
585 for( i = 0; i < el; i++ ) fMaxInterval += fNbOfIntervals[ Z[i] ];
586
587 fMaxInterval += 2;
588
589 if( fVerbose > 0 ) G4cout<<"begin sanInt, fMaxInterval = "<<fMaxInterval<<G4endl;
590
591 fPhotoAbsorptionCof = new G4double* [fMaxInterval];
592
593 for( i = 0; i < fMaxInterval; i++ ) fPhotoAbsorptionCof[i] = new G4double[5];
594
595 // for(c = 0; c < fIntervalLimit; c++) // just in case
596
597 for( c = 0; c < fMaxInterval; c++ ) fPhotoAbsorptionCof[c][0] = 0.;
598
599 c = 1;
600
601 for( i = 0; i < el; i++ )
602 {
603 I1 = fIonizationPotentials[ Z[i] ]*keV; // First ionization
604 n1 = 1; // potential in keV
605
606 for( j = 1; j < Z[i]; j++ ) n1 += fNbOfIntervals[j];
607
608 G4int n2 = n1 + fNbOfIntervals[Z[i]];
609
610 for( k1 = n1; k1 < n2; k1++ )
611 {
612 if( I1 > fSandiaTable[k1][0] )
613 {
614 continue; // no ionization for energies smaller than I1 (first
615 } // ionisation potential)
616 break;
617 }
618 flag = 0;
619
620 for( c1 = 1; c1 < c; c1++ )
621 {
622 if( fPhotoAbsorptionCof[c1][0] == I1 ) // this value already has existed
623 {
624 flag = 1;
625 break;
626 }
627 }
628 if( flag == 0 )
629 {
630 fPhotoAbsorptionCof[c][0] = I1;
631 c++;
632 }
633 for( k2 = k1; k2 < n2; k2++ )
634 {
635 flag = 0;
636
637 for( c1 = 1; c1 < c; c1++ )
638 {
639 if( fPhotoAbsorptionCof[c1][0] == fSandiaTable[k2][0] )
640 {
641 flag = 1;
642 break;
643 }
644 }
645 if( flag == 0 )
646 {
647 fPhotoAbsorptionCof[c][0] = fSandiaTable[k2][0];
648 if( fVerbose > 0 ) G4cout<<"sanInt, c = "<<c<<", E_c = "<<fPhotoAbsorptionCof[c][0]<<G4endl;
649 c++;
650 }
651 }
652 } // end for(i)
653
654 SandiaSort(fPhotoAbsorptionCof,c);
655 fMaxInterval = c;
656 if( fVerbose > 0 ) G4cout<<"end SanInt, fMaxInterval = "<<fMaxInterval<<G4endl;
657 return c;
658}
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
void SandiaSort(G4double **da, G4int sz)

Referenced by G4PAIModel::ComputeSandiaPhotoAbsCof(), G4PAIPhotonModel::ComputeSandiaPhotoAbsCof(), and G4PAIxSection::G4PAIxSection().

◆ SandiaMixing()

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

Definition at line 666 of file G4SandiaTable.cc.

670{
671 G4int i, j, n1, k, c=1, jj, kk;
672 G4double I1, B1, B2, E1, E2;
673
674 for( i = 0; i < mi; i++ )
675 {
676 for( j = 1; j < 5; j++ ) fPhotoAbsorptionCof[i][j] = 0.;
677 }
678 for( i = 0; i < el; i++ )
679 {
680 n1 = 1;
681 I1 = fIonizationPotentials[Z[i]]*keV;
682
683 for( j = 1; j < Z[i]; j++ ) n1 += fNbOfIntervals[j];
684
685 G4int n2 = n1 + fNbOfIntervals[Z[i]] - 1;
686
687 for( k = n1; k < n2; k++ )
688 {
689 B1 = fSandiaTable[k][0];
690 B2 = fSandiaTable[k+1][0];
691
692 for( c = 1; c < mi-1; c++ )
693 {
694 E1 = fPhotoAbsorptionCof[c][0];
695 E2 = fPhotoAbsorptionCof[c+1][0];
696
697 if( B1 > E1 || B2 < E2 || E1 < I1 ) continue;
698
699 for( j = 1; j < 5; j++ )
700 {
701 fPhotoAbsorptionCof[c][j] += fSandiaTable[k][j]*fractionW[i];
702 if( fVerbose > 0 )
703 {
704 G4cout<<"c="<<c<<"; j="<<j<<"; fST="<<fSandiaTable[k][j]<<"; frW="<<fractionW[i]<<G4endl;
705 }
706 }
707 }
708 }
709 for( j = 1; j < 5; j++ ) // Last interval
710 {
711 fPhotoAbsorptionCof[mi-1][j] += fSandiaTable[k][j]*fractionW[i];
712 if( fVerbose > 0 )
713 {
714 G4cout<<"mi-1="<<mi-1<<"; j="<<j<<"; fST="<<fSandiaTable[k][j]<<"; frW="<<fractionW[i]<<G4endl;
715 }
716 }
717 } // for(i)
718 c = 0; // Deleting of first intervals where all coefficients = 0
719
720 do
721 {
722 c++;
723
724 if( fPhotoAbsorptionCof[c][1] != 0.0 ||
725 fPhotoAbsorptionCof[c][2] != 0.0 ||
726 fPhotoAbsorptionCof[c][3] != 0.0 ||
727 fPhotoAbsorptionCof[c][4] != 0.0 ) continue;
728
729 for( jj = 2; jj < mi; jj++ )
730 {
731 for( kk = 0; kk < 5; kk++ ) fPhotoAbsorptionCof[jj-1][kk] = fPhotoAbsorptionCof[jj][kk];
732 }
733 mi--;
734 c--;
735 }
736 while( c < mi - 1 );
737
738 if( fVerbose > 0 ) G4cout<<"end SanMix, mi = "<<mi<<G4endl;
739
740 return mi;
741}

Referenced by G4PAIModel::ComputeSandiaPhotoAbsCof(), G4PAIPhotonModel::ComputeSandiaPhotoAbsCof(), and G4PAIxSection::G4PAIxSection().

◆ SandiaSort()

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

Definition at line 559 of file G4SandiaTable.cc.

561{
562 for(G4int i = 1;i < sz; i++ )
563 {
564 for(G4int j = i + 1;j < sz; j++ )
565 {
566 if(da[i][0] > da[j][0]) SandiaSwap(da,i,j);
567 }
568 }
569}
void SandiaSwap(G4double **da, G4int i, G4int j)

Referenced by SandiaIntervals().

◆ SandiaSwap()

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

Definition at line 201 of file G4SandiaTable.hh.

204{
205 G4double tmp = da[i][0] ;
206 da[i][0] = da[j][0] ;
207 da[j][0] = tmp ;
208}

Referenced by SandiaSort().

◆ SetVerbose()

void G4SandiaTable::SetVerbose ( G4int  ver)
inline

Definition at line 87 of file G4SandiaTable.hh.

87{fVerbose = ver;};

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