Import Geant4 0.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 15:09:25 +02:00
parent b97f8d0df7
commit aaa409b6ee
2922 changed files with 55107 additions and 81674 deletions
+187 -2
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4SandiaTable.cc,v 2.3 1998/12/08 15:12:29 maire Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4SandiaTable.cc,v 1.2 1999/04/15 14:01:11 grichine Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
//
@@ -25,6 +25,8 @@ G4double G4SandiaTable::fSandiaCofPerAtom[4];
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
G4SandiaTable::G4SandiaTable(G4int matIndex){ ; }
G4SandiaTable::G4SandiaTable(G4Material* material)
:fMaterial(material)
{
@@ -123,3 +125,186 @@ G4double* G4SandiaTable::GetSandiaCofForMaterial(G4double energy)
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
//
// Methods for PAI model
///////////////////////////////////////////////////////////////////////
//
// Bubble sorting of left energy interval in SandiaTable in ascening order
//
void
G4SandiaTable::SandiaSort(G4double da[][5],
G4int sz )
{
for(G4int i = 1 ;i < sz ; i++ )
{
for(G4int j = i + 1 ;j < sz ; j++ )
{
if(da[i][0] > da[j][0])
{
SandiaSwap(da,i,j) ;
}
}
}
}
////////////////////////////////////////////////////////////////////////////
//
// SandiaIntervals
//
G4int
G4SandiaTable::SandiaIntervals(G4int Z[],
G4int el )
{
G4int c,i;
for(c = 0 ; c < fIntervalLimit ; c++) // just in case
{
fPhotoAbsorptionCof[c][0] = 0. ;
}
c = 1 ;
for(i = 0 ; i < el ; i++)
{
G4double I1 = fIonizationPotentials[Z[i]]*keV ; // First ionization
G4int n1 = 1 ; // potential in keV
G4int j, c1, k1, k2 ;
for(j = 1 ; j < Z[i] ; j++)
{
n1 += fNbOfIntervals[j] ;
}
G4int n2 = n1 + fNbOfIntervals[Z[i]] ;
for(k1 = n1 ; k1 < n2 ; k1++)
{
if(I1 > fSandiaTable[k1][0])
{
continue ; // no ionization for energies smaller than I1 (first
} // ionisation potential)
break ;
}
G4int flag = 0 ;
for(c1 = 1 ; c1 < c ; c1++)
{
if(fPhotoAbsorptionCof[c1][0] == I1) // this value already has existed
{
flag = 1 ;
break ;
}
}
if(flag == 0)
{
fPhotoAbsorptionCof[c][0] = I1 ;
c++ ;
}
for(k2 = k1 ; k2 < n2 ; k2++)
{
flag = 0 ;
for(c1 = 1 ; c1 < c ; c1++)
{
if(fPhotoAbsorptionCof[c1][0] == fSandiaTable[k2][0])
{
flag = 1 ;
break ;
}
}
if(flag == 0)
{
fPhotoAbsorptionCof[c][0] = fSandiaTable[k2][0] ;
c++ ;
}
}
} // end for(i)
SandiaSort(fPhotoAbsorptionCof,c) ;
fMaxInterval = c ;
return c ;
}
///////////////////////////////////////////////////////////////////////
//
// SandiaMixing
//
G4int
G4SandiaTable::SandiaMixing( G4int Z[],
const G4double fractionW[],
G4int el,
G4int mi )
{
G4int i;
for(i = 0 ; i < mi ; i++)
{
for(G4int j = 1 ; j < 5 ; j++) fPhotoAbsorptionCof[i][j] = 0. ;
}
for(i = 0 ; i < el ; i++)
{
G4int n1 = 1 ;
G4int j, k ;
G4double I1 = fIonizationPotentials[Z[i]]*keV ;
for(j = 1 ; j < Z[i] ; j++)
{
n1 += fNbOfIntervals[j] ;
}
G4int n2 = n1 + fNbOfIntervals[Z[i]] - 1 ;
for(k = n1 ; k < n2 ; k++)
{
G4double B1 = fSandiaTable[k][0] ;
G4double B2 = fSandiaTable[k+1][0] ;
for(G4int c = 1 ; c < mi-1 ; c++)
{
G4double E1 = fPhotoAbsorptionCof[c][0] ;
G4double E2 = fPhotoAbsorptionCof[c+1][0] ;
if(B1 > E1 || B2 < E2 || E1 < I1)
{
continue ;
}
for(j = 1 ; j < 5 ; j++)
{
fPhotoAbsorptionCof[c][j] += fSandiaTable[k][j]*fractionW[i] ;
}
}
}
for(j = 1 ; j < 5 ; j++) // Last interval
{
fPhotoAbsorptionCof[mi-1][j] += fSandiaTable[k][j]*fractionW[i] ;
}
} // for(i)
G4int c = 0 ; // Deleting of first intervals where all coefficients = 0
do
{
c++ ;
if( fPhotoAbsorptionCof[c][1] != 0.0 ||
fPhotoAbsorptionCof[c][2] != 0.0 ||
fPhotoAbsorptionCof[c][3] != 0.0 ||
fPhotoAbsorptionCof[c][4] != 0.0 )
{
continue ;
}
for(G4int jj = 2 ; jj < mi ; jj++)
{
for(G4int kk = 0 ; kk < 5 ; kk++)
{
fPhotoAbsorptionCof[jj-1][kk]= fPhotoAbsorptionCof[jj][kk] ;
}
}
mi-- ;
c-- ;
}
while(c < mi - 1) ;
return mi ;
}
// G4SandiaTable class -- end of implementation file
//
////////////////////////////////////////////////////////////////////////////