Changeset 961 for trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionExcitationBornPartial.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/G4CrossSectionExcitationBornPartial.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: G4CrossSectionExcitationBornPartial.cc,v 1.1 2007/10/15 08:57:54 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 26 // $Id: G4CrossSectionExcitationBornPartial.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 "G4CrossSectionExcitationBornPartial.hh" 54 #include "G4Track.hh"55 #include "G4DynamicParticle.hh"56 #include "G4ParticleDefinition.hh"57 #include "G4Electron.hh"58 #include "G4LogLogInterpolation.hh"59 30 60 #include "Randomize.hh" 61 62 #include <deque> 31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 63 32 64 33 G4CrossSectionExcitationBornPartial::G4CrossSectionExcitationBornPartial() 65 34 { 66 35 table = 0; 67 // nLevels = waterExcitation.NumberOfLevels();68 36 } 69 37 38 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 70 39 71 40 G4CrossSectionExcitationBornPartial::~G4CrossSectionExcitationBornPartial() … … 74 43 } 75 44 45 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 76 46 77 47 G4int G4CrossSectionExcitationBornPartial::RandomSelect(G4double k) 78 48 { 79 // Lazy initialisation: load cross section tables in memory the first time access to them is required80 81 49 G4int level = 0; 82 50 83 51 if (table == 0) 84 { 85 // Load tables 86 // ---- MGP ---- 87 table = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, eV,(1e-22/3.343)*m*m ); 88 table->LoadData("dna/sigma_excitation_p_born"); 89 90 // ---- MGP ---- Temporary 91 table->PrintData(); 92 } 52 { 53 table = new G4DNACrossSectionDataSet(new G4LogLogInterpolation, eV,(1e-22/3.343)*m*m ); 54 table->LoadData("dna/sigma_excitation_p_born"); 55 } 93 56 94 57 G4double* valuesBuffer = new G4double[table->NumberOfComponents()]; … … 99 62 100 63 while (i>0) 101 102 103 104 105 64 { 65 i--; 66 valuesBuffer[i] = table->GetComponent(i)->FindValue(k); 67 value += valuesBuffer[i]; 68 } 106 69 107 70 value *= G4UniformRand(); … … 110 73 111 74 while (i > 0) 75 { 76 i--; 77 78 if (valuesBuffer[i] > value) 112 79 { 113 i--; 114 115 if (valuesBuffer[i] > value) 116 { 117 delete[] valuesBuffer; 118 return i; 119 } 80 delete[] valuesBuffer; 81 return i; 82 } 120 83 value -= valuesBuffer[i]; 121 84 } 122 85 123 // It should never end up here124 125 // ---- MGP ---- Is the following line really necessary?126 86 if (valuesBuffer) delete[] valuesBuffer; 127 87
Note: See TracChangeset
for help on using the changeset viewer.