source: trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionChargeDecreasePartial.cc@ 830

Last change on this file since 830 was 819, checked in by garnier, 17 years ago

import all except CVS

  • Property svn:executable set to *
File size: 8.0 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//
27// $Id: G4CrossSectionChargeDecreasePartial.cc,v 1.1 2007/11/08 18:25:25 pia Exp $
28// GEANT4 tag $Name: $
29//
30// Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
31//
32// Reference: TNS Geant4-DNA paper
33// Reference for implementation model: NIM. 155, pp. 145-156, 1978
34
35// History:
36// -----------
37// Date Name Modification
38// 28 Apr 2007 M.G. Pia Created in compliance with design described in TNS paper
39// 08 Nov 2007 MGP Got code from S.I.; added variable initialisation to avoid compilation warnings
40//
41// -------------------------------------------------------------------
42
43// Class description:
44// Geant4-DNA Cross total cross section for electron elastic scattering in water
45// Reference: TNS Geant4-DNA paper
46// S. Chauvie et al., Geant4 physics processes for microdosimetry simulation:
47// design foundation and implementation of the first set of models,
48// IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007.
49// Further documentation available from http://www.ge.infn.it/geant4/dna
50
51// -------------------------------------------------------------------
52
53
54#include "G4CrossSectionChargeDecreasePartial.hh"
55#include "G4ParticleDefinition.hh"
56#include "G4Proton.hh"
57#include "G4DNAGenericIonsManager.hh"
58
59#include "Randomize.hh"
60
61
62G4CrossSectionChargeDecreasePartial::G4CrossSectionChargeDecreasePartial()
63{
64
65 //PROTON
66 f0[0][0]=1.;
67 a0[0][0]=-0.180;
68 a1[0][0]=-3.600;
69 b0[0][0]=-18.22;
70 b1[0][0]=-1.997;
71 c0[0][0]=0.215;
72 d0[0][0]=3.550;
73 x0[0][0]=3.450;
74 x1[0][0]=5.251;
75
76 numberOfPartialCrossSections[0] = 1;
77
78 //ALPHA++
79 f0[0][1]=1.; a0[0][1]=0.95;
80 a1[0][1]=-2.75;
81 b0[0][1]=-23.00;
82 c0[0][1]=0.215;
83 d0[0][1]=2.95;
84 x0[0][1]=3.50;
85
86 f0[1][1]=1.;
87 a0[1][1]=0.95;
88 a1[1][1]=-2.75;
89 b0[1][1]=-23.73;
90 c0[1][1]=0.250;
91 d0[1][1]=3.55;
92 x0[1][1]=3.72;
93
94 x1[0][1]=-1.;
95 b1[0][1]=-1.;
96
97 x1[1][1]=-1.;
98 b1[1][1]=-1.;
99
100 numberOfPartialCrossSections[1] = 2;
101
102 // ALPHA+
103 f0[0][2]=1.;
104 a0[0][2]=0.65;
105 a1[0][2]=-2.75;
106 b0[0][2]=-21.81;
107 c0[0][2]=0.232;
108 d0[0][2]=2.95;
109 x0[0][2]=3.53;
110
111 x1[0][2]=-1.;
112 b1[0][2]=-1.;
113
114 numberOfPartialCrossSections[2] = 1;
115
116}
117
118G4CrossSectionChargeDecreasePartial::~G4CrossSectionChargeDecreasePartial()
119{ }
120
121G4double G4CrossSectionChargeDecreasePartial::CrossSection(G4double k, G4int index,
122 const G4ParticleDefinition* particleDefinition)
123{
124 G4int particleTypeIndex = 0;
125 G4DNAGenericIonsManager* instance;
126 instance = G4DNAGenericIonsManager::Instance();
127
128 if (particleDefinition == G4Proton::ProtonDefinition()) particleTypeIndex=0;
129 if (particleDefinition == instance->GetIon("alpha++")) particleTypeIndex=1;
130 if (particleDefinition == instance->GetIon("alpha+")) particleTypeIndex=2;
131
132 //
133 // sigma(T) = f0 10 ^ y(log10(T/eV))
134 //
135 // / a0 x + b0 x < x0
136 // |
137 // y(x) = < a0 x + b0 - c0 (x - x0)^d0 x0 <= x < x1
138 // |
139 // \ a1 x + b1 x >= x1
140 //
141 //
142 // f0, a0, a1, b0, b1, c0, d0, x0, x1 are parameters that change for protons and helium (0, +, ++)
143 //
144 // f0 has been added to the code in order to manage partial (shell-dependent) cross sections (if no shell dependence is present. f0=1. Sum of f0 over the considered shells should give 1)
145 //
146 // From Rad. Phys. and Chem. 59 (2000) 255-275, M. Dingfelder et al.
147 // Inelastic-collision cross sections of liquid water for interactions of energetic proton
148 //
149
150 if (x1[index][particleTypeIndex]<x0[index][particleTypeIndex])
151 {
152 //
153 // if x1 < x0 means that x1 and b1 will be calculated with the following formula (this piece of code is run on all alphas and not on protons)
154 //
155 // x1 = x0 + ((a0 - a1)/(c0 * d0)) ^ (1 / (d0 - 1))
156 //
157 // b1 = (a0 - a1) * x1 + b0 - c0 * (x1 - x0) ^ d0
158 //
159
160 x1[index][particleTypeIndex]=x0[index][particleTypeIndex] + std::pow((a0[index][particleTypeIndex] - a1[index][particleTypeIndex])
161 / (c0[index][particleTypeIndex] * d0[index][particleTypeIndex]), 1. / (d0[index][particleTypeIndex] - 1.));
162 b1[index][particleTypeIndex]=(a0[index][particleTypeIndex] - a1[index][particleTypeIndex]) * x1[index][particleTypeIndex]
163 + b0[index][particleTypeIndex] - c0[index][particleTypeIndex] * std::pow(x1[index][particleTypeIndex]
164 - x0[index][particleTypeIndex], d0[index][particleTypeIndex]);
165 }
166
167 G4double x(std::log10(k/eV));
168 G4double y;
169
170 if (x<x0[index][particleTypeIndex])
171 y=a0[index][particleTypeIndex] * x + b0[index][particleTypeIndex];
172 else if (x<x1[index][particleTypeIndex])
173 y=a0[index][particleTypeIndex] * x + b0[index][particleTypeIndex] - c0[index][particleTypeIndex]
174 * std::pow(x - x0[index][particleTypeIndex], d0[index][particleTypeIndex]);
175 else
176 y=a1[index][particleTypeIndex] * x + b1[index][particleTypeIndex];
177
178 return f0[index][particleTypeIndex] * std::pow(10., y)*m*m;
179
180}
181
182G4int G4CrossSectionChargeDecreasePartial::RandomSelect(G4double k,
183 const G4ParticleDefinition* particleDefinition)
184{
185 G4int particleTypeIndex = 0;
186 G4DNAGenericIonsManager *instance;
187 instance = G4DNAGenericIonsManager::Instance();
188
189 if (particleDefinition == G4Proton::ProtonDefinition()) particleTypeIndex = 0;
190 if (particleDefinition == instance->GetIon("alpha++")) particleTypeIndex = 1;
191 if (particleDefinition == instance->GetIon("alpha+")) particleTypeIndex = 2;
192
193 const G4int n = numberOfPartialCrossSections[particleTypeIndex];
194 G4double* values(new G4double[n]);
195 G4double value(0);
196 G4int i = n;
197
198 while (i>0)
199 {
200 i--;
201 values[i]=CrossSection(k, i, particleDefinition);
202 value+=values[i];
203 }
204
205 value*=G4UniformRand();
206
207 i=n;
208 while (i>0)
209 {
210 i--;
211
212 if (values[i]>value)
213 break;
214
215 value-=values[i];
216 }
217
218 delete[] values;
219
220 return i;
221}
222
223G4double G4CrossSectionChargeDecreasePartial::Sum(G4double k, const G4ParticleDefinition* particleDefinition)
224{
225 G4int particleTypeIndex = 0;
226 G4DNAGenericIonsManager* instance;
227 instance = G4DNAGenericIonsManager::Instance();
228
229 if (particleDefinition == G4Proton::ProtonDefinition()) particleTypeIndex=0;
230 if (particleDefinition == instance->GetIon("alpha++")) particleTypeIndex=1;
231 if (particleDefinition == instance->GetIon("alpha+")) particleTypeIndex=2;
232
233 G4double totalCrossSection = 0.;
234
235 for (G4int i=0; i<numberOfPartialCrossSections[particleTypeIndex]; i++)
236 {
237 totalCrossSection += CrossSection(k,i,particleDefinition);
238 }
239 return totalCrossSection;
240}
241
242
Note: See TracBrowser for help on using the repository browser.