Geant4 11.1.1
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)
 
G4bool operator== (const G4SandiaTable &) const =delete
 
G4bool operator!= (const G4SandiaTable &) const =delete
 
 G4SandiaTable (G4SandiaTable &)=delete
 
G4SandiaTableoperator= (const G4SandiaTable &right)=delete
 

Static Public Member Functions

static G4double GetZtoA (G4int Z)
 

Detailed Description

Definition at line 63 of file G4SandiaTable.hh.

Constructor & Destructor Documentation

◆ G4SandiaTable() [1/5]

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
const G4int Z[17]

◆ ~G4SandiaTable()

G4SandiaTable::~G4SandiaTable ( )

Definition at line 111 of file G4SandiaTable.cc.

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

◆ G4SandiaTable() [2/5]

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/5]

G4SandiaTable::G4SandiaTable ( G4int  matIndex)

Definition at line 668 of file G4SandiaTable.cc.

669{
670 fMaterial = nullptr;
671 fMatNbOfIntervals = 0;
672 fMatSandiaMatrix = nullptr;
673 fMatSandiaMatrixPAI = nullptr;
674 fPhotoAbsorptionCof = nullptr;
675
676 fMaxInterval = 0;
677 fVerbose = 0;
678 fLowerI1 = false;
679
680 fSandiaCofPerAtom.resize(4,0.0);
681
682 const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable();
684
685 if ( matIndex >= 0 && matIndex < numberOfMat)
686 {
687 fMaterial = (*theMaterialTable)[matIndex];
688 }
689 else
690 {
691 G4Exception("G4SandiaTable::G4SandiaTable(G4int matIndex)", "mat401",
692 FatalException, "wrong matIndex");
693 }
694}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:59
std::vector< G4Material * > G4MaterialTable
static size_t GetNumberOfMaterials()
Definition: G4Material.cc:684
static G4MaterialTable * GetMaterialTable()
Definition: G4Material.cc:677

◆ G4SandiaTable() [4/5]

G4SandiaTable::G4SandiaTable ( )

Definition at line 698 of file G4SandiaTable.cc.

699{
700 fMaterial = nullptr;
701 fMatNbOfIntervals = 0;
702 fMatSandiaMatrix = nullptr;
703 fMatSandiaMatrixPAI = nullptr;
704 fPhotoAbsorptionCof = nullptr;
705
706 fMaxInterval = 0;
707 fVerbose = 0;
708 fLowerI1 = false;
709
710 fSandiaCofPerAtom.resize(4,0.0);
711}

◆ G4SandiaTable() [5/5]

G4SandiaTable::G4SandiaTable ( G4SandiaTable )
delete

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 981 of file G4SandiaTable.cc.

982{
983 return fMatNbOfIntervals;
984}

◆ GetMaxInterval()

G4int G4SandiaTable::GetMaxInterval ( ) const

Definition at line 723 of file G4SandiaTable.cc.

724{
725 return fMaxInterval;
726}

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

◆ GetPhotoAbsorpCof()

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

Definition at line 752 of file G4SandiaTable.cc.

753{
754 return fPhotoAbsorptionCof[i][j]*funitc[j];
755}

Referenced by G4PAIxSection::G4PAIxSection().

◆ GetSandiaCofForMaterial() [1/2]

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

Definition at line 1033 of file G4SandiaTable.cc.

1034{
1035 G4int interval = 0;
1036 if (energy > (*(*fMatSandiaMatrix)[0])[0]) {
1037 interval = fMatNbOfIntervals - 1;
1038 // Loop checking, 07-Aug-2015, Vladimir Ivanchenko
1039 while ((interval>0)&&(energy<(*(*fMatSandiaMatrix)[interval])[0]))
1040 { --interval; }
1041 }
1042 return &((*(*fMatSandiaMatrix)[interval])[1]);
1043}

◆ GetSandiaCofForMaterial() [2/2]

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

Definition at line 1015 of file G4SandiaTable.cc.

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

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 130 of file G4SandiaTable.cc.

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

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

Referenced by G4LivermorePhotoElectricModel::CrossSectionPerVolume().

◆ GetSandiaMatTable()

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

Definition at line 1048 of file G4SandiaTable.cc.

