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
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050 #include "G4KleinNishinaCompton.hh"
00051 #include "G4PhysicalConstants.hh"
00052 #include "G4SystemOfUnits.hh"
00053 #include "G4Electron.hh"
00054 #include "G4Gamma.hh"
00055 #include "Randomize.hh"
00056 #include "G4DataVector.hh"
00057 #include "G4ParticleChangeForGamma.hh"
00058
00059
00060
00061 using namespace std;
00062
00063 G4KleinNishinaCompton::G4KleinNishinaCompton(const G4ParticleDefinition*,
00064 const G4String& nam)
00065 : G4VEmModel(nam)
00066 {
00067 theGamma = G4Gamma::Gamma();
00068 theElectron = G4Electron::Electron();
00069 lowestGammaEnergy = 1.0*eV;
00070 fParticleChange = 0;
00071 }
00072
00073
00074
00075 G4KleinNishinaCompton::~G4KleinNishinaCompton()
00076 {}
00077
00078
00079
00080 void G4KleinNishinaCompton::Initialise(const G4ParticleDefinition*,
00081 const G4DataVector&)
00082 {
00083 if(!fParticleChange) { fParticleChange = GetParticleChangeForGamma(); }
00084 }
00085
00086
00087
00088 G4double G4KleinNishinaCompton::ComputeCrossSectionPerAtom(
00089 const G4ParticleDefinition*,
00090 G4double GammaEnergy,
00091 G4double Z, G4double,
00092 G4double, G4double)
00093 {
00094 G4double xSection = 0.0 ;
00095 if ( Z < 0.9999 ) return xSection;
00096 if ( GammaEnergy < 0.1*keV ) return xSection;
00097
00098
00099 static const G4double a = 20.0 , b = 230.0 , c = 440.0;
00100
00101 static const G4double
00102 d1= 2.7965e-1*barn, d2=-1.8300e-1*barn, d3= 6.7527 *barn, d4=-1.9798e+1*barn,
00103 e1= 1.9756e-5*barn, e2=-1.0205e-2*barn, e3=-7.3913e-2*barn, e4= 2.7079e-2*barn,
00104 f1=-3.9178e-7*barn, f2= 6.8241e-5*barn, f3= 6.0480e-5*barn, f4= 3.0274e-4*barn;
00105
00106 G4double p1Z = Z*(d1 + e1*Z + f1*Z*Z), p2Z = Z*(d2 + e2*Z + f2*Z*Z),
00107 p3Z = Z*(d3 + e3*Z + f3*Z*Z), p4Z = Z*(d4 + e4*Z + f4*Z*Z);
00108
00109 G4double T0 = 15.0*keV;
00110 if (Z < 1.5) T0 = 40.0*keV;
00111
00112 G4double X = max(GammaEnergy, T0) / electron_mass_c2;
00113 xSection = p1Z*std::log(1.+2.*X)/X
00114 + (p2Z + p3Z*X + p4Z*X*X)/(1. + a*X + b*X*X + c*X*X*X);
00115
00116
00117 if (GammaEnergy < T0) {
00118 G4double dT0 = 1.*keV;
00119 X = (T0+dT0) / electron_mass_c2 ;
00120 G4double sigma = p1Z*log(1.+2*X)/X
00121 + (p2Z + p3Z*X + p4Z*X*X)/(1. + a*X + b*X*X + c*X*X*X);
00122 G4double c1 = -T0*(sigma-xSection)/(xSection*dT0);
00123 G4double c2 = 0.150;
00124 if (Z > 1.5) c2 = 0.375-0.0556*log(Z);
00125 G4double y = log(GammaEnergy/T0);
00126 xSection *= exp(-y*(c1+c2*y));
00127 }
00128
00129 return xSection;
00130 }
00131
00132
00133
00134 void G4KleinNishinaCompton::SampleSecondaries(std::vector<G4DynamicParticle*>* fvect,
00135 const G4MaterialCutsCouple*,
00136 const G4DynamicParticle* aDynamicGamma,
00137 G4double,
00138 G4double)
00139 {
00140
00141
00142
00143
00144
00145 G4double gamEnergy0 = aDynamicGamma->GetKineticEnergy();
00146
00147
00148 if(gamEnergy0 < lowestGammaEnergy) {
00149 fParticleChange->ProposeTrackStatus(fStopAndKill);
00150 fParticleChange->ProposeLocalEnergyDeposit(gamEnergy0);
00151 fParticleChange->SetProposedKineticEnergy(0.0);
00152 return;
00153 }
00154
00155 G4double E0_m = gamEnergy0 / electron_mass_c2 ;
00156
00157 G4ThreeVector gamDirection0 = aDynamicGamma->GetMomentumDirection();
00158
00159
00160
00161
00162
00163 G4double epsilon, epsilonsq, onecost, sint2, greject ;
00164
00165 G4double eps0 = 1./(1. + 2.*E0_m);
00166 G4double epsilon0sq = eps0*eps0;
00167 G4double alpha1 = - log(eps0);
00168 G4double alpha2 = 0.5*(1.- epsilon0sq);
00169
00170 do {
00171 if ( alpha1/(alpha1+alpha2) > G4UniformRand() ) {
00172 epsilon = exp(-alpha1*G4UniformRand());
00173 epsilonsq = epsilon*epsilon;
00174
00175 } else {
00176 epsilonsq = epsilon0sq + (1.- epsilon0sq)*G4UniformRand();
00177 epsilon = sqrt(epsilonsq);
00178 };
00179
00180 onecost = (1.- epsilon)/(epsilon*E0_m);
00181 sint2 = onecost*(2.-onecost);
00182 greject = 1. - epsilon*sint2/(1.+ epsilonsq);
00183
00184 } while (greject < G4UniformRand());
00185
00186
00187
00188
00189
00190 if(sint2 < 0.0) { sint2 = 0.0; }
00191 G4double cosTeta = 1. - onecost;
00192 G4double sinTeta = sqrt (sint2);
00193 G4double Phi = twopi * G4UniformRand();
00194
00195
00196
00197
00198
00199 G4ThreeVector gamDirection1(sinTeta*cos(Phi), sinTeta*sin(Phi), cosTeta);
00200 gamDirection1.rotateUz(gamDirection0);
00201 G4double gamEnergy1 = epsilon*gamEnergy0;
00202 if(gamEnergy1 > lowestGammaEnergy) {
00203 fParticleChange->ProposeMomentumDirection(gamDirection1);
00204 fParticleChange->SetProposedKineticEnergy(gamEnergy1);
00205 } else {
00206 fParticleChange->ProposeTrackStatus(fStopAndKill);
00207 fParticleChange->ProposeLocalEnergyDeposit(gamEnergy1);
00208 fParticleChange->SetProposedKineticEnergy(0.0);
00209 }
00210
00211
00212
00213
00214
00215 G4double eKinEnergy = gamEnergy0 - gamEnergy1;
00216
00217 if(eKinEnergy > DBL_MIN) {
00218 G4ThreeVector eDirection = gamEnergy0*gamDirection0 - gamEnergy1*gamDirection1;
00219 eDirection = eDirection.unit();
00220
00221
00222 G4DynamicParticle* dp = new G4DynamicParticle(theElectron,eDirection,eKinEnergy);
00223 fvect->push_back(dp);
00224 }
00225 }
00226
00227
00228
00229