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

Last change on this file since 961 was 961, checked in by garnier, 15 years ago

update processes

File size: 13.7 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.31 2009/02/20 12:06:37 vnivanch Exp $
27// GEANT4 tag $Name: geant4-09-02-ref-02 $
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  if(pParticleChange) {
123    fParticleChange = reinterpret_cast<G4ParticleChangeForLoss*>
124                                                     (pParticleChange);
125  } else {
126    fParticleChange = new G4ParticleChangeForLoss();
127  }
128}
129
130//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
131
132G4double G4MollerBhabhaModel::ComputeCrossSectionPerElectron(
133                                           const G4ParticleDefinition* p,
134                                                 G4double kineticEnergy,
135                                                 G4double cutEnergy,
136                                                 G4double maxEnergy)
137{
138  if(!particle) SetParticle(p);
139
140  G4double cross = 0.0;
141  G4double tmax = MaxSecondaryEnergy(p, kineticEnergy);
142  tmax = min(maxEnergy, tmax);
143
144  if(cutEnergy < tmax) {
145
146    G4double xmin  = cutEnergy/kineticEnergy;
147    G4double xmax  = tmax/kineticEnergy;
148    G4double gam   = kineticEnergy/electron_mass_c2 + 1.0;
149    G4double gamma2= gam*gam;
150    G4double beta2 = 1.0 - 1.0/gamma2;
151
152    //Moller (e-e-) scattering
153    if (isElectron) {
154
155      G4double g     = (2.0*gam - 1.0)/gamma2;
156      cross = ((xmax - xmin)*(1.0 - g + 1.0/(xmin*xmax)
157                              + 1.0/((1.0-xmin)*(1.0 - xmax)))
158            - g*log( xmax*(1.0 - xmin)/(xmin*(1.0 - xmax)) ) ) / beta2;
159
160    //Bhabha (e+e-) scattering
161    } else {
162
163      G4double y   = 1.0/(1.0 + gam);
164      G4double y2  = y*y;
165      G4double y12 = 1.0 - 2.0*y;
166      G4double b1  = 2.0 - y2;
167      G4double b2  = y12*(3.0 + y2);
168      G4double y122= y12*y12;
169      G4double b4  = y122*y12;
170      G4double b3  = b4 + y122;
171
172      cross = (xmax - xmin)*(1.0/(beta2*xmin*xmax) + b2
173            - 0.5*b3*(xmin + xmax)
174            + b4*(xmin*xmin + xmin*xmax + xmax*xmax)/3.0)
175            - b1*log(xmax/xmin);
176    }
177
178    cross *= twopi_mc2_rcl2/kineticEnergy;
179  }
180  return cross;
181}
182
183//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
184
185G4double G4MollerBhabhaModel::ComputeCrossSectionPerAtom(
186                                           const G4ParticleDefinition* p,
187                                                 G4double kineticEnergy,
188                                                 G4double Z, G4double,
189                                                 G4double cutEnergy,
190                                                 G4double maxEnergy)
191{
192  G4double cross = Z*ComputeCrossSectionPerElectron
193                                         (p,kineticEnergy,cutEnergy,maxEnergy);
194  return cross;
195}
196
197//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
198
199G4double G4MollerBhabhaModel::CrossSectionPerVolume(
200                                           const G4Material* material,
201                                           const G4ParticleDefinition* p,
202                                                 G4double kineticEnergy,
203                                                 G4double cutEnergy,
204                                                 G4double maxEnergy)
205{
206  G4double eDensity = material->GetElectronDensity();
207  G4double cross = eDensity*ComputeCrossSectionPerElectron
208                                         (p,kineticEnergy,cutEnergy,maxEnergy);
209  return cross;
210}
211
212//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
213
214G4double G4MollerBhabhaModel::ComputeDEDXPerVolume(
215                                          const G4Material* material,
216                                          const G4ParticleDefinition* p,
217                                                G4double kineticEnergy,
218                                                G4double cutEnergy)
219{
220  if(!particle) SetParticle(p);
221  // calculate the dE/dx due to the ionization by Seltzer-Berger formula
222 
223  G4double electronDensity = material->GetElectronDensity();
224  G4double Zeff  = electronDensity/material->GetTotNbOfAtomsPerVolume();
225  G4double th    = 0.25*sqrt(Zeff)*keV;
226  G4double tkin  = kineticEnergy;
227  G4bool   lowEnergy = false;
228  if (kineticEnergy < th) {
229    tkin = th;
230    lowEnergy = true;
231  }
232  G4double tau   = tkin/electron_mass_c2;
233  G4double gam   = tau + 1.0;
234  G4double gamma2= gam*gam;
235  G4double beta2 = 1. - 1./gamma2;
236  G4double bg2   = beta2*gamma2;
237
238  G4double eexc  = material->GetIonisation()->GetMeanExcitationEnergy();
239  eexc          /= electron_mass_c2;
240  G4double eexc2 = eexc*eexc; 
241
242  G4double d = min(cutEnergy, MaxSecondaryEnergy(p, tkin))/electron_mass_c2;
243  G4double dedx;
244
245  // electron
246  if (isElectron) {
247
248    dedx = log(2.0*(tau + 2.0)/eexc2) - 1.0 - beta2
249         + log((tau-d)*d) + tau/(tau-d)
250         + (0.5*d*d + (2.0*tau + 1.)*log(1. - d/tau))/gamma2;
251   
252  //positron
253  } else {
254
255    G4double d2 = d*d*0.5;
256    G4double d3 = d2*d/1.5;
257    G4double d4 = d3*d*3.75;
258    G4double y  = 1.0/(1.0 + gam);
259    dedx = log(2.0*(tau + 2.0)/eexc2) + log(tau*d)
260         - beta2*(tau + 2.0*d - y*(3.0*d2
261         + y*(d - d3 + y*(d2 - tau*d3 + d4))))/tau;
262  } 
263
264  //density correction
265  G4double cden  = material->GetIonisation()->GetCdensity();
266  G4double mden  = material->GetIonisation()->GetMdensity();
267  G4double aden  = material->GetIonisation()->GetAdensity();
268  G4double x0den = material->GetIonisation()->GetX0density();
269  G4double x1den = material->GetIonisation()->GetX1density();
270  G4double x     = log(bg2)/twoln10;
271
272  if (x >= x0den) {
273    dedx -= twoln10*x - cden;
274    if (x < x1den) dedx -= aden*pow(x1den-x, mden);
275  } 
276
277  // now you can compute the total ionization loss
278  dedx *= twopi_mc2_rcl2*electronDensity/beta2;
279  if (dedx < 0.0) dedx = 0.0;
280
281  // lowenergy extrapolation
282
283  if (lowEnergy) {
284
285    if (kineticEnergy >= lowLimit) dedx *= sqrt(tkin/kineticEnergy);
286    else                           dedx *= sqrt(tkin*kineticEnergy)/lowLimit;
287
288  }
289  return dedx;
290}
291
292//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
293
294void G4MollerBhabhaModel::SampleSecondaries(std::vector<G4DynamicParticle*>* vdp,
295                                            const G4MaterialCutsCouple*,
296                                            const G4DynamicParticle* dp,
297                                            G4double tmin,
298                                            G4double maxEnergy)
299{
300  G4double tmax = std::min(maxEnergy, MaxSecondaryKinEnergy(dp));
301  if(tmin >= tmax) return;
302
303  G4double kineticEnergy = dp->GetKineticEnergy();
304  G4double energy = kineticEnergy + electron_mass_c2;
305  G4double totalMomentum = sqrt(kineticEnergy*(energy + electron_mass_c2));
306  G4double xmin   = tmin/kineticEnergy;
307  G4double xmax   = tmax/kineticEnergy;
308  G4double gam    = energy/electron_mass_c2;
309  G4double gamma2 = gam*gam;
310  G4double beta2  = 1.0 - 1.0/gamma2;
311  G4double x, z, q, grej;
312
313  G4ThreeVector direction = dp->GetMomentumDirection();
314
315  //Moller (e-e-) scattering
316  if (isElectron) {
317
318    G4double g = (2.0*gam - 1.0)/gamma2;
319    G4double y = 1.0 - xmax;
320    grej = 1.0 - g*xmax + xmax*xmax*(1.0 - g + (1.0 - g*y)/(y*y));
321
322    do {
323      q = G4UniformRand();
324      x = xmin*xmax/(xmin*(1.0 - q) + xmax*q);
325      y = 1.0 - x;
326      z = 1.0 - g*x + x*x*(1.0 - g + (1.0 - g*y)/(y*y));
327      /*
328      if(z > grej) {
329        G4cout << "G4MollerBhabhaModel::SampleSecondary Warning! "
330               << "Majorant " << grej << " < "
331               << z << " for x= " << x
332               << " e-e- scattering"
333               << G4endl;
334      }
335      */
336    } while(grej * G4UniformRand() > z);
337
338  //Bhabha (e+e-) scattering
339  } else {
340
341    G4double y   = 1.0/(1.0 + gam);
342    G4double y2  = y*y;
343    G4double y12 = 1.0 - 2.0*y;
344    G4double b1  = 2.0 - y2;
345    G4double b2  = y12*(3.0 + y2);
346    G4double y122= y12*y12;
347    G4double b4  = y122*y12;
348    G4double b3  = b4 + y122;
349
350    y     = xmax*xmax;
351    grej  = -xmin*b1;
352    grej += y*b2;
353    grej -= xmin*xmin*xmin*b3;
354    grej += y*y*b4;
355    grej *= beta2;
356    grej += 1.0;
357    do {
358      q  = G4UniformRand();
359      x  = xmin*xmax/(xmin*(1.0 - q) + xmax*q);
360      z  = -x*b1;
361      y  = x*x;
362      z += y*b2;
363      y *= x;
364      z -= y*b3;
365      y *= x;
366      z += y*b4;
367      z *= beta2;
368      z += 1.0;
369      /*
370      if(z > grej) {
371        G4cout << "G4MollerBhabhaModel::SampleSecondary Warning! "
372               << "Majorant " << grej << " < "
373               << z << " for x= " << x
374               << " e+e- scattering"
375               << G4endl;
376      }
377      */
378    } while(grej * G4UniformRand() > z);
379  }
380
381  G4double deltaKinEnergy = x * kineticEnergy;
382
383  G4double deltaMomentum =
384           sqrt(deltaKinEnergy * (deltaKinEnergy + 2.0*electron_mass_c2));
385  G4double cost = deltaKinEnergy * (energy + electron_mass_c2) /
386                                   (deltaMomentum * totalMomentum);
387  G4double sint = 1.0 - cost*cost;
388  if(sint > 0.0) sint = sqrt(sint);
389
390  G4double phi = twopi * G4UniformRand() ;
391
392  G4ThreeVector deltaDirection(sint*cos(phi),sint*sin(phi), cost) ;
393  deltaDirection.rotateUz(direction);
394
395  // primary change
396  kineticEnergy -= deltaKinEnergy;
397  fParticleChange->SetProposedKineticEnergy(kineticEnergy);
398
399  if(kineticEnergy > DBL_MIN) {
400    G4ThreeVector dir = totalMomentum*direction - deltaMomentum*deltaDirection;
401    direction = dir.unit();
402    fParticleChange->SetProposedMomentumDirection(direction);
403  }
404
405  // create G4DynamicParticle object for delta ray
406  G4DynamicParticle* delta = new G4DynamicParticle(theElectron,
407                                                 deltaDirection,deltaKinEnergy);
408  vdp->push_back(delta);
409}
410
411//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Note: See TracBrowser for help on using the repository browser.