00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #include "G4LivermoreIonisationCrossSection.hh"
00038 #include "G4SystemOfUnits.hh"
00039 #include "G4AtomicTransitionManager.hh"
00040 #include "G4VCrossSectionHandler.hh"
00041 #include "G4eCrossSectionHandler.hh"
00042 #include "G4SemiLogInterpolation.hh"
00043
00044
00045
00046
00047 G4LivermoreIonisationCrossSection::G4LivermoreIonisationCrossSection(
00048 const G4String& nam) : G4VhShellCrossSection(nam), crossSectionHandler(0)
00049 {
00050 fLowEnergyLimit = 10.0*eV;
00051 fHighEnergyLimit = 100.0*GeV;
00052
00053 transitionManager = G4AtomicTransitionManager::Instance();
00054
00055 verboseLevel = 0;
00056
00057 Initialise();
00058 }
00059
00060
00061
00062 G4LivermoreIonisationCrossSection::~G4LivermoreIonisationCrossSection()
00063 {
00064 delete crossSectionHandler;
00065 }
00066
00067
00068
00069 void G4LivermoreIonisationCrossSection::Initialise()
00070 {
00071 const G4int binForFluo = 20;
00072 G4int nbin = G4int(std::log10(fHighEnergyLimit/fLowEnergyLimit) + 0.5);
00073 if(nbin <= 0) { nbin = 1; }
00074 nbin *= binForFluo;
00075
00076
00077 if (crossSectionHandler) {
00078 crossSectionHandler->Clear();
00079 delete crossSectionHandler;
00080 }
00081
00082 G4VDataSetAlgorithm* inter = new G4SemiLogInterpolation();
00083 crossSectionHandler =
00084 new G4eCrossSectionHandler(inter,fLowEnergyLimit,fHighEnergyLimit,nbin);
00085 crossSectionHandler->LoadShellData("ioni/ion-ss-cs-");
00086
00087 }
00088
00089 G4double
00090 G4LivermoreIonisationCrossSection::CrossSection(G4int Z, G4AtomicShellEnumerator shell,
00091 G4double kinEnergy, G4double,
00092 const G4Material*)
00093 {
00094 G4double cross = 0.0;
00095 G4int n = G4int(shell);
00096 G4int nmax = std::min(9,transitionManager->NumberOfShells(Z));
00097 if(Z > 6 && Z < 93 && n < nmax &&
00098 kinEnergy >= fLowEnergyLimit && kinEnergy <= fHighEnergyLimit) {
00099
00100 cross = crossSectionHandler->FindValue(Z, kinEnergy, n);
00101 }
00102 return cross;
00103 }
00104
00105
00106
00107 std::vector<G4double>
00108 G4LivermoreIonisationCrossSection::GetCrossSection(G4int Z,
00109 G4double kinEnergy,
00110 G4double, G4double,
00111 const G4Material*)
00112 {
00113 G4int nmax = std::min(9,transitionManager->NumberOfShells(Z));
00114 std::vector<G4double> vec(nmax,0.0);
00115 for(G4int i=0; i<nmax; ++i) {
00116 vec[i] = CrossSection(Z, G4AtomicShellEnumerator(i), kinEnergy);
00117 }
00118 return vec;
00119 }
00120
00121
00122
00123 std::vector<G4double>
00124 G4LivermoreIonisationCrossSection::Probabilities(G4int Z,
00125 G4double kinEnergy,
00126 G4double,
00127 G4double,
00128 const G4Material*)
00129 {
00130 std::vector<G4double> vec = GetCrossSection(Z, kinEnergy);
00131 size_t n = vec.size();
00132 size_t i;
00133 G4double sum = 0.0;
00134 for(i=0; i<n; ++i) { sum += vec[i]; }
00135 if(sum > 0.0) {
00136 sum = 1.0/sum;
00137 for(i=0; i<n; ++i) { vec[i] = vec[i]*sum; }
00138 }
00139 return vec;
00140 }
00141
00142