Changeset 961 for trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionChargeDecreasePartial.cc
- Timestamp:
- Apr 6, 2009, 12:21:12 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionChargeDecreasePartial.cc
r819 r961 24 24 // ******************************************************************** 25 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 26 // $Id: G4CrossSectionChargeDecreasePartial.cc,v 1.2 2008/07/14 20:47:34 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 53 28 54 29 #include "G4CrossSectionChargeDecreasePartial.hh" 55 #include "G4ParticleDefinition.hh" 56 #include "G4Proton.hh" 57 #include "G4DNAGenericIonsManager.hh" 58 59 #include "Randomize.hh" 60 30 31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 61 32 62 33 G4CrossSectionChargeDecreasePartial::G4CrossSectionChargeDecreasePartial() … … 116 87 } 117 88 89 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 90 118 91 G4CrossSectionChargeDecreasePartial::~G4CrossSectionChargeDecreasePartial() 119 { } 120 92 {} 93 94 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 95 121 96 G4double G4CrossSectionChargeDecreasePartial::CrossSection(G4double k, G4int index, 122 97 const G4ParticleDefinition* particleDefinition) … … 149 124 150 125 if (x1[index][particleTypeIndex]<x0[index][particleTypeIndex]) 151 126 { 152 127 // 153 128 // 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) … … 163 138 + b0[index][particleTypeIndex] - c0[index][particleTypeIndex] * std::pow(x1[index][particleTypeIndex] 164 139 - x0[index][particleTypeIndex], d0[index][particleTypeIndex]); 165 140 } 166 141 167 142 G4double x(std::log10(k/eV)); … … 197 172 198 173 while (i>0) 199 174 { 200 175 i--; 201 176 values[i]=CrossSection(k, i, particleDefinition); 202 177 value+=values[i]; 203 178 } 204 179 205 180 value*=G4UniformRand(); … … 207 182 i=n; 208 183 while (i>0) 209 184 { 210 185 i--; 211 186 … … 214 189 215 190 value-=values[i]; 216 191 } 217 192 218 193 delete[] values; … … 220 195 return i; 221 196 } 197 198 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 222 199 223 200 G4double G4CrossSectionChargeDecreasePartial::Sum(G4double k, const G4ParticleDefinition* particleDefinition) … … 234 211 235 212 for (G4int i=0; i<numberOfPartialCrossSections[particleTypeIndex]; i++) 236 237 238 213 { 214 totalCrossSection += CrossSection(k,i,particleDefinition); 215 } 239 216 return totalCrossSection; 240 217 } 241 242
Note: See TracChangeset
for help on using the changeset viewer.