Changeset 961 for trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionExcitationEmfietzoglouPartial.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/G4CrossSectionExcitationEmfietzoglouPartial.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: G4CrossSectionExcitationEmfietzoglouPartial.cc,v 1.2 2007/12/10 16:31:26 gunter 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 26 // $Id: G4CrossSectionExcitationEmfietzoglouPartial.cc,v 1.3 2008/07/14 20:47:34 sincerti Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 52 28 53 29 #include "G4CrossSectionExcitationEmfietzoglouPartial.hh" 54 #include "G4Track.hh"55 #include "G4DynamicParticle.hh"56 #include "G4ParticleDefinition.hh"57 #include "G4Electron.hh"58 30 59 #include "Randomize.hh" 60 61 #include <deque> 31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 62 32 63 33 G4CrossSectionExcitationEmfietzoglouPartial::G4CrossSectionExcitationEmfietzoglouPartial() 64 34 { 65 66 35 nLevels = waterExcitation.NumberOfLevels(); 67 //G4cout << "Water excitation energy: number of levels = " << nLevels << G4endl;68 36 } 69 37 38 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 70 39 71 40 G4CrossSectionExcitationEmfietzoglouPartial::~G4CrossSectionExcitationEmfietzoglouPartial() 72 { 41 {} 73 42 43 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 44 74 45 G4double G4CrossSectionExcitationEmfietzoglouPartial::CrossSection(G4double t, G4int level) 75 46 { … … 84 55 // Aj, Bj, Cj & Pj are parameters that can be found in Emfietzoglou's papers 85 56 // 86 //87 57 // From Phys. Med. Biol. 48 (2003) 2355-2371, D.Emfietzoglou, 88 58 // Monte Carlo Simulation of the energy loss of low energy electrons in liquid Water 89 59 // 90 60 // Scaling for macroscopic cross section: number of water moleculs per unit volume 91 // (capra) const G4double sigma0 = (10. / 3.343e22) * cm2; 61 // const G4double sigma0 = (10. / 3.343e22) * cm2; 62 92 63 const G4double density = 3.34192e+19 * mm3; 93 64 … … 100 71 101 72 G4double exc = waterExcitation.ExcitationEnergy(level); 102 // G4cout << "Water excitation energy " << exc/keV << " level = " << level << G4endl; 103 73 104 74 if (t >= exc) 105 75 { … … 113 83 } 114 84 85 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 86 115 87 G4int G4CrossSectionExcitationEmfietzoglouPartial::RandomSelect(G4double k) 116 88 { … … 119 91 std::deque<double> values; 120 92 121 // ---- MGP ---- The following algorithm is wrong: it works i sthe cross section93 // ---- MGP ---- The following algorithm is wrong: it works if the cross section 122 94 // is a monotone increasing function. 123 95 // The algorithm should be corrected by building the cumulative function … … 126 98 127 99 while (i > 0) 128 129 130 131 132 133 100 { 101 i--; 102 G4double partial = CrossSection(k,i); 103 values.push_front(partial); 104 value += partial; 105 } 134 106 135 107 value *= G4UniformRand(); 136 108 137 109 i = nLevels; 138 110 139 140 141 142 143 144 111 while (i > 0) 112 { 113 i--; 114 if (values[i] > value) return i; 115 value -= values[i]; 116 } 145 117 146 118 return 0; 147 119 } 120 121 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 148 122 149 123 G4double G4CrossSectionExcitationEmfietzoglouPartial::Sum(G4double k) … … 152 126 153 127 for (G4int i=0; i<nLevels; i++) 154 155 156 128 { 129 totalCrossSection += CrossSection(k,i); 130 } 157 131 return totalCrossSection; 158 132 }
Note: See TracChangeset
for help on using the changeset viewer.