source: trunk/source/processes/electromagnetic/standard/src/G4MollerBhabhaModel.cc@ 1134

Last change on this file since 1134 was 1055, checked in by garnier, 17 years ago

maj sur la beta de geant 4.9.3

File size: 13.4 KB
Line 
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26// $Id: G4MollerBhabhaModel.cc,v 1.34 2009/04/24 17:15:46 vnivanch Exp $
27// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
28//
29// -------------------------------------------------------------------
30//
31// GEANT4 Class file
32//
33//
34// File name: G4MollerBhabhaModel
35//
36// Author: Vladimir Ivanchenko on base of Laszlo Urban code
37//
38// Creation date: 03.01.2002
39//
40// Modifications:
41//
42// 13-11-02 Minor fix - use normalised direction (V.Ivanchenko)
43// 04-12-02 Change G4DynamicParticle constructor in PostStepDoIt (V.Ivanchenko)
44// 23-12-02 Change interface in order to move to cut per region (V.Ivanchenko)
45// 27-01-03 Make models region aware (V.Ivanchenko)
46// 13-02-03 Add name (V.Ivanchenko)
47// 08-04-05 Major optimisation of internal interfaces (V.Ivantchenko)
48// 25-07-05 Add protection in calculation of recoil direction for the case
49// of complete energy transfer from e+ to e- (V.Ivanchenko)
50// 06-02-06 ComputeCrossSectionPerElectron, ComputeCrossSectionPerAtom (mma)
51// 15-05-06 Fix MinEnergyCut (V.Ivanchenko)
52//
53//
54// Class Description:
55//
56// Implementation of energy loss and delta-electron production by e+/e-
57//
58// -------------------------------------------------------------------
59//
60//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
61//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
62
63#include "G4MollerBhabhaModel.hh"
64#include "G4Electron.hh"
65#include "G4Positron.hh"
66#include "Randomize.hh"
67#include "G4ParticleChangeForLoss.hh"
68
69//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
70
71using namespace std;
72
73G4MollerBhabhaModel::G4MollerBhabhaModel(const G4ParticleDefinition* p,
74 const G4String& nam)
75 : G4VEmModel(nam),
76 particle(0),
77 isElectron(true),
78 twoln10(2.0*log(10.0)),
79 lowLimit(0.2*keV),
80 isInitialised(false)
81{
82 theElectron = G4Electron::Electron();
83 if(p) SetParticle(p);
84}
85
86//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
87
88G4MollerBhabhaModel::~G4MollerBhabhaModel()
89{}
90
91//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
92
93G4double G4MollerBhabhaModel::MinEnergyCut(const G4ParticleDefinition*,
94 const G4MaterialCutsCouple* couple)
95{
96 G4double electronDensity = couple->GetMaterial()->GetElectronDensity();
97 G4double Zeff = electronDensity/couple->GetMaterial()->GetTotNbOfAtomsPerVolume();
98 return 0.25*sqrt(Zeff)*keV;
99}
100
101//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
102
103G4double G4MollerBhabhaModel::MaxSecondaryEnergy(const G4ParticleDefinition*,
104 G4double kinEnergy)
105{
106 G4double tmax = kinEnergy;
107 if(isElectron) tmax *= 0.5;
108 return tmax;
109}
110
111//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
112
113void G4MollerBhabhaModel::Initialise(const G4ParticleDefinition* p,
114 const G4DataVector&)
115{
116 if(!particle) SetParticle(p);
117 SetDeexcitationFlag(false);
118
119 if(isInitialised) return;
120
121 isInitialised = true;
122 fParticleChange = GetParticleChangeForLoss();
123}
124
125//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
126
127G4double G4MollerBhabhaModel::ComputeCrossSectionPerElectron(
128 const G4ParticleDefinition* p,
129 G4double kineticEnergy,
130 G4double cutEnergy,
131 G4double maxEnergy)
132{
133 if(!particle) SetParticle(p);
134
135 G4double cross = 0.0;
136 G4double tmax = MaxSecondaryEnergy(p, kineticEnergy);
137 tmax = min(maxEnergy, tmax);
138
139 if(cutEnergy < tmax) {
140
141 G4double xmin = cutEnergy/kineticEnergy;
142 G4double xmax = tmax/kineticEnergy;
143 G4double gam = kineticEnergy/electron_mass_c2 + 1.0;
144 G4double gamma2= gam*gam;
145 G4double beta2 = 1.0 - 1.0/gamma2;
146
147 //Moller (e-e-) scattering
148 if (isElectron) {
149
150 G4double g = (2.0*gam - 1.0)/gamma2;
151 cross = ((xmax - xmin)*(1.0 - g + 1.0/(xmin*xmax)
152 + 1.0/((1.0-xmin)*(1.0 - xmax)))
153 - g*log( xmax*(1.0 - xmin)/(xmin*(1.0 - xmax)) ) ) / beta2;
154
155 //Bhabha (e+e-) scattering
156 } else {
157
158 G4double y = 1.0/(1.0 + gam);
159 G4double y2 = y*y;
160 G4double y12 = 1.0 - 2.0*y;
161 G4double b1 = 2.0 - y2;
162 G4double b2 = y12*(3.0 + y2);
163 G4double y122= y12*y12;
164 G4double b4 = y122*y12;
165 G4double b3 = b4 + y122;
166
167 cross = (xmax - xmin)*(1.0/(beta2*xmin*xmax) + b2
168 - 0.5*b3*(xmin + xmax)
169 + b4*(xmin*xmin + xmin*xmax + xmax*xmax)/3.0)
170 - b1*log(xmax/xmin);
171 }
172
173 cross *= twopi_mc2_rcl2/kineticEnergy;
174 }
175 return cross;
176}
177
178//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
179
180G4double G4MollerBhabhaModel::ComputeCrossSectionPerAtom(
181 const G4ParticleDefinition* p,
182 G4double kineticEnergy,
183 G4double Z, G4double,
184 G4double cutEnergy,
185 G4double maxEnergy)
186{
187 G4double cross = Z*ComputeCrossSectionPerElectron
188 (p,kineticEnergy,cutEnergy,maxEnergy);
189 return cross;
190}
191
192//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
193
194G4double G4MollerBhabhaModel::CrossSectionPerVolume(
195 const G4Material* material,
196 const G4ParticleDefinition* p,
197 G4double kineticEnergy,
198 G4double cutEnergy,
199 G4double maxEnergy)
200{
201 G4double eDensity = material->GetElectronDensity();
202 G4double cross = eDensity*ComputeCrossSectionPerElectron
203 (p,kineticEnergy,cutEnergy,maxEnergy);
204 return cross;
205}
206
207//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
208
209G4double G4MollerBhabhaModel::ComputeDEDXPerVolume(
210 const G4Material* material,
211 const G4ParticleDefinition* p,
212 G4double kineticEnergy,
213 G4double cutEnergy)
214{
215 if(!particle) SetParticle(p);
216 // calculate the dE/dx due to the ionization by Seltzer-Berger formula
217
218 G4double electronDensity = material->GetElectronDensity();
219 G4double Zeff = electronDensity/material->GetTotNbOfAtomsPerVolume();
220 G4double th = 0.25*sqrt(Zeff)*keV;
221 G4double tkin = kineticEnergy;
222 G4bool lowEnergy = false;
223 if (kineticEnergy < th) {
224 tkin = th;
225 lowEnergy = true;
226 }
227 G4double tau = tkin/electron_mass_c2;
228 G4double gam = tau + 1.0;
229 G4double gamma2= gam*gam;
230 G4double beta2 = 1. - 1./gamma2;
231 G4double bg2 = beta2*gamma2;
232
233 G4double eexc = material->GetIonisation()->GetMeanExcitationEnergy();
234 eexc /= electron_mass_c2;
235 G4double eexc2 = eexc*eexc;
236
237 G4double d = min(cutEnergy, MaxSecondaryEnergy(p, tkin))/electron_mass_c2;
238 G4double dedx;
239
240 // electron
241 if (isElectron) {
242
243 dedx = log(2.0*(tau + 2.0)/eexc2) - 1.0 - beta2
244 + log((tau-d)*d) + tau/(tau-d)
245 + (0.5*d*d + (2.0*tau + 1.)*log(1. - d/tau))/gamma2;
246
247 //positron
248 } else {
249
250 G4double d2 = d*d*0.5;
251 G4double d3 = d2*d/1.5;
252 G4double d4 = d3*d*3.75;
253 G4double y = 1.0/(1.0 + gam);
254 dedx = log(2.0*(tau + 2.0)/eexc2) + log(tau*d)
255 - beta2*(tau + 2.0*d - y*(3.0*d2
256 + y*(d - d3 + y*(d2 - tau*d3 + d4))))/tau;
257 }
258
259 //density correction
260 G4double cden = material->GetIonisation()->GetCdensity();
261 G4double mden = material->GetIonisation()->GetMdensity();
262 G4double aden = material->GetIonisation()->GetAdensity();
263 G4double x0den = material->GetIonisation()->GetX0density();
264 G4double x1den = material->GetIonisation()->GetX1density();
265 G4double x = log(bg2)/twoln10;
266
267 if (x >= x0den) {
268 dedx -= twoln10*x - cden;
269 if (x < x1den) dedx -= aden*pow(x1den-x, mden);
270 }
271
272 // now you can compute the total ionization loss
273 dedx *= twopi_mc2_rcl2*electronDensity/beta2;
274 if (dedx < 0.0) dedx = 0.0;
275
276 // lowenergy extrapolation
277
278 if (lowEnergy) {
279
280 if (kineticEnergy >= lowLimit) dedx *= sqrt(tkin/kineticEnergy);
281 else dedx *= sqrt(tkin*kineticEnergy)/lowLimit;
282
283 }
284 return dedx;
285}
286
287//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
288
289void G4MollerBhabhaModel::SampleSecondaries(std::vector<G4DynamicParticle*>* vdp,
290 const G4MaterialCutsCouple*,
291 const G4DynamicParticle* dp,
292 G4double tmin,
293 G4double maxEnergy)
294{
295 G4double kineticEnergy = dp->GetKineticEnergy();
296 G4double tmax = kineticEnergy;
297 if(isElectron) tmax *= 0.5;
298 if(maxEnergy < tmax) tmax = maxEnergy;
299 if(tmin >= tmax) return;
300
301 G4double energy = kineticEnergy + electron_mass_c2;
302 G4double totalMomentum = sqrt(kineticEnergy*(energy + electron_mass_c2));
303 G4double xmin = tmin/kineticEnergy;
304 G4double xmax = tmax/kineticEnergy;
305 G4double gam = energy/electron_mass_c2;
306 G4double gamma2 = gam*gam;
307 G4double beta2 = 1.0 - 1.0/gamma2;
308 G4double x, z, q, grej;
309
310 G4ThreeVector direction = dp->GetMomentumDirection();
311
312 //Moller (e-e-) scattering
313 if (isElectron) {
314
315 G4double g = (2.0*gam - 1.0)/gamma2;
316 G4double y = 1.0 - xmax;
317 grej = 1.0 - g*xmax + xmax*xmax*(1.0 - g + (1.0 - g*y)/(y*y));
318
319 do {
320 q = G4UniformRand();
321 x = xmin*xmax/(xmin*(1.0 - q) + xmax*q);
322 y = 1.0 - x;
323 z = 1.0 - g*x + x*x*(1.0 - g + (1.0 - g*y)/(y*y));
324 /*
325 if(z > grej) {
326 G4cout << "G4MollerBhabhaModel::SampleSecondary Warning! "
327 << "Majorant " << grej << " < "
328 << z << " for x= " << x
329 << " e-e- scattering"
330 << G4endl;
331 }
332 */
333 } while(grej * G4UniformRand() > z);
334
335 //Bhabha (e+e-) scattering
336 } else {
337
338 G4double y = 1.0/(1.0 + gam);
339 G4double y2 = y*y;
340 G4double y12 = 1.0 - 2.0*y;
341 G4double b1 = 2.0 - y2;
342 G4double b2 = y12*(3.0 + y2);
343 G4double y122= y12*y12;
344 G4double b4 = y122*y12;
345 G4double b3 = b4 + y122;
346
347 y = xmax*xmax;
348 grej = 1.0 + (y*y*b4 - xmin*xmin*xmin*b3 + y*b2 - xmin*b1)*beta2;
349 do {
350 q = G4UniformRand();
351 x = xmin*xmax/(xmin*(1.0 - q) + xmax*q);
352 y = x*x;
353 z = 1.0 + (y*y*b4 - x*y*b3 + y*b2 - x*b1)*beta2;
354 /*
355 if(z > grej) {
356 G4cout << "G4MollerBhabhaModel::SampleSecondary Warning! "
357 << "Majorant " << grej << " < "
358 << z << " for x= " << x
359 << " e+e- scattering"
360 << G4endl;
361 }
362 */
363 } while(grej * G4UniformRand() > z);
364 }
365
366 G4double deltaKinEnergy = x * kineticEnergy;
367
368 G4double deltaMomentum =
369 sqrt(deltaKinEnergy * (deltaKinEnergy + 2.0*electron_mass_c2));
370 G4double cost = deltaKinEnergy * (energy + electron_mass_c2) /
371 (deltaMomentum * totalMomentum);
372 G4double sint = 1.0 - cost*cost;
373 if(sint > 0.0) sint = sqrt(sint);
374
375 G4double phi = twopi * G4UniformRand() ;
376
377 G4ThreeVector deltaDirection(sint*cos(phi),sint*sin(phi), cost) ;
378 deltaDirection.rotateUz(direction);
379
380 // primary change
381 kineticEnergy -= deltaKinEnergy;
382 fParticleChange->SetProposedKineticEnergy(kineticEnergy);
383
384 if(kineticEnergy > DBL_MIN) {
385 G4ThreeVector dir = totalMomentum*direction - deltaMomentum*deltaDirection;
386 direction = dir.unit();
387 fParticleChange->SetProposedMomentumDirection(direction);
388 }
389
390 // create G4DynamicParticle object for delta ray
391 G4DynamicParticle* delta = new G4DynamicParticle(theElectron,
392 deltaDirection,deltaKinEnergy);
393 vdp->push_back(delta);
394}
395
396//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Note: See TracBrowser for help on using the repository browser.