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
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062 #include "G4MollerBhabhaModel.hh"
00063 #include "G4PhysicalConstants.hh"
00064 #include "G4SystemOfUnits.hh"
00065 #include "G4Electron.hh"
00066 #include "G4Positron.hh"
00067 #include "Randomize.hh"
00068 #include "G4ParticleChangeForLoss.hh"
00069
00070
00071
00072 using namespace std;
00073
00074 G4MollerBhabhaModel::G4MollerBhabhaModel(const G4ParticleDefinition* p,
00075 const G4String& nam)
00076 : G4VEmModel(nam),
00077 particle(0),
00078 isElectron(true),
00079 twoln10(2.0*log(10.0)),
00080 lowLimit(0.02*keV),
00081 isInitialised(false)
00082 {
00083 theElectron = G4Electron::Electron();
00084 if(p) { SetParticle(p); }
00085 fParticleChange = 0;
00086 }
00087
00088
00089
00090 G4MollerBhabhaModel::~G4MollerBhabhaModel()
00091 {}
00092
00093
00094
00095 G4double G4MollerBhabhaModel::MaxSecondaryEnergy(const G4ParticleDefinition*,
00096 G4double kinEnergy)
00097 {
00098 G4double tmax = kinEnergy;
00099 if(isElectron) { tmax *= 0.5; }
00100 return tmax;
00101 }
00102
00103
00104
00105 void G4MollerBhabhaModel::Initialise(const G4ParticleDefinition* p,
00106 const G4DataVector&)
00107 {
00108 if(!particle) { SetParticle(p); }
00109
00110 if(isInitialised) { return; }
00111
00112 isInitialised = true;
00113 fParticleChange = GetParticleChangeForLoss();
00114 }
00115
00116
00117
00118 G4double
00119 G4MollerBhabhaModel::ComputeCrossSectionPerElectron(const G4ParticleDefinition* p,
00120 G4double kineticEnergy,
00121 G4double cutEnergy,
00122 G4double maxEnergy)
00123 {
00124 if(!particle) { SetParticle(p); }
00125
00126 G4double cross = 0.0;
00127 G4double tmax = MaxSecondaryEnergy(p, kineticEnergy);
00128 tmax = std::min(maxEnergy, tmax);
00129
00130 if(cutEnergy < tmax) {
00131
00132 G4double xmin = cutEnergy/kineticEnergy;
00133 G4double xmax = tmax/kineticEnergy;
00134 G4double tau = kineticEnergy/electron_mass_c2;
00135 G4double gam = tau + 1.0;
00136 G4double gamma2= gam*gam;
00137 G4double beta2 = tau*(tau + 2)/gamma2;
00138
00139
00140 if (isElectron) {
00141
00142 G4double gg = (2.0*gam - 1.0)/gamma2;
00143 cross = ((xmax - xmin)*(1.0 - gg + 1.0/(xmin*xmax)
00144 + 1.0/((1.0-xmin)*(1.0 - xmax)))
00145 - gg*log( xmax*(1.0 - xmin)/(xmin*(1.0 - xmax)) ) ) / beta2;
00146
00147
00148 } else {
00149
00150 G4double y = 1.0/(1.0 + gam);
00151 G4double y2 = y*y;
00152 G4double y12 = 1.0 - 2.0*y;
00153 G4double b1 = 2.0 - y2;
00154 G4double b2 = y12*(3.0 + y2);
00155 G4double y122= y12*y12;
00156 G4double b4 = y122*y12;
00157 G4double b3 = b4 + y122;
00158
00159 cross = (xmax - xmin)*(1.0/(beta2*xmin*xmax) + b2
00160 - 0.5*b3*(xmin + xmax)
00161 + b4*(xmin*xmin + xmin*xmax + xmax*xmax)/3.0)
00162 - b1*log(xmax/xmin);
00163 }
00164
00165 cross *= twopi_mc2_rcl2/kineticEnergy;
00166 }
00167 return cross;
00168 }
00169
00170
00171
00172 G4double G4MollerBhabhaModel::ComputeCrossSectionPerAtom(
00173 const G4ParticleDefinition* p,
00174 G4double kineticEnergy,
00175 G4double Z, G4double,
00176 G4double cutEnergy,
00177 G4double maxEnergy)
00178 {
00179 return Z*ComputeCrossSectionPerElectron(p,kineticEnergy,cutEnergy,maxEnergy);
00180 }
00181
00182
00183
00184 G4double G4MollerBhabhaModel::CrossSectionPerVolume(
00185 const G4Material* material,
00186 const G4ParticleDefinition* p,
00187 G4double kinEnergy,
00188 G4double cutEnergy,
00189 G4double maxEnergy)
00190 {
00191 G4double eDensity = material->GetElectronDensity();
00192 return eDensity*ComputeCrossSectionPerElectron(p,kinEnergy,cutEnergy,maxEnergy);
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206 }
00207
00208
00209
00210 G4double G4MollerBhabhaModel::ComputeDEDXPerVolume(
00211 const G4Material* material,
00212 const G4ParticleDefinition* p,
00213 G4double kineticEnergy,
00214 G4double cut)
00215 {
00216 if(!particle) { SetParticle(p); }
00217
00218
00219 G4double electronDensity = material->GetElectronDensity();
00220
00221 G4double Zeff = electronDensity/material->GetTotNbOfAtomsPerVolume();
00222 G4double th = 0.25*sqrt(Zeff)*keV;
00223
00224
00225
00226 G4double tkin = kineticEnergy;
00227 if (kineticEnergy < th) { tkin = th; }
00228
00229 G4double tau = tkin/electron_mass_c2;
00230 G4double gam = tau + 1.0;
00231 G4double gamma2= gam*gam;
00232 G4double bg2 = tau*(tau + 2);
00233 G4double beta2 = bg2/gamma2;
00234
00235 G4double eexc = material->GetIonisation()->GetMeanExcitationEnergy();
00236 eexc /= electron_mass_c2;
00237 G4double eexc2 = eexc*eexc;
00238
00239 G4double d = std::min(cut, MaxSecondaryEnergy(p, tkin))/electron_mass_c2;
00240 G4double dedx;
00241
00242
00243 if (isElectron) {
00244
00245 dedx = log(2.0*(tau + 2.0)/eexc2) - 1.0 - beta2
00246 + log((tau-d)*d) + tau/(tau-d)
00247 + (0.5*d*d + (2.0*tau + 1.)*log(1. - d/tau))/gamma2;
00248
00249
00250 } else {
00251
00252 G4double d2 = d*d*0.5;
00253 G4double d3 = d2*d/1.5;
00254 G4double d4 = d3*d*0.75;
00255 G4double y = 1.0/(1.0 + gam);
00256 dedx = log(2.0*(tau + 2.0)/eexc2) + log(tau*d)
00257 - beta2*(tau + 2.0*d - y*(3.0*d2
00258 + y*(d - d3 + y*(d2 - tau*d3 + d4))))/tau;
00259 }
00260
00261
00262 G4double x = log(bg2)/twoln10;
00263 dedx -= material->GetIonisation()->DensityCorrection(x);
00264
00265
00266 dedx *= twopi_mc2_rcl2*electronDensity/beta2;
00267 if (dedx < 0.0) { dedx = 0.0; }
00268
00269
00270
00271 if (kineticEnergy < th) {
00272 x = kineticEnergy/th;
00273 if(x > 0.25) { dedx /= sqrt(x); }
00274 else { dedx *= 1.4*sqrt(x)/(0.1 + x); }
00275 }
00276 return dedx;
00277 }
00278
00279
00280
00281 void G4MollerBhabhaModel::SampleSecondaries(std::vector<G4DynamicParticle*>* vdp,
00282 const G4MaterialCutsCouple*,
00283 const G4DynamicParticle* dp,
00284 G4double cutEnergy,
00285 G4double maxEnergy)
00286 {
00287 G4double kineticEnergy = dp->GetKineticEnergy();
00288
00289
00290
00291 G4double tmax;
00292 G4double tmin = cutEnergy;
00293 if(isElectron) {
00294 tmax = 0.5*kineticEnergy;
00295 } else {
00296 tmax = kineticEnergy;
00297 }
00298 if(maxEnergy < tmax) { tmax = maxEnergy; }
00299 if(tmin >= tmax) { return; }
00300
00301 G4double energy = kineticEnergy + electron_mass_c2;
00302 G4double totalMomentum = sqrt(kineticEnergy*(energy + electron_mass_c2));
00303 G4double xmin = tmin/kineticEnergy;
00304 G4double xmax = tmax/kineticEnergy;
00305 G4double gam = energy/electron_mass_c2;
00306 G4double gamma2 = gam*gam;
00307 G4double beta2 = 1.0 - 1.0/gamma2;
00308 G4double x, z, q, grej;
00309
00310 G4ThreeVector direction = dp->GetMomentumDirection();
00311
00312
00313 if (isElectron) {
00314
00315 G4double gg = (2.0*gam - 1.0)/gamma2;
00316 G4double y = 1.0 - xmax;
00317 grej = 1.0 - gg*xmax + xmax*xmax*(1.0 - gg + (1.0 - gg*y)/(y*y));
00318
00319 do {
00320 q = G4UniformRand();
00321 x = xmin*xmax/(xmin*(1.0 - q) + xmax*q);
00322 y = 1.0 - x;
00323 z = 1.0 - gg*x + x*x*(1.0 - gg + (1.0 - gg*y)/(y*y));
00324
00325
00326
00327
00328
00329
00330
00331
00332
00333 } while(grej * G4UniformRand() > z);
00334
00335
00336 } else {
00337
00338 G4double y = 1.0/(1.0 + gam);
00339 G4double y2 = y*y;
00340 G4double y12 = 1.0 - 2.0*y;
00341 G4double b1 = 2.0 - y2;
00342 G4double b2 = y12*(3.0 + y2);
00343 G4double y122= y12*y12;
00344 G4double b4 = y122*y12;
00345 G4double b3 = b4 + y122;
00346
00347 y = xmax*xmax;
00348 grej = 1.0 + (y*y*b4 - xmin*xmin*xmin*b3 + y*b2 - xmin*b1)*beta2;
00349 do {
00350 q = G4UniformRand();
00351 x = xmin*xmax/(xmin*(1.0 - q) + xmax*q);
00352 y = x*x;
00353 z = 1.0 + (y*y*b4 - x*y*b3 + y*b2 - x*b1)*beta2;
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363 } while(grej * G4UniformRand() > z);
00364 }
00365
00366 G4double deltaKinEnergy = x * kineticEnergy;
00367
00368 G4double deltaMomentum =
00369 sqrt(deltaKinEnergy * (deltaKinEnergy + 2.0*electron_mass_c2));
00370 G4double cost = deltaKinEnergy * (energy + electron_mass_c2) /
00371 (deltaMomentum * totalMomentum);
00372 G4double sint = (1.0 - cost)*(1. + cost);
00373 if(sint > 0.0) { sint = sqrt(sint); }
00374 else { sint = 0.0; }
00375
00376 G4double phi = twopi * G4UniformRand() ;
00377
00378 G4ThreeVector deltaDirection(sint*cos(phi),sint*sin(phi), cost) ;
00379 deltaDirection.rotateUz(direction);
00380
00381
00382 kineticEnergy -= deltaKinEnergy;
00383 fParticleChange->SetProposedKineticEnergy(kineticEnergy);
00384
00385 G4ThreeVector dir = totalMomentum*direction - deltaMomentum*deltaDirection;
00386 direction = dir.unit();
00387 fParticleChange->SetProposedMomentumDirection(direction);
00388
00389
00390 G4DynamicParticle* delta = new G4DynamicParticle(theElectron,
00391 deltaDirection,deltaKinEnergy);
00392 vdp->push_back(delta);
00393 }
00394
00395