source: trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionChargeIncreasePartial.cc @ 836

Last change on this file since 836 was 819, checked in by garnier, 16 years ago

import all except CVS

  • Property svn:executable set to *
File size: 7.5 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: G4CrossSectionChargeIncreasePartial.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//
40// -------------------------------------------------------------------
41
42// Class description:
43// Geant4-DNA Cross total cross section for electron elastic scattering in water
44// Reference: TNS Geant4-DNA paper
45// S. Chauvie et al., Geant4 physics processes for microdosimetry simulation:
46// design foundation and implementation of the first set of models,
47// IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007.
48// Further documentation available from http://www.ge.infn.it/geant4/dna
49
50// -------------------------------------------------------------------
51
52
53#include "G4CrossSectionChargeIncreasePartial.hh"
54#include "G4DynamicParticle.hh"
55#include "G4ParticleDefinition.hh"
56#include "G4Proton.hh"
57#include "G4DNAGenericIonsManager.hh"
58
59#include "Randomize.hh"
60
61G4CrossSectionChargeIncreasePartial::G4CrossSectionChargeIncreasePartial()
62{
63
64  //ALPHA+
65  f0[0][0]=1.;
66  a0[0][0]=2.25;
67  a1[0][0]=-0.75;
68  b0[0][0]=-32.10;
69  c0[0][0]=0.600;
70  d0[0][0]=2.40;
71  x0[0][0]=4.60;
72
73  x1[0][0]=-1.;
74  b1[0][0]=-1.;
75   
76  numberOfPartialCrossSections[0]=1;
77
78  //HELIUM
79
80  f0[0][1]=1.;
81  a0[0][1]=2.25;
82  a1[0][1]=-0.75;
83  b0[0][1]=-30.93;
84  c0[0][1]=0.590;
85  d0[0][1]=2.35;
86  x0[0][1]=4.29;
87
88  f0[1][1]=1.;
89  a0[1][1]=2.25;
90  a1[1][1]=-0.75;
91  b0[1][1]=-32.61;
92  c0[1][1]=0.435;
93  d0[1][1]=2.70;
94  x0[1][1]=4.45;
95
96  x1[0][1]=-1.;
97  b1[0][1]=-1.;
98
99  x1[1][1]=-1.;
100  b1[1][1]=-1.;
101
102  numberOfPartialCrossSections[1]=2;
103
104}
105
106G4CrossSectionChargeIncreasePartial::~G4CrossSectionChargeIncreasePartial()
107{ }
108 
109G4double G4CrossSectionChargeIncreasePartial::CrossSection(G4double k, G4int index, 
110                                                           const G4ParticleDefinition* particleDefinition)
111{
112
113  G4int particleTypeIndex = 0;
114  G4DNAGenericIonsManager *instance;
115  instance = G4DNAGenericIonsManager::Instance();
116
117  if (particleDefinition == instance->GetIon("alpha+")) particleTypeIndex=0;
118  if (particleDefinition == instance->GetIon("helium")) particleTypeIndex=1;
119
120  //
121  // sigma(T) = f0 10 ^ y(log10(T/eV))
122  //
123  //         /  a0 x + b0                    x < x0
124  //         |
125  // y(x) = <   a0 x + b0 - c0 (x - x0)^d0   x0 <= x < x1
126  //         |
127  //         \  a1 x + b1                    x >= x1
128  //
129  //
130  // f0, a0, a1, b0, b1, c0, d0, x0, x1 are parameters that change for protons and helium (0, +, ++)
131  //
132  // 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)
133  //
134  // From Rad. Phys. and Chem. 59 (2000) 255-275, M. Dingfelder et al.
135  // Inelastic-collision cross sections of liquid water for interactions of energetic proton
136  //
137 
138  if (x1[index][particleTypeIndex]<x0[index][particleTypeIndex])
139    {
140      //
141      // 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)
142      //
143      // x1 = x0 + ((a0 - a1)/(c0 * d0)) ^ (1 / (d0 - 1))
144      //
145      // b1 = (a0 - a1) * x1 + b0 - c0 * (x1 - x0) ^ d0
146      //
147 
148      x1[index][particleTypeIndex]=x0[index][particleTypeIndex] + std::pow((a0[index][particleTypeIndex] - a1[index][particleTypeIndex]) / (c0[index][particleTypeIndex] * d0[index][particleTypeIndex]), 1. / (d0[index][particleTypeIndex] - 1.));
149      b1[index][particleTypeIndex]=(a0[index][particleTypeIndex] - a1[index][particleTypeIndex]) * x1[index][particleTypeIndex] + b0[index][particleTypeIndex] - c0[index][particleTypeIndex] * std::pow(x1[index][particleTypeIndex] - x0[index][particleTypeIndex], d0[index][particleTypeIndex]);
150    }
151
152  G4double x(std::log10(k/eV));
153  G4double y;
154 
155  if (x<x0[index][particleTypeIndex])
156    y=a0[index][particleTypeIndex] * x + b0[index][particleTypeIndex];
157  else if (x<x1[index][particleTypeIndex])
158    y=a0[index][particleTypeIndex] * x + b0[index][particleTypeIndex] - c0[index][particleTypeIndex] * std::pow(x - x0[index][particleTypeIndex], d0[index][particleTypeIndex]);
159  else
160    y=a1[index][particleTypeIndex] * x + b1[index][particleTypeIndex];
161
162  return f0[index][particleTypeIndex] * std::pow(10., y)*m*m;
163
164 
165}
166
167G4int G4CrossSectionChargeIncreasePartial::RandomSelect(G4double k, 
168                                                        const G4ParticleDefinition* particleDefinition)
169{
170
171  G4int particleTypeIndex = 0;
172  G4DNAGenericIonsManager *instance;
173  instance = G4DNAGenericIonsManager::Instance();
174
175  if (particleDefinition == instance->GetIon("hydrogen")) return 0;
176  if (particleDefinition == instance->GetIon("alpha+")) particleTypeIndex=0;
177  if (particleDefinition == instance->GetIon("helium")) particleTypeIndex=1;
178
179  const G4int n = numberOfPartialCrossSections[particleTypeIndex];
180  G4double* values(new G4double[n]);
181  G4double value = 0;
182  G4int i = n;
183 
184  while (i>0)
185    {
186      i--;
187      values[i]=CrossSection(k, i, particleDefinition);
188      value+=values[i];
189    }
190 
191  value*=G4UniformRand();
192 
193  i=n;
194  while (i>0)
195    {
196      i--;
197   
198      if (values[i]>value)
199        break;
200 
201      value-=values[i];
202    }
203 
204  delete[] values;
205 
206  return i;
207}
208
209G4double G4CrossSectionChargeIncreasePartial::Sum(G4double k, const G4ParticleDefinition* particleDefinition)
210{
211  G4int particleTypeIndex = 0;
212  G4DNAGenericIonsManager *instance;
213  instance = G4DNAGenericIonsManager::Instance();
214
215  if (particleDefinition == instance->GetIon("alpha+")) particleTypeIndex=0;
216  if (particleDefinition == instance->GetIon("helium")) particleTypeIndex=1;
217
218  G4double totalCrossSection = 0.;
219
220  for (G4int i=0; i<numberOfPartialCrossSections[particleTypeIndex]; i++)
221    {
222      totalCrossSection += CrossSection(k,i,particleDefinition);
223    }
224  return totalCrossSection;
225}
226
227
Note: See TracBrowser for help on using the repository browser.