1049{
1050#ifdef G4VERBOSE
1051 if(interval<0 || interval>=fMatNbOfIntervals) {
1052 PrintErrorV("GetSandiaCofForMaterial");
1053 interval = (interval<0) ? 0 : fMatNbOfIntervals-1;
1054 }
1055 if(j<0 || j>4) {
1056 PrintErrorV("GetSandiaCofForMaterial");
1057 j = (j<0) ? 0 : 4;
1058 }
1059#endif
1060 return ((*(*fMatSandiaMatrix)[interval])[j])*funitc[j];
1061}

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

◆ GetSandiaMatTablePAI()

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

Definition at line 1066 of file G4SandiaTable.cc.

1067{
1068#ifdef G4VERBOSE
1069 if(interval<0 || interval>=fMaxInterval) {
1070 PrintErrorV("GetSandiaCofForMaterialPAI");
1071 interval = (interval<0) ? 0 : fMaxInterval-1;
1072 }
1073 if(j<0 || j>4) {
1074 PrintErrorV("GetSandiaCofForMaterialPAI");
1075 j = (j<0) ? 0 : 4;
1076 }
1077#endif
1078 return ((*(*fMatSandiaMatrixPAI)[interval])[j]);
1079}

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

◆ GetWaterCofForMaterial()

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

Definition at line 202 of file G4SandiaTable.cc.

203{
204 return fH2OlowerI1[i][j]*funitc[j];
205}

◆ GetWaterEnergyLimit()

G4double G4SandiaTable::GetWaterEnergyLimit ( ) const

Definition at line 195 of file G4SandiaTable.cc.

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

◆ GetZtoA()

G4double G4SandiaTable::GetZtoA ( G4int  Z)
static

Definition at line 209 of file G4SandiaTable.cc.

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

Referenced by G4ParticleHPNames::GetName().

◆ Initialize()

void G4SandiaTable::Initialize ( const G4Material mat)

Definition at line 715 of file G4SandiaTable.cc.

716{
717 fMaterial = mat;
718 ComputeMatSandiaMatrixPAI();
719}

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

◆ operator!=()

G4bool G4SandiaTable::operator!= ( const G4SandiaTable ) const
delete

◆ operator=()

G4SandiaTable & G4SandiaTable::operator= ( const G4SandiaTable right)
delete

◆ operator==()

G4bool G4SandiaTable::operator== ( const G4SandiaTable ) const
delete

◆ SandiaIntervals()

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

Definition at line 782 of file G4SandiaTable.cc.

783{
784 G4int c, i, flag = 0, n1 = 1;
785 G4int j, c1, k1, k2;
786 G4double I1;
787 fMaxInterval = 0;
788
789 for(i = 0; i < el; ++i)
790 {
791 fMaxInterval += fNbOfIntervals[Z[i]];
792 }
793
794 fMaxInterval += 2;
795
796 if( fVerbose > 0 ) {
797 G4cout<<"begin sanInt, fMaxInterval = "<<fMaxInterval<<G4endl;
798 }
799
800 fPhotoAbsorptionCof = new G4double* [fMaxInterval];
801
802 for( i = 0; i < fMaxInterval; ++i ) {
803 fPhotoAbsorptionCof[i] = new G4double[5];
804 }
805 // for(c = 0; c < fIntervalLimit; ++c) // just in case
806
807 for( c = 0; c < fMaxInterval; ++c ) { fPhotoAbsorptionCof[c][0] = 0.; }
808
809 c = 1;
810
811 for( i = 0; i < el; ++i )
812 {
813 I1 = fIonizationPotentials[ Z[i] ]*keV; // First ionization
814 n1 = 1; // potential in keV
815
816 for(j = 1; j < Z[i]; ++j)
817 {
818 n1 += fNbOfIntervals[j];
819 }
820
821 G4int n2 = n1 + fNbOfIntervals[Z[i]];
822
823 for( k1 = n1; k1 < n2; k1++ )
824 {
825 if( I1 > fSandiaTable[k1][0] )
826 {
827 continue; // no ionization for energies smaller than I1 (first
828 } // ionisation potential)
829 break;
830 }
831 flag = 0;
832
833 for( c1 = 1; c1 < c; c1++ )
834 {
835 if( fPhotoAbsorptionCof[c1][0] == I1 ) // this value already has existed
836 {
837 flag = 1;
838 break;
839 }
840 }
841 if( flag == 0 )
842 {
843 fPhotoAbsorptionCof[c][0] = I1;
844 ++c;
845 }
846 for( k2 = k1; k2 < n2; k2++ )
847 {
848 flag = 0;
849
850 for( c1 = 1; c1 < c; c1++ )
851 {
852 if( fPhotoAbsorptionCof[c1][0] == fSandiaTable[k2][0] )
853 {
854 flag = 1;
855 break;
856 }
857 }
858 if( flag == 0 )
859 {
860 fPhotoAbsorptionCof[c][0] = fSandiaTable[k2][0];
861 if( fVerbose > 0 ) {
862 G4cout<<"sanInt, c = "<<c<<", E_c = "<<fPhotoAbsorptionCof[c][0]
863 <<G4endl;
864 }
865 ++c;
866 }
867 }
868 } // end for(i)
869
870 SandiaSort(fPhotoAbsorptionCof,c);
871 fMaxInterval = c;
872 if( fVerbose > 0 ) {
873 G4cout<<"end SanInt, fMaxInterval = "<<fMaxInterval<<G4endl;
874 }
875 return c;
876}
#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 884 of file G4SandiaTable.cc.

