Changeset 1315 for trunk/source/materials/src/G4AtomicShells.cc
- Timestamp:
- Jun 18, 2010, 11:42:07 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/materials/src/G4AtomicShells.cc
r1196 r1315 25 25 // 26 26 // 27 // $Id: G4AtomicShells.cc,v 1. 7 2006/10/17 15:15:46vnivanch Exp $28 // GEANT4 tag $Name: materials-V09-02-18$27 // $Id: G4AtomicShells.cc,v 1.8 2010/04/30 13:09:22 vnivanch Exp $ 28 // GEANT4 tag $Name: geant4-09-04-beta-cand-01 $ 29 29 // 30 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo.... … … 34 34 // 19-07-04, add a protection in GetNumberOfShells(), mma 35 35 // 11-02-05, GetNumberOfElectrons(Z,ShellNb), V.Ivanchenko 36 // 30-04-10, added fIndexOfShells, V.Ivanchenko 36 37 37 38 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo.... … … 44 45 45 46 const G4int 46 G4AtomicShells::fNumberOfShells[101] = 47 G4AtomicShells::fNumberOfShells[101] = 47 48 { 48 49 0 , // nonexisting zero element … … 74 75 // The total shell number is: 75 76 // 1 + G4AtomicShells::TotalNumberOfShells(100) = 1 + 1539 = 1540 77 78 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo.... 79 80 const G4int 81 G4AtomicShells::fIndexOfShells[101] = 82 { 0, 83 1, 2, 3, 5, 7, 10, 13, 17, 21, 24, 84 28, 33, 38, 44, 50, 56, 62, 68, 75, 83, 85 91, 100, 109, 118, 127, 136, 145, 154, 164, 174, 86 184, 195, 206, 217, 228, 239, 251, 264, 277, 291, 87 305, 319, 333, 347, 361, 375, 390, 405, 420, 436, 88 452, 468, 484, 500, 517, 535, 553, 572, 591, 610, 89 629, 648, 667, 686, 706, 725, 744, 763, 782, 801, 90 821, 842, 863, 884, 905, 926, 947, 968, 989, 1011, 91 1033, 1056, 1079, 1102, 1125, 1149, 1173, 1198, 1223, 1249, 92 1275, 1302, 1329, 1356, 1382, 1408, 1435, 1462, 1488, 1514 93 }; 76 94 77 95 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo.... … … 729 747 G4AtomicShells::GetNumberOfShells(G4int Z) 730 748 { 731 assert (Z> =1 && Z<=101);749 assert (Z>0 && Z<101); 732 750 return fNumberOfShells[Z]; 733 751 } … … 738 756 G4AtomicShells::GetBindingEnergy(G4int Z, G4int ShellNb) 739 757 { 740 assert (Z>=1 && Z<=101 && ShellNb<fNumberOfShells[Z]); 741 742 G4int indice = 1; 743 for (G4int z = 1 ; z < Z ; z++) indice += fNumberOfShells[z]; 744 indice += ShellNb; 745 return fBindingEnergies[indice]*eV; 758 assert (Z>0 && Z<101 && ShellNb<fNumberOfShells[Z]); 759 return fBindingEnergies[fIndexOfShells[Z] + ShellNb]*CLHEP::eV; 746 760 } 747 761 … … 751 765 G4AtomicShells::GetNumberOfElectrons(G4int Z, G4int ShellNb) 752 766 { 753 assert (Z>=1 && Z<=101 && ShellNb<fNumberOfShells[Z]); 754 755 G4int indice = 1; 756 for (G4int z = 1 ; z < Z ; z++) indice += fNumberOfShells[z]; 757 indice += ShellNb; 758 return fNumberOfElectrons[indice]; 767 assert (Z>0 && Z<101 && ShellNb<fNumberOfShells[Z]); 768 return fNumberOfElectrons[fIndexOfShells[Z] + ShellNb]; 759 769 } 760 770 … … 763 773 G4double G4AtomicShells::GetTotalBindingEnergy (G4int Z) 764 774 { 765 assert (Z>=1 && Z< =101);775 assert (Z>=1 && Z<101); 766 776 767 G4int idx = 1;768 for (G4int z = 1 ; z < Z ; z++) idx += fNumberOfShells[z];777 G4int idx = fIndexOfShells[Z]; 778 G4int idxmax = idx + fNumberOfShells[Z]; 769 779 G4double energy = 0.0; 770 G4int idxmax = idx + fNumberOfShells[Z]; 771 for (G4int i=idx; i<idxmax; i++) {energy += fBindingEnergies[i];} 772 return energy*eV; 780 for (G4int i=idx; i<idxmax; ++i) {energy += fBindingEnergies[i];} 781 return energy*CLHEP::eV; 773 782 } 774 783
Note: See TracChangeset
for help on using the changeset viewer.