source: trunk/source/processes/electromagnetic/highenergy/src/G4mplIonisationModel.cc @ 1050

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

update to geant4.9.2

File size: 6.9 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: G4mplIonisationModel.cc,v 1.5 2007/11/13 18:36:29 vnivanch Exp $
27// GEANT4 tag $Name: geant4-09-02 $
28//
29// -------------------------------------------------------------------
30//
31// GEANT4 Class header file
32//
33//
34// File name:     G4mplIonisationModel
35//
36// Author:        Vladimir Ivanchenko
37//
38// Creation date: 06.09.2005
39//
40// Modifications:
41// 12.08.2007 Changing low energy approximation and extrapolation.
42//            Small bug fixing and refactoring (M. Vladymyrov)
43// 13.11.2007 Use low-energy asymptotic from [3] (V.Ivanchenko)
44//
45//
46// -------------------------------------------------------------------
47// References
48// [1] Steven P. Ahlen: Energy loss of relativistic heavy ionizing particles,
49//     S.P. Ahlen, Rev. Mod. Phys 52(1980), p121
50// [2] K.A. Milton arXiv:hep-ex/0602040
51// [3] S.P. Ahlen and K. Kinoshita, Phys. Rev. D26 (1982) 2347
52
53
54//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
55//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
56
57#include "G4mplIonisationModel.hh"
58#include "Randomize.hh"
59#include "G4LossTableManager.hh"
60#include "G4ParticleChangeForLoss.hh"
61
62//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
63
64using namespace std;
65
66G4mplIonisationModel::G4mplIonisationModel(G4double mCharge, const G4String& nam)
67  : G4VEmModel(nam),G4VEmFluctuationModel(nam),
68  magCharge(mCharge),
69  twoln10(log(100.0)),
70  betalow(0.01),
71  betalim(0.1),
72  beta2lim(betalim*betalim),
73  bg2lim(beta2lim*(1.0 + beta2lim))
74{
75  nmpl         = G4int(abs(magCharge) * 2 * fine_structure_const + 0.5);
76  if(nmpl > 6)      nmpl = 6;
77  else if(nmpl < 1) nmpl = 1;
78  pi_hbarc2_over_mc2 = pi * hbarc * hbarc / electron_mass_c2;
79  chargeSquare = magCharge * magCharge;
80  dedxlim = 45.*nmpl*nmpl*GeV*cm2/g;
81}
82
83//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
84
85G4mplIonisationModel::~G4mplIonisationModel()
86{}
87
88//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
89
90void G4mplIonisationModel::Initialise(const G4ParticleDefinition* p,
91                                      const G4DataVector&)
92{
93  monopole = p;
94  mass     = monopole->GetPDGMass();
95
96  if(pParticleChange) 
97    fParticleChange = reinterpret_cast<G4ParticleChangeForLoss*>(pParticleChange);
98  else 
99    fParticleChange = new G4ParticleChangeForLoss();
100}
101
102//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
103
104G4double G4mplIonisationModel::ComputeDEDXPerVolume(const G4Material* material,
105                                                    const G4ParticleDefinition*,
106                                                    G4double kineticEnergy,
107                                                    G4double)
108{
109  G4double tau   = kineticEnergy / mass;
110  G4double gam   = tau + 1.0;
111  G4double bg2   = tau * (tau + 2.0);
112  G4double beta2 = bg2 / (gam * gam);
113  G4double beta  = sqrt(beta2);
114
115  // low-energy asymptotic formula
116  G4double dedx  = dedxlim*beta*material->GetDensity();
117
118  // above asymptotic
119  if(beta > betalow) {
120
121    // high energy
122    if(beta >= betalim) {
123      dedx = ComputeDEDXAhlen(material, bg2);
124
125    } else {
126
127      G4double dedx1 = dedxlim*betalow*material->GetDensity();
128      G4double dedx2 = ComputeDEDXAhlen(material, bg2lim);
129
130      // extrapolation between two formula
131      G4double kapa2 = beta - betalow;
132      G4double kapa1 = betalim - beta;
133      dedx = (kapa1*dedx1 + kapa2*dedx2)/(kapa1 + kapa2);
134    }
135  }
136  return dedx;
137}
138
139//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
140
141G4double G4mplIonisationModel::ComputeDEDXAhlen(const G4Material* material, G4double bg2)
142{
143  G4double eDensity = material->GetElectronDensity();
144  G4double eexc  = material->GetIonisation()->GetMeanExcitationEnergy();
145  G4double cden  = material->GetIonisation()->GetCdensity();
146  G4double mden  = material->GetIonisation()->GetMdensity();
147  G4double aden  = material->GetIonisation()->GetAdensity();
148  G4double x0den = material->GetIonisation()->GetX0density();
149  G4double x1den = material->GetIonisation()->GetX1density();
150
151  // Ahlen's formula for nonconductors, [1]p157, f(5.7)
152  G4double dedx = log(2.0 * electron_mass_c2 * bg2 / eexc) - 0.5;
153
154  // Kazama et al. cross-section correction
155  G4double  k = 0.406;
156  if(nmpl > 1) k = 0.346;
157
158  // Bloch correction
159  const G4double B[7] = { 0.0, 0.248, 0.672, 1.022, 1.243, 1.464, 1.685}; 
160
161  dedx += 0.5 * k - B[nmpl];
162
163  // density effect correction
164  G4double deltam;
165  G4double x = log(bg2) / twoln10;
166  if ( x >= x0den ) {
167    deltam = twoln10 * x - cden;
168    if ( x < x1den ) deltam += aden * pow((x1den-x), mden);
169    dedx -= 0.5 * deltam;
170  }
171
172  // now compute the total ionization loss
173  dedx *=  pi_hbarc2_over_mc2 * eDensity * nmpl * nmpl;
174
175  if (dedx < 0.0) dedx = 0;
176  return dedx;
177}
178
179//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
180
181G4double G4mplIonisationModel::SampleFluctuations(
182                                       const G4Material* material,
183                                       const G4DynamicParticle* dp,
184                                       G4double& tmax,
185                                       G4double& length,
186                                       G4double& meanLoss)
187{
188  G4double siga = Dispersion(material,dp,tmax,length);
189  G4double loss = meanLoss;
190  siga = sqrt(siga);
191  G4double twomeanLoss = meanLoss + meanLoss;
192
193  if(twomeanLoss < siga) {
194    G4double x;
195    do {
196      loss = twomeanLoss*G4UniformRand();
197      x = (loss - meanLoss)/siga;
198    } while (1.0 - 0.5*x*x < G4UniformRand());
199  } else {
200    do {
201      loss = G4RandGauss::shoot(meanLoss,siga);
202    } while (0.0 > loss || loss > twomeanLoss);
203  }
204  return loss;
205}
Note: See TracBrowser for help on using the repository browser.