888{
889 G4int i, j, n1, k, c=1, jj, kk;
890 G4double I1, B1, B2, E1, E2;
891
892 for( i = 0; i < mi; ++i )
893 {
894 for(j = 1; j < 5; ++j)
895 {
896 fPhotoAbsorptionCof[i][j] = 0.;
897 }
898 }
899 for( i = 0; i < el; ++i )
900 {
901 n1 = 1;
902 I1 = fIonizationPotentials[Z[i]]*keV;
903
904 for(j = 1; j < Z[i]; ++j)
905 {
906 n1 += fNbOfIntervals[j];
907 }
908
909 G4int n2 = n1 + fNbOfIntervals[Z[i]] - 1;
910
911 for( k = n1; k < n2; ++k )
912 {
913 B1 = fSandiaTable[k][0];
914 B2 = fSandiaTable[k+1][0];
915
916 for( c = 1; c < mi-1; ++c )
917 {
918 E1 = fPhotoAbsorptionCof[c][0];
919 E2 = fPhotoAbsorptionCof[c+1][0];
920
921 if(B1 > E1 || B2 < E2 || E1 < I1)
922 {
923 continue;
924 }
925
926 for( j = 1; j < 5; ++j )
927 {
928 fPhotoAbsorptionCof[c][j] += fSandiaTable[k][j]*fractionW[i];
929 if( fVerbose > 0 )
930 {
931 G4cout<<"c="<<c<<"; j="<<j<<"; fST="<<fSandiaTable[k][j]
932 <<"; frW="<<fractionW[i]<<G4endl;
933 }
934 }
935 }
936 }
937 for( j = 1; j < 5; ++j ) // Last interval
938 {
939 fPhotoAbsorptionCof[mi-1][j] += fSandiaTable[k][j]*fractionW[i];
940 if( fVerbose > 0 )
941 {
942 G4cout<<"mi-1="<<mi-1<<"; j="<<j<<"; fST="<<fSandiaTable[k][j]
943 <<"; frW="<<fractionW[i]<<G4endl;
944 }
945 }
946 } // for(i)
947 c = 0; // Deleting of first intervals where all coefficients = 0
948
949 do
950 {
951 ++c;
952
953 if(fPhotoAbsorptionCof[c][1] != 0.0 || fPhotoAbsorptionCof[c][2] != 0.0 ||
954 fPhotoAbsorptionCof[c][3] != 0.0 || fPhotoAbsorptionCof[c][4] != 0.0)
955 {
956 continue;
957 }
958
959 for( jj = 2; jj < mi; ++jj )
960 {
961 for( kk = 0; kk < 5; ++kk ) {
962 fPhotoAbsorptionCof[jj-1][kk] = fPhotoAbsorptionCof[jj][kk];
963 }
964 }
965 mi--;
966 c--;
967 }
968 // Loop checking, 07-Aug-2015, Vladimir Ivanchenko
969 while( c < mi - 1 );
970
971 if(fVerbose > 0)
972 {
973 G4cout << "end SanMix, mi = " << mi << G4endl;
974 }
975
976 return mi;
977}

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: