Geant4  10.02.p01
G4MuBetheBlochModel.cc
Go to the documentation of this file.
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: G4MuBetheBlochModel.cc 91743 2015-08-04 11:49:58Z gcosmo $
27 //
28 // -------------------------------------------------------------------
29 //
30 // GEANT4 Class header file
31 //
32 //
33 // File name: G4MuBetheBlochModel
34 //
35 // Author: Vladimir Ivanchenko on base of Laszlo Urban code
36 //
37 // Creation date: 09.08.2002
38 //
39 // Modifications:
40 //
41 // 04-12-02 Fix problem of G4DynamicParticle constructor (V.Ivanchenko)
42 // 23-12-02 Change interface in order to move to cut per region (V.Ivanchenko)
43 // 27-01-03 Make models region aware (V.Ivanchenko)
44 // 13-02-03 Add name (V.Ivanchenko)
45 // 10-02-04 Calculation of radiative corrections using R.Kokoulin model (V.I)
46 // 08-04-05 Major optimisation of internal interfaces (V.Ivantchenko)
47 // 12-04-05 Add usage of G4EmCorrections (V.Ivanchenko)
48 // 13-02-06 ComputeCrossSectionPerElectron, ComputeCrossSectionPerAtom (mma)
49 //
50 
51 //
52 // -------------------------------------------------------------------
53 //
54 
55 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
56 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
57 
58 #include "G4MuBetheBlochModel.hh"
59 #include "G4PhysicalConstants.hh"
60 #include "G4SystemOfUnits.hh"
61 #include "Randomize.hh"
62 #include "G4Electron.hh"
63 #include "G4LossTableManager.hh"
64 #include "G4EmCorrections.hh"
66 #include "G4Log.hh"
67 #include "G4Exp.hh"
68 
69 G4double G4MuBetheBlochModel::xgi[]={ 0.0199, 0.1017, 0.2372, 0.4083, 0.5917,
70  0.7628, 0.8983, 0.9801 };
71 
72 G4double G4MuBetheBlochModel::wgi[]={ 0.0506, 0.1112, 0.1569, 0.1813, 0.1813,
73  0.1569, 0.1112, 0.0506 };
74 
75 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
76 
77 using namespace std;
78 
80  const G4String& nam)
81  : G4VEmModel(nam),
82  particle(0),
83  limitKinEnergy(100.*keV),
84  logLimitKinEnergy(G4Log(limitKinEnergy)),
85  twoln10(2.0*G4Log(10.0)),
86  bg2lim(0.0169),
87  taulim(8.4146e-3),
88  alphaprime(fine_structure_const/twopi)
89 {
92  fParticleChange = 0;
93 
94  // initial initialisation of memeber should be overwritten
95  // by SetParticle
96  mass = massSquare = ratio = 1.0;
97 
98  if(p) { SetParticle(p); }
99 }
100 
101 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
102 
104 {}
105 
106 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
107 
109  const G4MaterialCutsCouple* couple)
110 {
111  return couple->GetMaterial()->GetIonisation()->GetMeanExcitationEnergy();
112 }
113 
114 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
115 
117  G4double kinEnergy)
118 {
119  G4double tau = kinEnergy/mass;
120  G4double tmax = 2.0*electron_mass_c2*tau*(tau + 2.) /
121  (1. + 2.0*(tau + 1.)*ratio + ratio*ratio);
122  return tmax;
123 }
124 
125 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
126 
128  const G4DataVector&)
129 {
130  if(p) { SetParticle(p); }
132 }
133 
134 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
135 
137  const G4ParticleDefinition* p,
138  G4double kineticEnergy,
139  G4double cutEnergy,
140  G4double maxKinEnergy)
141 {
142  G4double cross = 0.0;
143  G4double tmax = MaxSecondaryEnergy(p, kineticEnergy);
144  G4double maxEnergy = min(tmax,maxKinEnergy);
145  if(cutEnergy < maxEnergy) {
146 
147  G4double totEnergy = kineticEnergy + mass;
148  G4double energy2 = totEnergy*totEnergy;
149  G4double beta2 = kineticEnergy*(kineticEnergy + 2.0*mass)/energy2;
150 
151  cross = 1.0/cutEnergy - 1.0/maxEnergy - beta2*G4Log(maxEnergy/cutEnergy)/tmax
152  + 0.5*(maxEnergy - cutEnergy)/energy2;
153 
154  // radiative corrections of R. Kokoulin
155  if (maxEnergy > limitKinEnergy) {
156 
157  G4double logtmax = G4Log(maxEnergy);
158  G4double logtmin = G4Log(max(cutEnergy,limitKinEnergy));
159  G4double logstep = logtmax - logtmin;
160  G4double dcross = 0.0;
161 
162  for (G4int ll=0; ll<8; ll++)
163  {
164  G4double ep = G4Exp(logtmin + xgi[ll]*logstep);
165  G4double a1 = G4Log(1.0 + 2.0*ep/electron_mass_c2);
166  G4double a3 = G4Log(4.0*totEnergy*(totEnergy - ep)/massSquare);
167  dcross += wgi[ll]*(1.0/ep - beta2/tmax + 0.5*ep/energy2)*a1*(a3 - a1);
168  }
169 
170  cross += dcross*logstep*alphaprime;
171  }
172 
173  cross *= twopi_mc2_rcl2/beta2;
174 
175  }
176 
177  // G4cout << "tmin= " << cutEnergy << " tmax= " << tmax
178  // << " cross= " << cross << G4endl;
179 
180  return cross;
181 }
182 
183 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
184 
186  const G4ParticleDefinition* p,
187  G4double kineticEnergy,
188  G4double Z, G4double,
189  G4double cutEnergy,
190  G4double maxEnergy)
191 {
193  (p,kineticEnergy,cutEnergy,maxEnergy);
194  return cross;
195 }
196 
197 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
198 
200  const G4Material* material,
201  const G4ParticleDefinition* p,
202  G4double kineticEnergy,
203  G4double cutEnergy,
204  G4double maxEnergy)
205 {
206  G4double eDensity = material->GetElectronDensity();
208  (p,kineticEnergy,cutEnergy,maxEnergy);
209  return cross;
210 }
211 
212 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
213 
215  const G4ParticleDefinition* p,
216  G4double kineticEnergy,
217  G4double cut)
218 {
219  G4double tmax = MaxSecondaryEnergy(p, kineticEnergy);
220  G4double tau = kineticEnergy/mass;
221  G4double cutEnergy = min(cut,tmax);
222  G4double gam = tau + 1.0;
223  G4double bg2 = tau * (tau+2.0);
224  G4double beta2 = bg2/(gam*gam);
225 
226  G4double eexc = material->GetIonisation()->GetMeanExcitationEnergy();
227  G4double eexc2 = eexc*eexc;
228 
229  G4double eDensity = material->GetElectronDensity();
230 
231  G4double dedx = G4Log(2.0*electron_mass_c2*bg2*cutEnergy/eexc2)
232  -(1.0 + cutEnergy/tmax)*beta2;
233 
234  G4double totEnergy = kineticEnergy + mass;
235  G4double del = 0.5*cutEnergy/totEnergy;
236  dedx += del*del;
237 
238  // density correction
239  G4double x = G4Log(bg2)/twoln10;
240  dedx -= material->GetIonisation()->DensityCorrection(x);
241 
242  // shell correction
243  dedx -= 2.0*corr->ShellCorrection(p,material,kineticEnergy);
244 
245  // now compute the total ionization loss
246 
247  if (dedx < 0.0) dedx = 0.0 ;
248 
249  // radiative corrections of R. Kokoulin
250  if (cutEnergy > limitKinEnergy) {
251 
252  G4double logtmax = G4Log(cutEnergy);
253  G4double logstep = logtmax - logLimitKinEnergy;
254  G4double dloss = 0.0;
255  G4double ftot2= 0.5/(totEnergy*totEnergy);
256 
257  for (G4int ll=0; ll<8; ll++)
258  {
259  G4double ep = G4Exp(logLimitKinEnergy + xgi[ll]*logstep);
260  G4double a1 = G4Log(1.0 + 2.0*ep/electron_mass_c2);
261  G4double a3 = G4Log(4.0*totEnergy*(totEnergy - ep)/massSquare);
262  dloss += wgi[ll]*(1.0 - beta2*ep/tmax + ep*ep*ftot2)*a1*(a3 - a1);
263  }
264  dedx += dloss*logstep*alphaprime;
265  }
266 
267  dedx *= twopi_mc2_rcl2*eDensity/beta2;
268 
269  //High order corrections
270  dedx += corr->HighOrderCorrections(p,material,kineticEnergy,cutEnergy);
271 
272  return dedx;
273 }
274 
275 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
276 
277 void G4MuBetheBlochModel::SampleSecondaries(vector<G4DynamicParticle*>* vdp,
278  const G4MaterialCutsCouple*,
279  const G4DynamicParticle* dp,
280  G4double minKinEnergy,
281  G4double maxEnergy)
282 {
283  G4double tmax = MaxSecondaryKinEnergy(dp);
284  G4double maxKinEnergy = min(maxEnergy,tmax);
285  if(minKinEnergy >= maxKinEnergy) { return; }
286 
287  G4double kineticEnergy = dp->GetKineticEnergy();
288  G4double totEnergy = kineticEnergy + mass;
289  G4double etot2 = totEnergy*totEnergy;
290  G4double beta2 = kineticEnergy*(kineticEnergy + 2.0*mass)/etot2;
291 
292  G4double grej = 1.;
293  if(tmax > limitKinEnergy) {
294  G4double a0 = G4Log(2.*totEnergy/mass);
295  grej += alphaprime*a0*a0;
296  }
297 
298  G4double deltaKinEnergy, f;
299 
300  // sampling follows ...
301  do {
302  G4double q = G4UniformRand();
303  deltaKinEnergy = minKinEnergy*maxKinEnergy
304  /(minKinEnergy*(1.0 - q) + maxKinEnergy*q);
305 
306 
307  f = 1.0 - beta2*deltaKinEnergy/tmax
308  + 0.5*deltaKinEnergy*deltaKinEnergy/etot2;
309 
310  if(deltaKinEnergy > limitKinEnergy) {
311  G4double a1 = G4Log(1.0 + 2.0*deltaKinEnergy/electron_mass_c2);
312  G4double a3 = G4Log(4.0*totEnergy*(totEnergy - deltaKinEnergy)/massSquare);
313  f *= (1. + alphaprime*a1*(a3 - a1));
314  }
315 
316  if(f > grej) {
317  G4cout << "G4MuBetheBlochModel::SampleSecondary Warning! "
318  << "Majorant " << grej << " < "
319  << f << " for edelta= " << deltaKinEnergy
320  << " tmin= " << minKinEnergy << " max= " << maxKinEnergy
321  << G4endl;
322  }
323  // Loop checking, 03-Aug-2015, Vladimir Ivanchenko
324  } while( grej*G4UniformRand() > f );
325 
326  G4double deltaMomentum =
327  sqrt(deltaKinEnergy * (deltaKinEnergy + 2.0*electron_mass_c2));
328  G4double totalMomentum = totEnergy*sqrt(beta2);
329  G4double cost = deltaKinEnergy * (totEnergy + electron_mass_c2) /
330  (deltaMomentum * totalMomentum);
331 
332  G4double sint = sqrt(1.0 - cost*cost);
333 
334  G4double phi = twopi * G4UniformRand() ;
335 
336  G4ThreeVector deltaDirection(sint*cos(phi),sint*sin(phi), cost) ;
337  G4ThreeVector direction = dp->GetMomentumDirection();
338  deltaDirection.rotateUz(direction);
339 
340  // primary change
341  kineticEnergy -= deltaKinEnergy;
342  G4ThreeVector dir = totalMomentum*direction - deltaMomentum*deltaDirection;
343  direction = dir.unit();
346 
347  // create G4DynamicParticle object for delta ray
349  deltaDirection,deltaKinEnergy);
350  vdp->push_back(delta);
351 }
352 
353 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
const G4double a0
G4ParticleChangeForLoss * fParticleChange
G4double MaxSecondaryKinEnergy(const G4DynamicParticle *dynParticle)
Definition: G4VEmModel.hh:482
G4IonisParamMat * GetIonisation() const
Definition: G4Material.hh:226
static G4double wgi[8]
G4double HighOrderCorrections(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy, G4double cutEnergy)
static G4LossTableManager * Instance()
G4ParticleChangeForLoss * GetParticleChangeForLoss()
Definition: G4VEmModel.cc:120
G4double GetKineticEnergy() const
CLHEP::Hep3Vector G4ThreeVector
static const G4double a1
virtual G4double CrossSectionPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy, G4double maxEnergy)
virtual G4double ComputeCrossSectionPerElectron(const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy, G4double maxEnergy)
virtual G4double MinEnergyCut(const G4ParticleDefinition *, const G4MaterialCutsCouple *)
int G4int
Definition: G4Types.hh:78
static const G4double bg2lim
G4ParticleDefinition * theElectron
#define G4UniformRand()
Definition: Randomize.hh:97
G4GLOB_DLL std::ostream G4cout
G4double GetElectronDensity() const
Definition: G4Material.hh:217
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kineticEnergy, G4double Z, G4double A, G4double cutEnergy, G4double maxEnergy)
G4EmCorrections * EmCorrections()
const G4ThreeVector & GetMomentumDirection() const
static const double twopi
Definition: G4SIunits.hh:75
void SetProposedKineticEnergy(G4double proposedKinEnergy)
virtual G4double ComputeDEDXPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy)
void SetProposedMomentumDirection(const G4ThreeVector &dir)
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy)
static const G4double a3
G4double G4Log(G4double x)
Definition: G4Log.hh:230
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
Definition: G4Exp.hh:183
G4double ShellCorrection(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
G4double DensityCorrection(G4double x)
T max(const T t1, const T t2)
brief Return the largest of the two arguments
G4EmCorrections * corr
const G4double x[NPOINTSGL]
virtual G4double MaxSecondaryEnergy(const G4ParticleDefinition *, G4double kinEnergy)
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
G4double GetMeanExcitationEnergy() const
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &)
static G4Electron * Electron()
Definition: G4Electron.cc:94
static const G4double twoln10
#define G4endl
Definition: G4ios.hh:61
static G4double xgi[8]
static const double keV
Definition: G4SIunits.hh:213
G4MuBetheBlochModel(const G4ParticleDefinition *p=0, const G4String &nam="MuBetheBloch")
double G4double
Definition: G4Types.hh:76
void SetParticle(const G4ParticleDefinition *p)
const G4Material * GetMaterial() const