Geant4 10.7.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 (const 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 GetSandiaMatTablePAI (G4int, G4int) const
 
const G4doubleGetSandiaCofForMaterialPAI (G4double energy) const
 
void SetVerbose (G4int ver)
 
 G4SandiaTable (__void__ &)
 
 G4SandiaTable (G4int matIndex)
 
 G4SandiaTable ()
 
void Initialize (const G4Material *)
 
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
 
G4bool GetLowerI1 ()
 
void SetLowerI1 (G4bool flag)
 

Static Public Member Functions

static G4double GetZtoA (G4int Z)
 

Detailed Description

Definition at line 63 of file G4SandiaTable.hh.

Constructor & Destructor Documentation

◆ G4SandiaTable() [1/4]

G4SandiaTable::G4SandiaTable ( const G4Material material)

Definition at line 65 of file G4SandiaTable.cc.

66 : fMaterial(material)
67{
68 fMatSandiaMatrix = nullptr;
69 fMatSandiaMatrixPAI = nullptr;
70 fPhotoAbsorptionCof = nullptr;
71
72 fMatNbOfIntervals = 0;
73
74 fMaxInterval = 0;
75 fVerbose = 0;
76
77 //build the CumulInterval array
78 if(0 == fCumulInterval[0]) {
79 fCumulInterval[0] = 1;
80
81 for (G4int Z=1; Z<101; ++Z) {
82 fCumulInterval[Z] = fCumulInterval[Z-1] + fNbOfIntervals[Z];
83 }
84 }
85
86 fMaxInterval = 0;
87 fSandiaCofPerAtom.resize(4,0.0);
88 fLowerI1 = false;
89 //compute macroscopic Sandia coefs for a material
90 ComputeMatSandiaMatrix(); // mma
91}
int G4int
Definition: G4Types.hh:85

◆ ~G4SandiaTable()

G4SandiaTable::~G4SandiaTable ( )

Definition at line 111 of file G4SandiaTable.cc.

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

◆ G4SandiaTable() [2/4]

G4SandiaTable::G4SandiaTable ( __void__ &  )

Definition at line 98 of file G4SandiaTable.cc.

99 : fMaterial(nullptr),fMatSandiaMatrix(nullptr),
100 fMatSandiaMatrixPAI(nullptr),fPhotoAbsorptionCof(nullptr)
101{
102 fMaxInterval = 0;
103 fMatNbOfIntervals = 0;
104 fLowerI1 = false;
105 fVerbose = 0;
106 fSandiaCofPerAtom.resize(4,0.0);
107}

◆ G4SandiaTable() [3/4]

G4SandiaTable::G4SandiaTable ( G4int  matIndex)

Definition at line 658 of file G4SandiaTable.cc.

659{
660 fMaterial = nullptr;
661 fMatNbOfIntervals = 0;
662 fMatSandiaMatrix = 0;
663 fMatSandiaMatrixPAI = 0;
664 fPhotoAbsorptionCof = 0;
665
666 fMaxInterval = 0;
667 fVerbose = 0;
668 fLowerI1 = false;
669
670 fSandiaCofPerAtom.resize(4,0.0);
671
672 const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable();
674
675 if ( matIndex >= 0 && matIndex < numberOfMat)
676 {
677 fMaterial = (*theMaterialTable)[matIndex];
678 }
679 else
680 {
681 G4Exception("G4SandiaTable::G4SandiaTable(G4int matIndex)", "mat401",
682 FatalException, "wrong matIndex");
683 }
684}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
std::vector< G4Material * > G4MaterialTable
static size_t GetNumberOfMaterials()
Definition: G4Material.cc:644
static G4MaterialTable * GetMaterialTable()
Definition: G4Material.cc:637

◆ G4SandiaTable() [4/4]

G4SandiaTable::G4SandiaTable ( )

Definition at line 688 of file G4SandiaTable.cc.

689{
690 fMaterial = nullptr;
691 fMatNbOfIntervals = 0;
692 fMatSandiaMatrix = 0;
693 fMatSandiaMatrixPAI = 0;
694 fPhotoAbsorptionCof = 0;
695
696 fMaxInterval = 0;
697 fVerbose = 0;
698 fLowerI1 = false;
699
700 fSandiaCofPerAtom.resize(4,0.0);
701}

Member Function Documentation

◆ GetLowerI1()

G4bool G4SandiaTable::GetLowerI1 ( )
inline

Definition at line 150 of file G4SandiaTable.hh.

150{return fLowerI1;};

Referenced by G4PAIxSection::Initialize().

◆ GetMatNbOfIntervals()

G4int G4SandiaTable::GetMatNbOfIntervals ( ) const

Definition at line 946 of file G4SandiaTable.cc.

947{
948 return fMatNbOfIntervals;
949}

◆ GetMaxInterval()

G4int G4SandiaTable::GetMaxInterval ( ) const

Definition at line 713 of file G4SandiaTable.cc.

714{
715 return fMaxInterval;
716}

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

◆ GetPhotoAbsorpCof()

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

Definition at line 739 of file G4SandiaTable.cc.

740{
741 return fPhotoAbsorptionCof[i][j]*funitc[j];
742}

Referenced by G4PAIxSection::G4PAIxSection().

◆ GetSandiaCofForMaterial() [1/2]

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

Definition at line 998 of file G4SandiaTable.cc.

999{
1000 G4int interval = 0;
1001 if (energy > (*(*fMatSandiaMatrix)[0])[0]) {
1002 interval = fMatNbOfIntervals - 1;
1003 // Loop checking, 07-Aug-2015, Vladimir Ivanchenko
1004 while ((interval>0)&&(energy<(*(*fMatSandiaMatrix)[interval])[0]))
1005 { --interval; }
1006 }
1007 return &((*(*fMatSandiaMatrix)[interval])[1]);
1008}

◆ GetSandiaCofForMaterial() [2/2]

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

Definition at line 980 of file G4SandiaTable.cc.

981{
982#ifdef G4VERBOSE
983 if(interval<0 || interval>=fMatNbOfIntervals) {
984 PrintErrorV("GetSandiaCofForMaterial");
985 interval = (interval<0) ? 0 : fMatNbOfIntervals-1;
986 }
987 if(j<0 || j>4) {
988 PrintErrorV("GetSandiaCofForMaterial");
989 j = (j<0) ? 0 : 4;
990 }
991#endif
992 return ((*(*fMatSandiaMatrix)[interval])[j]);
993}

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

◆ GetSandiaCofForMaterialPAI()

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

◆ GetSandiaCofPerAtom()

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

Definition at line 132 of file G4SandiaTable.cc.

134{
135#ifdef G4VERBOSE
136 if(Z < 1 || Z > 100) {
137 Z = PrintErrorZ(Z, "GetSandiaCofPerAtom");
138 }
139 if(4 > coeff.size()) {
140 PrintErrorV("GetSandiaCofPerAtom(): input vector is resized");
141 coeff.resize(4);
142 }
143#endif
144 G4double Emin = fSandiaTable[fCumulInterval[Z-1]][0]*CLHEP::keV;
145 //G4double Iopot = fIonizationPotentials[Z]*eV;
146 //if (Emin < Iopot) Emin = Iopot;
147
148 G4int row = 0;
149 if (energy <= Emin) {
150 energy = Emin;
151
152 } else {
153 G4int interval = fNbOfIntervals[Z] - 1;
154 row = fCumulInterval[Z-1] + interval;
155 // Loop checking, 07-Aug-2015, Vladimir Ivanchenko
156 while ((interval>0) && (energy<fSandiaTable[row][0]*CLHEP::keV)) {
157 --interval;
158 row = fCumulInterval[Z-1] + interval;
159 }
160 }
161
162 G4double AoverAvo = Z*amu/fZtoAratio[Z];
163
164 coeff[0]=AoverAvo*funitc[1]*fSandiaTable[row][1];
165 coeff[1]=AoverAvo*funitc[2]*fSandiaTable[row][2];
166 coeff[2]=AoverAvo*funitc[3]*fSandiaTable[row][3];
167 coeff[3]=AoverAvo*funitc[4]*fSandiaTable[row][4];
168}
double G4double
Definition: G4Types.hh:83
G4double energy(const ThreeVector &p, const G4double m)

Referenced by G4PEEffectFluoModel::ComputeCrossSectionPerAtom().

◆ GetSandiaCofWater()

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

Definition at line 173 of file G4SandiaTable.cc.

175{
176#ifdef G4VERBOSE
177 if(4 > coeff.size()) {
178 PrintErrorV("GetSandiaCofWater: input vector is resized");
179 coeff.resize(4);
180 }
181#endif
182 G4int i = 0;
183 if(energy > fH2OlowerI1[0][0]*CLHEP::keV) {
184 i = fH2OlowerInt - 1;
185 for(; i>0; --i) {
186 if(energy >= fH2OlowerI1[i][0]*CLHEP::keV) { break; }
187 }
188 }
189 coeff[0]=funitc[1]*fH2OlowerI1[i][1];
190 coeff[1]=funitc[2]*fH2OlowerI1[i][2];
191 coeff[2]=funitc[3]*fH2OlowerI1[i][3];
192 coeff[3]=funitc[4]*fH2OlowerI1[i][4];
193}

Referenced by G4LivermorePhotoElectricModel::CrossSectionPerVolume(), and G4LivermorePolarizedPhotoElectricModel::CrossSectionPerVolume().

◆ GetSandiaMatTable()

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

Definition at line 1013 of file G4SandiaTable.cc.

1014{
1015#ifdef G4VERBOSE
1016 if(interval<0 || interval>=fMatNbOfIntervals) {
1017 PrintErrorV("GetSandiaCofForMaterial");
1018 interval = (interval<0) ? 0 : fMatNbOfIntervals-1;
1019 }
1020 if(j<0 || j>4) {
1021 PrintErrorV("GetSandiaCofForMaterial");
1022 j = (j<0) ? 0 : 4;
1023 }
1024#endif
1025 return ((*(*fMatSandiaMatrix)[interval])[j])*funitc[j];
1026}

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

◆ GetSandiaMatTablePAI()

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

Definition at line 1031 of file G4SandiaTable.cc.

1032{
1033#ifdef G4VERBOSE
1034 if(interval<0 || interval>=fMaxInterval) {
1035 PrintErrorV("GetSandiaCofForMaterialPAI");
1036 interval = (interval<0) ? 0 : fMaxInterval-1;
1037 }
1038 if(j<0 || j>4) {
1039 PrintErrorV("GetSandiaCofForMaterialPAI");
1040 j = (j<0) ? 0 : 4;
1041 }
1042#endif
1043 return ((*(*fMatSandiaMatrixPAI)[interval])[j]);
1044}

Referenced by G4PAIPhotData::Initialise(), G4PAIModelData::Initialise(), G4PAIxSection::Initialize(), and G4PAIySection::Initialize().

◆ GetWaterCofForMaterial()

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

Definition at line 204 of file G4SandiaTable.cc.

205{
206 return fH2OlowerI1[i][j]*funitc[j];
207}

◆ GetWaterEnergyLimit()

G4double G4SandiaTable::GetWaterEnergyLimit ( ) const

Definition at line 197 of file G4SandiaTable.cc.

198{
199 return fH2OlowerI1[fH2OlowerInt - 1][0]*CLHEP::keV;
200}

◆ GetZtoA()

G4double G4SandiaTable::GetZtoA ( G4int  Z)
static

Definition at line 211 of file G4SandiaTable.cc.

212{
213#ifdef G4VERBOSE
214 if(Z < 1 || Z > 100) {
215 Z = PrintErrorZ(Z, "GetSandiaCofPerAtom");
216 }
217#endif
218 return fZtoAratio[Z];
219}

Referenced by G4ParticleHPNames::GetName().

◆ Initialize()

void G4SandiaTable::Initialize ( const G4Material mat)

Definition at line 705 of file G4SandiaTable.cc.

706{
707 fMaterial = mat;
708 ComputeMatSandiaMatrixPAI();
709}

Referenced by G4PAIPhotData::Initialise(), and G4PAIModelData::Initialise().

◆ SandiaIntervals()

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

Definition at line 766 of file G4SandiaTable.cc.

767{
768 G4int c, i, flag = 0, n1 = 1;
769 G4int j, c1, k1, k2;
770 G4double I1;
771 fMaxInterval = 0;
772
773 for( i = 0; i < el; ++i ) fMaxInterval += fNbOfIntervals[ Z[i] ];
774
775 fMaxInterval += 2;
776
777 if( fVerbose > 0 ) {
778 G4cout<<"begin sanInt, fMaxInterval = "<<fMaxInterval<<G4endl;
779 }
780
781 fPhotoAbsorptionCof = new G4double* [fMaxInterval];
782
783 for( i = 0; i < fMaxInterval; ++i ) {
784 fPhotoAbsorptionCof[i] = new G4double[5];
785 }
786 // for(c = 0; c < fIntervalLimit; ++c) // just in case
787
788 for( c = 0; c < fMaxInterval; ++c ) { fPhotoAbsorptionCof[c][0] = 0.; }
789
790 c = 1;
791
792 for( i = 0; i < el; ++i )
793 {
794 I1 = fIonizationPotentials[ Z[i] ]*keV; // First ionization
795 n1 = 1; // potential in keV
796
797 for( j = 1; j < Z[i]; ++j ) n1 += fNbOfIntervals[j];
798
799 G4int n2 = n1 + fNbOfIntervals[Z[i]];
800
801 for( k1 = n1; k1 < n2; k1++ )
802 {
803 if( I1 > fSandiaTable[k1][0] )
804 {
805 continue; // no ionization for energies smaller than I1 (first
806 } // ionisation potential)
807 break;
808 }
809 flag = 0;
810
811 for( c1 = 1; c1 < c; c1++ )
812 {
813 if( fPhotoAbsorptionCof[c1][0] == I1 ) // this value already has existed
814 {
815 flag = 1;
816 break;
817 }
818 }
819 if( flag == 0 )
820 {
821 fPhotoAbsorptionCof[c][0] = I1;
822 ++c;
823 }
824 for( k2 = k1; k2 < n2; k2++ )
825 {
826 flag = 0;
827
828 for( c1 = 1; c1 < c; c1++ )
829 {
830 if( fPhotoAbsorptionCof[c1][0] == fSandiaTable[k2][0] )
831 {
832 flag = 1;
833 break;
834 }
835 }
836 if( flag == 0 )
837 {
838 fPhotoAbsorptionCof[c][0] = fSandiaTable[k2][0];
839 if( fVerbose > 0 ) {
840 G4cout<<"sanInt, c = "<<c<<", E_c = "<<fPhotoAbsorptionCof[c][0]
841 <<G4endl;
842 }
843 ++c;
844 }
845 }
846 } // end for(i)
847
848 SandiaSort(fPhotoAbsorptionCof,c);
849 fMaxInterval = c;
850 if( fVerbose > 0 ) {
851 G4cout<<"end SanInt, fMaxInterval = "<<fMaxInterval<<G4endl;
852 }
853 return c;
854}
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout

Referenced by G4PAIxSection::G4PAIxSection().

◆ SandiaMixing()

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

Definition at line 862 of file G4SandiaTable.cc.

866{
867 G4int i, j, n1, k, c=1, jj, kk;
868 G4double I1, B1, B2, E1, E2;
869
870 for( i = 0; i < mi; ++i )
871 {
872 for( j = 1; j < 5; ++j ) fPhotoAbsorptionCof[i][j] = 0.;
873 }
874 for( i = 0; i < el; ++i )
875 {
876 n1 = 1;
877 I1 = fIonizationPotentials[Z[i]]*keV;
878
879 for( j = 1; j < Z[i]; ++j ) n1 += fNbOfIntervals[j];
880
881 G4int n2 = n1 + fNbOfIntervals[Z[i]] - 1;
882
883 for( k = n1; k < n2; ++k )
884 {
885 B1 = fSandiaTable[k][0];
886 B2 = fSandiaTable[k+1][0];
887
888 for( c = 1; c < mi-1; ++c )
889 {
890 E1 = fPhotoAbsorptionCof[c][0];
891 E2 = fPhotoAbsorptionCof[c+1][0];
892
893 if( B1 > E1 || B2 < E2 || E1 < I1 ) continue;
894
895 for( j = 1; j < 5; ++j )
896 {
897 fPhotoAbsorptionCof[c][j] += fSandiaTable[k][j]*fractionW[i];
898 if( fVerbose > 0 )
899 {
900 G4cout<<"c="<<c<<"; j="<<j<<"; fST="<<fSandiaTable[k][j]
901 <<"; frW="<<fractionW[i]<<G4endl;
902 }
903 }
904 }
905 }
906 for( j = 1; j < 5; ++j ) // Last interval
907 {
908 fPhotoAbsorptionCof[mi-1][j] += fSandiaTable[k][j]*fractionW[i];
909 if( fVerbose > 0 )
910 {
911 G4cout<<"mi-1="<<mi-1<<"; j="<<j<<"; fST="<<fSandiaTable[k][j]
912 <<"; frW="<<fractionW[i]<<G4endl;
913 }
914 }
915 } // for(i)
916 c = 0; // Deleting of first intervals where all coefficients = 0
917
918 do
919 {
920 ++c;
921
922 if( fPhotoAbsorptionCof[c][1] != 0.0 ||
923 fPhotoAbsorptionCof[c][2] != 0.0 ||
924 fPhotoAbsorptionCof[c][3] != 0.0 ||
925 fPhotoAbsorptionCof[c][4] != 0.0 ) continue;
926
927 for( jj = 2; jj < mi; ++jj )
928 {
929 for( kk = 0; kk < 5; ++kk ) {
930 fPhotoAbsorptionCof[jj-1][kk] = fPhotoAbsorptionCof[jj][kk];
931 }
932 }
933 mi--;
934 c--;
935 }
936 // Loop checking, 07-Aug-2015, Vladimir Ivanchenko
937 while( c < mi - 1 );
938
939 if( fVerbose > 0 ) G4cout<<"end SanMix, mi = "<<mi<<G4endl;
940
941 return mi;
942}

Referenced by G4PAIxSection::G4PAIxSection().

◆ SetLowerI1()

void G4SandiaTable::SetLowerI1 ( G4bool  flag)
inline

Definition at line 151 of file G4SandiaTable.hh.

151{fLowerI1=flag;};

◆ SetVerbose()

void G4SandiaTable::SetVerbose ( G4int  ver)
inline

Definition at line 92 of file G4SandiaTable.hh.

92{ fVerbose = ver; };

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